From 551adffa4899b9f4c7f6ca25b9113b5be7709236 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Arod?= Date: Mon, 9 Dec 2024 21:27:33 +0100 Subject: [PATCH] =?UTF-8?q?feat:=20ajoute=20le=20nombre=20de=20familles=20?= =?UTF-8?q?r=C3=A9sistantes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/routes/Liste/index.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/routes/Liste/index.tsx b/src/routes/Liste/index.tsx index bd7fd0f..806682f 100644 --- a/src/routes/Liste/index.tsx +++ b/src/routes/Liste/index.tsx @@ -13,7 +13,7 @@ import { } from "@tabler/icons-react"; import React, { Suspense, lazy } from "react"; import { Outlet } from "react-router"; -import { resistantsOrder } from "../../Resistant"; +import { isAncienResistant, resistantsOrder } from "../../Resistant"; import { Separator } from "../../components/Separator"; import { DisplayModeContext } from "../../context/DisplayModeContext"; import { HomeContext } from "../../context/HomeContext"; @@ -44,6 +44,8 @@ export const ListeResistants = () => { const filtreNom = (event: React.ChangeEvent) => setNom(event.target.value); + const nbFamillesResistantes = resistants.filter(r => !isAncienResistant(r)).length; + const filteredResistants = resistants .filter( (r) => !nom || normalize(r.noms).includes(normalize(nom.toLowerCase())) @@ -60,6 +62,7 @@ export const ListeResistants = () => { return ( <> +

Les {nbFamillesResistantes} familles résistantes !