diff --git a/nupes-elections-front/src/includes/composants_elections.js b/nupes-elections-front/src/includes/composants_elections.js index f5cebb9..11f31a0 100644 --- a/nupes-elections-front/src/includes/composants_elections.js +++ b/nupes-elections-front/src/includes/composants_elections.js @@ -118,7 +118,7 @@ export function CompositionHemicycle({titre, blocs, nuances, siegesParBloc, sieg */ export function TableauParticipation({donnees_t1, donnees_t2 = null}) { const headerRow = useMemo(() => { - if (donnees_t2) { + if (donnees_t2 && donnees_t2.inscrits) { return Nombre tour 1 @@ -140,7 +140,7 @@ export function TableauParticipation({donnees_t1, donnees_t2 = null}) { }, [donnees_t2]) const bodyRows = useMemo(() => { - if (donnees_t2) { + if (donnees_t2 && donnees_t2.inscrits) { return <> Inscrit⋅es diff --git a/nupes-elections-front/src/includes/composants_elections_legislatives.js b/nupes-elections-front/src/includes/composants_elections_legislatives.js index e014cd2..a4cafc6 100644 --- a/nupes-elections-front/src/includes/composants_elections_legislatives.js +++ b/nupes-elections-front/src/includes/composants_elections_legislatives.js @@ -12,6 +12,18 @@ export function TableauResultatsCandidatsLegislatives({blocs, candidats, nuances const voixCandidats_t2 = donnees_t2?.voix ?? {} const candidatsTriees = trierCandidats(candidats, voixCandidats_t1) + const cellules_t1 = <> + Voix tour 1 + % Inscrit⋅es tour 1 + % Exprimé⋅es tour 1 + + + const cellules_t2 = Math.max(...Object.values(voixCandidats_t2)) === 0 ? <> : <> + Voix tour 2 + % Inscrit⋅es tour 2 + % Exprimé⋅es tour 2 + + return <> @@ -21,12 +33,8 @@ export function TableauResultatsCandidatsLegislatives({blocs, candidats, nuances CandidatNuanceBloc - Voix tour 1 - % Inscrit⋅es tour 1 - % Exprimé⋅es tour 1 - Voix tour 2 - % Inscrit⋅es tour 2 - % Exprimé⋅es tour 2 + {cellules_t1} + {cellules_t2}