import { AnyAction } from 'redux' ; import { ThunkDispatch } from 'redux-thunk' ; import { connect } from 'react-redux' ; import { FlyoutFooter } from './flyout_footer' ; import { FLYOUT_STATE } from '../../../reducers/ui' ; import { hasDirtyState } from '../../../selectors/map_selectors' ; import { setSelectedLayer , removeSelectedLayer , removeTrackedLayerStateForSelectedLayer , updateFlyout , } from '../../../actions' ; import { MapStoreState } from '../../../reducers/store' ; function mapStateToProps ( state ) { return { hasStateChanged : hasDirtyState ( state ) , } ; } const mapDispatchToProps = ( dispatch ) => { return { cancelLayerPanel : ( ) => { dispatch ( updateFlyout ( FLYOUT_STATE . NONE ) ) ; dispatch ( setSelectedLayer ( null ) ) ; } , saveLayerEdits : ( ) => { dispatch ( updateFlyout ( FLYOUT_STATE . NONE ) ) ; dispatch ( removeTrackedLayerStateForSelectedLayer ( ) ) ; dispatch ( setSelectedLayer ( null ) ) ; } , removeLayer : ( ) => { dispatch ( removeSelectedLayer ( ) ) ; } , } ; } ; const connectedFlyoutFooter = connect ( mapStateToProps , mapDispatchToProps ) ( FlyoutFooter ) ; export { connectedFlyoutFooter as FlyoutFooter } ;