Fix types

pull/2782/head
Jérémy Rialland 2023-06-21 19:06:24 +02:00 committed by Johan Girod
parent aacd8af075
commit 59c4916a3c
4 changed files with 12 additions and 9 deletions

View File

@ -1,7 +1,7 @@
import { useMemo } from 'react'
import { EngineDocumentationRoutes } from '@/components/EngineDocumentationRoutes'
import { Statut } from '@/components/StatutTag'
import { StatutType } from '@/components/StatutTag'
import { useEngine, useRawSituation } from '@/components/utils/EngineContext'
import { EngineComparison } from '@/pages/simulateurs/comparaison-statuts/components/Comparateur'
import Détails from '@/pages/simulateurs/comparaison-statuts/components/Détails'
@ -50,7 +50,7 @@ function useStatutComparaison(): EngineComparison {
)
}
function usePossibleStatuts(): Array<Statut> {
function usePossibleStatuts(): Array<StatutType> {
const engine = useEngine()
// We could do this logic by filtering the applicable status in publicodes,
// but for now, there is only two options, so we hardcode it
@ -64,7 +64,10 @@ function usePossibleStatuts(): Array<Statut> {
}
}
function getSituationFromStatut(statut: Statut, AEAcre: boolean): Situation {
function getSituationFromStatut(
statut: StatutType,
AEAcre: boolean
): Situation {
return {
'entreprise . catégorie juridique . remplacements': 'oui',
'entreprise . catégorie juridique':

View File

@ -8,7 +8,7 @@ import Simulation, {
SimulationGoal,
SimulationGoals,
} from '@/components/Simulation'
import { Statut } from '@/components/StatutTag'
import { StatutType } from '@/components/StatutTag'
import { Spacing } from '@/design-system/layout'
import { useSitePaths } from '@/sitePaths'
@ -17,7 +17,7 @@ import Résultats from './Résultats'
type NamedEngine = {
engine: Engine<DottedName>
name: Statut
name: StatutType
}
export type EngineComparison =

View File

@ -2,7 +2,7 @@ import { ReactNode, useRef } from 'react'
import { Trans } from 'react-i18next'
import styled from 'styled-components'
import { Statut, StatutTag } from '@/components/StatutTag'
import { StatutTag, StatutType } from '@/components/StatutTag'
import { CardContainer } from '@/design-system/card/Card'
import { Emoji } from '@/design-system/emoji'
import { Grid } from '@/design-system/layout'
@ -11,7 +11,7 @@ import { Body } from '@/design-system/typography/paragraphs'
import { generateUuid } from '@/utils'
type StatutCardType = {
statut: Statut[]
statut: StatutType[]
footerContent?: ReactNode
isBestOption?: boolean
children: ReactNode

View File

@ -1,11 +1,11 @@
import Engine, { Evaluation } from 'publicodes'
import { DottedName } from '@/../../modele-social'
import { Statut } from '@/components/StatutTag'
import { StatutType } from '@/components/StatutTag'
export type OptionType = {
engine: Engine<DottedName>
name: Statut
name: StatutType
value: Evaluation
}
export const getBestOption = (options: OptionType[]) => {