Explication graphique de l'allegement
parent
2b97218c69
commit
0197f9647b
|
@ -0,0 +1,60 @@
|
|||
import React from 'react'
|
||||
import { Node } from './common'
|
||||
import { makeJsx } from '../evaluation'
|
||||
import { mapObjIndexed, values } from 'ramda'
|
||||
|
||||
export default (nodeValue, explanation) => (
|
||||
<div>
|
||||
<Node
|
||||
classes="mecanism allègement"
|
||||
name="allègement"
|
||||
value={nodeValue}
|
||||
child={
|
||||
<ul className="properties">
|
||||
<li key="assiette">
|
||||
<span className="key">assiette: </span>
|
||||
<span className="value">{makeJsx(explanation.assiette)}</span>
|
||||
</li>
|
||||
{explanation.franchise && (
|
||||
<li key="franchise">
|
||||
<span className="key">franchise: </span>
|
||||
<span className="value">{makeJsx(explanation.franchise)}</span>
|
||||
</li>
|
||||
)}
|
||||
{explanation.décote && (
|
||||
<li key="décote">
|
||||
<span className="key">décote: </span>
|
||||
<span className="value">
|
||||
<ObjectView data={explanation.décote} />
|
||||
</span>
|
||||
</li>
|
||||
)}
|
||||
{explanation.abattement && (
|
||||
<li key="abattement">
|
||||
<span className="key">abattement: </span>
|
||||
<span className="value">{makeJsx(explanation.abattement)}</span>
|
||||
</li>
|
||||
)}
|
||||
</ul>
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
|
||||
let ObjectView = ({ data }) =>
|
||||
console.log('data', data) || (
|
||||
<ul className="properties">
|
||||
{values(
|
||||
mapObjIndexed(
|
||||
(v, k) => (
|
||||
<li key={k}>
|
||||
{' '}
|
||||
<span className="key">{k}: </span>
|
||||
<span className="value">{makeJsx(v)}</span>
|
||||
</li>
|
||||
),
|
||||
data
|
||||
)
|
||||
)}
|
||||
</ul>
|
||||
)
|
|
@ -50,6 +50,7 @@ import {
|
|||
|
||||
import 'react-virtualized/styles.css'
|
||||
import Somme from './mecanismViews/Somme'
|
||||
import Allègement from './mecanismViews/Allègement'
|
||||
import buildSelectionView from './mecanismViews/Selection'
|
||||
import uniroot from './uniroot'
|
||||
|
||||
|
@ -575,7 +576,7 @@ export let mecanismReduction = (recurse, k, v) => {
|
|||
|
||||
return {
|
||||
evaluate,
|
||||
jsx: (nodeValue, explanation) => <div>Allègement</div>,
|
||||
jsx: Allègement,
|
||||
explanation,
|
||||
category: 'mecanism',
|
||||
name: 'allègement',
|
||||
|
|
Loading…
Reference in New Issue