refactor: ajoute une prop contexte à SimulationValue
parent
94d8d197be
commit
82dd0929fa
|
@ -6,6 +6,7 @@ import { styled } from 'styled-components'
|
|||
|
||||
import { Grid } from '@/design-system/layout'
|
||||
import { Body } from '@/design-system/typography/paragraphs'
|
||||
import { Contexte } from '@/domaine/Contexte'
|
||||
import { targetUnitSelector } from '@/store/selectors/simulationSelectors'
|
||||
|
||||
import RuleLink from '../RuleLink'
|
||||
|
@ -22,6 +23,7 @@ type SimulationValueProps = {
|
|||
isInfoMode?: boolean
|
||||
displayedUnit?: string
|
||||
round?: boolean
|
||||
contexte?: Contexte
|
||||
}
|
||||
|
||||
export function SimulationValue({
|
||||
|
@ -32,6 +34,7 @@ export function SimulationValue({
|
|||
appear = true,
|
||||
isTypeBoolean = false, // TODO : remove when type inference works in publicodes
|
||||
isInfoMode = false,
|
||||
contexte = {},
|
||||
}: SimulationValueProps) {
|
||||
const engine = useEngine()
|
||||
const currentUnit = useSelector(targetUnitSelector)
|
||||
|
@ -39,6 +42,7 @@ export function SimulationValue({
|
|||
valeur: dottedName,
|
||||
arrondi: round ? 'oui' : 'non',
|
||||
...(!isTypeBoolean ? { unité: currentUnit } : {}),
|
||||
contexte,
|
||||
})
|
||||
const initialRender = useInitialRender()
|
||||
if (evaluation.nodeValue === null) {
|
||||
|
|
Loading…
Reference in New Issue