import { connect } from 'react-redux';

import {
  facebookLoginSuccess,
  logout,
  registrationServiceError,
  userCanceledRegistration,
} from '../../actions/profile.js';

import FacebookLogin from './FacebookLogin.js';

const mapDispatchToProps = (dispatch) => ({
  doCancelAction: () => dispatch(userCanceledRegistration()),
  doErrorAction: (error) => dispatch(registrationServiceError(error)),
  doLogoutAction: () => dispatch(logout()),
  doSuccessAction: (result) => dispatch(facebookLoginSuccess(result)),
});

export default connect(null, mapDispatchToProps)(FacebookLogin);
