feat: ajoute le nombre de familles résistantes
parent
723420a168
commit
551adffa48
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue