import { connect } from 'react-redux';

import { setNomDeBid } from '../../../actions/profile.js';
import { getNomDeBid, isGeneratedNomDeBid } from '../../../selectors/profile.js';

import EditNomDeBid from './EditNomDeBid.js';

const matchStateToProps = (state) => ({
    isGeneratedNomDeBid: isGeneratedNomDeBid(state),
    nomDeBid: getNomDeBid(state),
});

const matchDispatchToProps = (dispatch) => ({
    updateNomDeBid: (nomDeBid) => dispatch(setNomDeBid(nomDeBid)),
});

export default connect(
    matchStateToProps,
    matchDispatchToProps,
)(EditNomDeBid);
