feat: ajoute le nombre de familles résistantes

main
Sébastien Arod 2024-12-09 21:27:33 +01:00
parent 723420a168
commit 551adffa48
1 changed files with 4 additions and 1 deletions

View File

@ -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<HTMLInputElement>) =>
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 (
<>
<h2 style={{textAlign:"center"}}>Les {nbFamillesResistantes} familles résistantes !</h2>
<div id="listeResistants">
<Group position="center">
<SegmentedControl