From 59c4916a3c1d9eac87ae9c55149daf4e4dd0a6c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Rialland?= Date: Wed, 21 Jun 2023 19:06:24 +0200 Subject: [PATCH] Fix types --- .../pages/assistants/choix-du-statut/comparateur.tsx | 9 ++++++--- .../comparaison-statuts/components/Comparateur.tsx | 4 ++-- .../comparaison-statuts/components/StatusCard.tsx | 4 ++-- .../pages/simulateurs/comparaison-statuts/utils.ts | 4 ++-- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/site/source/pages/assistants/choix-du-statut/comparateur.tsx b/site/source/pages/assistants/choix-du-statut/comparateur.tsx index e61bef64c..75e965cf1 100644 --- a/site/source/pages/assistants/choix-du-statut/comparateur.tsx +++ b/site/source/pages/assistants/choix-du-statut/comparateur.tsx @@ -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 { +function usePossibleStatuts(): Array { 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 { } } -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': diff --git a/site/source/pages/simulateurs/comparaison-statuts/components/Comparateur.tsx b/site/source/pages/simulateurs/comparaison-statuts/components/Comparateur.tsx index db88332ee..3b6921a7a 100644 --- a/site/source/pages/simulateurs/comparaison-statuts/components/Comparateur.tsx +++ b/site/source/pages/simulateurs/comparaison-statuts/components/Comparateur.tsx @@ -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 - name: Statut + name: StatutType } export type EngineComparison = diff --git a/site/source/pages/simulateurs/comparaison-statuts/components/StatusCard.tsx b/site/source/pages/simulateurs/comparaison-statuts/components/StatusCard.tsx index be8db7638..80cbc5f07 100644 --- a/site/source/pages/simulateurs/comparaison-statuts/components/StatusCard.tsx +++ b/site/source/pages/simulateurs/comparaison-statuts/components/StatusCard.tsx @@ -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 diff --git a/site/source/pages/simulateurs/comparaison-statuts/utils.ts b/site/source/pages/simulateurs/comparaison-statuts/utils.ts index 95949e1f3..8c699bad8 100644 --- a/site/source/pages/simulateurs/comparaison-statuts/utils.ts +++ b/site/source/pages/simulateurs/comparaison-statuts/utils.ts @@ -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 - name: Statut + name: StatutType value: Evaluation } export const getBestOption = (options: OptionType[]) => {