import React, { Component } from 'react' import classNames from 'classnames' import {Link} from 'react-router-dom' import {connect} from 'react-redux' import R from 'ramda' import './Results.css' import {capitalise0} from '../utils' import {computeRuleValue} from '../engine/traverse' import {encodeRuleName, getObjectives} from '../engine/rules' let fmt = new Intl.NumberFormat('fr-FR').format let humanFigure = decimalDigits => value => fmt(value.toFixed(decimalDigits)) @connect( state => ({ pointedOutObjectives: state.pointedOutObjectives, analysedSituation: state.analysedSituation, conversationStarted: !R.isEmpty(state.form) }) ) export default class Results extends Component { render() { let {analysedSituation, pointedOutObjectives, conversationStarted} = this.props, explanation = getObjectives(analysedSituation) if (!explanation) return null return (

Vos résultats

{do {let text = R.path(['simulateur', 'résultats'])(analysedSituation) text &&

{text}

}} {conversationStarted &&

Cliquez pour comprendre chaque calcul

}
) } }