mon-entreprise/source/components/Results.js

35 lines
887 B
JavaScript
Raw Normal View History

import React, { Component } from 'react'
2017-02-09 12:58:12 +00:00
import classNames from 'classnames'
export default class Results extends Component {
render() {
let {analysedSituation} = this.props
return (
<section id="results">
<h2>Vos obligations</h2>
<ul>
{analysedSituation.map(
({name, type, derived: {missingVariables, computedValue}}) =>
2017-02-09 12:58:12 +00:00
do {
let
unsatisfied = missingVariables && missingVariables.length,
irrelevant = !unsatisfied && computedValue == null;
<li key={name} className={classNames({unsatisfied, number: !unsatisfied && !irrelevant})}>
<h3>{type} {name}</h3>
<p>
{unsatisfied ?
'En attente de vos réponses...'
: irrelevant ?
"Vous n'êtes pas concernés"
:computedValue + '€'
}
</p>
</li>
}
)}
</ul>
</section>
)
}
}