import { findRuleByDottedName, nestedSituationToPathMap } from 'Engine/rules' import { compose, filter, map, toPairs } from 'ramda' import React from 'react' import emoji from 'react-easy-emoji' import { Trans, translate } from 'react-i18next' import { connect } from 'react-redux' import { batchActions } from 'redux-batched-actions' import { change, Field, reduxForm } from 'redux-form' import { flatRulesSelector, situationSelector } from 'Selectors/analyseSelectors' import './PeriodSwitch.css' export default compose( reduxForm({ form: 'conversation', destroyOnUnmount: false, initialValues: { période: 'année' } }), translate(), connect( state => ({ rules: flatRulesSelector(state), situation: nestedSituationToPathMap(situationSelector(state)) }), dispatch => ({ batchPeriodChange: actions => dispatch(batchActions(actions)) }) ) )(function PeriodSwitch({ situation, rules, batchPeriodChange }) { return (