refactor: ajoute une prop contexte à SimulationValue

pull/3197/head
Alice Dahan 2024-10-15 16:53:26 +02:00 committed by liliced
parent 94d8d197be
commit 82dd0929fa
1 changed files with 4 additions and 0 deletions

View File

@ -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) {