2018-12-11 12:50:53 +00:00
|
|
|
import React from 'react'
|
|
|
|
import { analysisWithDefaultsSelector } from 'Selectors/analyseSelectors'
|
|
|
|
import { connect } from 'react-redux'
|
2018-12-13 18:12:19 +00:00
|
|
|
import './ComparativeTargets.css'
|
2018-12-11 12:50:53 +00:00
|
|
|
import withColours from 'Components/utils/withColours'
|
|
|
|
import { Link } from 'react-router-dom'
|
|
|
|
import emoji from 'react-easy-emoji'
|
|
|
|
import { compose } from 'ramda'
|
2018-12-12 11:00:49 +00:00
|
|
|
import simulationConfig from './simulateur-rémunération-dirigeant.yaml'
|
2018-12-13 18:12:19 +00:00
|
|
|
import AnimatedTargetValue from './AnimatedTargetValue'
|
2018-12-11 12:50:53 +00:00
|
|
|
|
|
|
|
export default compose(
|
|
|
|
connect(state => ({
|
2018-12-12 11:00:49 +00:00
|
|
|
analyses: analysisWithDefaultsSelector(state, simulationConfig)
|
2018-12-11 12:50:53 +00:00
|
|
|
})),
|
|
|
|
withColours
|
|
|
|
)(
|
2018-12-13 18:12:19 +00:00
|
|
|
class ComparativeTargets extends React.Component {
|
2018-12-11 12:50:53 +00:00
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<div id="targets">
|
|
|
|
<div
|
|
|
|
className="content"
|
|
|
|
style={{ color: this.props.colours.textColour }}>
|
|
|
|
<ul>
|
|
|
|
{this.props.analyses.map((analysis, i) => {
|
2018-12-13 18:12:19 +00:00
|
|
|
let { title, nodeValue, dottedName } = analysis.targets[0],
|
|
|
|
name = simulationConfig.branches[i].nom
|
2018-12-11 12:50:53 +00:00
|
|
|
return (
|
2018-12-13 18:12:19 +00:00
|
|
|
<li key={name}>
|
|
|
|
{name}
|
2018-12-11 12:50:53 +00:00
|
|
|
<span className="figure">
|
2018-12-13 18:12:19 +00:00
|
|
|
<span className="value">
|
|
|
|
<AnimatedTargetValue value={nodeValue} />
|
|
|
|
</span>{' '}
|
2018-12-11 12:50:53 +00:00
|
|
|
</span>
|
|
|
|
<Link
|
|
|
|
title="Quel est calcul ?"
|
|
|
|
style={{ color: this.props.colours.colour }}
|
|
|
|
to={'/règle/' + dottedName}
|
|
|
|
className="explanation">
|
|
|
|
{emoji('📖')}
|
|
|
|
</Link>
|
|
|
|
</li>
|
|
|
|
)
|
|
|
|
})}
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
)
|