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