diff --git a/src/ResultTable.tsx b/src/ResultTable.tsx index 8a23c74..970204f 100644 --- a/src/ResultTable.tsx +++ b/src/ResultTable.tsx @@ -1,4 +1,4 @@ -import { ActionIcon, Center, Group, Select, Table, Text, rem } from "@mantine/core"; +import { ActionIcon, Center, Group, MultiSelect, Table, Text, rem } from "@mantine/core"; import { IconInfoHexagonFilled, IconSortAscending, IconSortDescending } from "@tabler/icons-react"; import { useMemo, useState } from "react"; import { ComputeResult, distanceSortAsc, distanceSortDesc, scoreSortAsc, scoreSortDesc } from "./compute"; @@ -23,18 +23,18 @@ interface Props { onSelectDetail: (schoolFase: string) => void; } export default function ResultTable({ networks, scores, onSelectDetail, selectedFase }: Props) { - const [filterNetwork, setFilterNetwork] = useState(null); + const [filterNetwork, setFilterNetwork] = useState([]); const [sortOrder, setSortOrder] = useState("desc"); const [sortColumn, setSortColumn] = useState("score"); const schoolsScores = useMemo(() => { return Array.from(scores || []) - .filter((s) => !filterNetwork || s.school.reseau === filterNetwork) + .filter((s) => !filterNetwork.length || filterNetwork.includes(s.school.reseau)) .sort(getSortFn(sortColumn, sortOrder)); }, [scores, sortColumn, sortOrder, filterNetwork]); return ( -