import { connect } from 'react-redux';
import { StoreState } from 'store/rootReducer';

import account from 'store/account';
import Profile, { StateProps, DispatchProps, OwnProps } from './Profile';

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

const mapDispatchToProps = {
  updateProfile: account.actions.updateProfile.request.action,
};

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

export default Wrapped;
