2017-01-10 18:22:44 +00:00
|
|
|
import React, { Component } from 'react'
|
|
|
|
|
|
|
|
export default class Results extends Component {
|
|
|
|
render() {
|
|
|
|
let {analysedSituation} = this.props
|
|
|
|
return (
|
|
|
|
<section id="results">
|
2017-01-18 08:48:46 +00:00
|
|
|
<h2>Vos obligations</h2>
|
2017-01-10 18:22:44 +00:00
|
|
|
<ul>
|
2017-02-07 19:10:04 +00:00
|
|
|
{analysedSituation.map(({name, type, derived: {missingVariables, computedValue}}) =>
|
2017-01-10 18:22:44 +00:00
|
|
|
<li key={name}>
|
|
|
|
<h3>{type} {name}</h3>
|
2017-01-18 08:48:46 +00:00
|
|
|
<p className="value">
|
2017-02-07 19:10:04 +00:00
|
|
|
{missingVariables && missingVariables.length ?
|
2017-01-10 18:22:44 +00:00
|
|
|
'Répondez aux questions !'
|
2017-02-07 19:10:04 +00:00
|
|
|
: computedValue != null ?
|
|
|
|
computedValue + '€'
|
2017-01-10 18:22:44 +00:00
|
|
|
: 'Non applicable'
|
|
|
|
}
|
|
|
|
</p>
|
|
|
|
</li>
|
|
|
|
)}
|
|
|
|
</ul>
|
|
|
|
</section>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|