/* @flow */ import type { FicheDePaie } from 'Types/ResultViewTypes' import withColours from 'Components/utils/withColours' import withLanguage from 'Components/utils/withLanguage' import Value from 'Components/Value' import { findRuleByDottedName, getRuleFromAnalysis } from 'Engine/rules' import { compose } from 'ramda' import React, { Fragment } from 'react' import { Trans } from 'react-i18next' import { connect } from 'react-redux' import { analysisWithDefaultsSelector, parsedRulesSelector } from 'Selectors/analyseSelectors' import { analysisToCotisationsSelector } from 'Selectors/ficheDePaieSelectors' import './PaySlip.css' import { Line, SalaireBrutSection, SalaireNetSection } from './PaySlipSections' import RuleLink from './RuleLink' type ConnectedPropTypes = ?FicheDePaie & { colours: { lightestColour: string } } export default compose( withColours, connect(state => ({ cotisations: analysisToCotisationsSelector(state), analysis: analysisWithDefaultsSelector(state), parsedRules: parsedRulesSelector(state) })), withLanguage )( ({ colours: { lightestColour }, cotisations, analysis, parsedRules }: ConnectedPropTypes) => { let getRule = getRuleFromAnalysis(analysis) const heuresSupplémentaires = getRule( 'contrat salarié . temps de travail . heures supplémentaires' ) return (