diff --git a/src/components/ResultStaticsTable.tsx b/src/components/ResultStatisticsTable.tsx similarity index 75% rename from src/components/ResultStaticsTable.tsx rename to src/components/ResultStatisticsTable.tsx index 9338c9e..057acba 100644 --- a/src/components/ResultStaticsTable.tsx +++ b/src/components/ResultStatisticsTable.tsx @@ -1,4 +1,4 @@ -import { Button } from "@mantine/core" +import {Button } from "@mantine/core" import React from "react" import { useNavigate } from "react-router-dom" import { useLocalStorage } from "../hooks" @@ -38,7 +38,10 @@ const ResultStatisticsTable = () => { if (!roundResults) { return <> } - + const uniqueRoundResults = roundResults.filter( + (result: any, index: number, self: any[]) => + self.findIndex((r) => r.seed === result.seed) === index + ) return (
{ tableName="Results" data={{ head: ["Seed"].concat(statistics), - body: roundResults.map((result: any) => + body: uniqueRoundResults.map((result: any) => [result.seed].concat( statistics.map((statistic) => (result?.statistics ?? {})[statistic].toString(), @@ -64,22 +67,20 @@ const ResultStatisticsTable = () => { if (columnName === "Seed") { return ( + ) } diff --git a/src/components/pages/RoundPage.tsx b/src/components/pages/RoundPage.tsx index a157fc1..d8b796a 100644 --- a/src/components/pages/RoundPage.tsx +++ b/src/components/pages/RoundPage.tsx @@ -16,7 +16,7 @@ import { import Block from "../blocks/Block" import BotSelector from "../blocks/BotSelector" import TournamentBlock from "../blocks/TournamentBlock" -import ResultStatisticsTable from "../ResultStaticsTable" +import ResultStatisticsTable from "../ResultStatisticsTable" import ResultWinnerChart from "../ResultWinnerChart" let currentParameters: Record