import { connect } from 'react-redux';
import { StoreState } from 'store/rootReducer';
import auth from 'store/auth';
import ChangePassword, { StateProps, DispatchProps, OwnProps } from './ChangePassword';

const mapStateToProps = (state: StoreState): {} => ({
  profile: state.account.profile && state.account.profile.data,
});

const mapDispatchToProps = {
  changePassword: auth.actions.changePassword.request.action,
  changePasswordFirebase: auth.actions.firebase.changePassword.request.action,
};

const Wrapped = connect<StateProps, DispatchProps, OwnProps>(
  mapStateToProps,
  mapDispatchToProps,
)(ChangePassword);

export default Wrapped;
