import { AnyAction } from 'redux' ; import { ThunkDispatch } from 'redux-thunk' ; import { connect } from 'react-redux' ; import { FeatureEditTools , ReduxDispatchProps , ReduxStateProps , OwnProps , } from './feature_edit_tools' ; import { updateEditShape } from '../../../../actions' ; import { MapStoreState } from '../../../../reducers/store' ; import { DRAW_SHAPE } from '../../../../../common/constants' ; import { getEditState } from '../../../../selectors/map_selectors' ; function mapStateToProps ( state ) { const editState = getEditState ( state ) ; return { drawShape : editState ? editState . drawShape : undefined , } ; } function mapDispatchToProps ( dispatch ) { return { setDrawShape : ( shapeToDraw ) => { dispatch ( updateEditShape ( shapeToDraw ) ) ; } , } ; } const connectedFeatureEditControl = connect < ReduxStateProps , ReduxDispatchProps , OwnProps , MapStoreState > ( mapStateToProps , mapDispatchToProps ) ( FeatureEditTools ) ; export { connectedFeatureEditControl as FeatureEditTools } ;