From a05aae798f38e47a52425237f24f45ebd5952fb8 Mon Sep 17 00:00:00 2001 From: Dvir Komlosh Date: Fri, 20 Jun 2025 12:51:14 +0300 Subject: [PATCH 1/2] fix uniquness, fix ctrl+click to open in new tab --- ...icsTable.tsx => ResultStatisticsTable.tsx} | 29 ++++++++++--------- src/components/pages/RoundPage.tsx | 2 +- 2 files changed, 16 insertions(+), 15 deletions(-) rename src/components/{ResultStaticsTable.tsx => ResultStatisticsTable.tsx} (74%) diff --git a/src/components/ResultStaticsTable.tsx b/src/components/ResultStatisticsTable.tsx similarity index 74% rename from src/components/ResultStaticsTable.tsx rename to src/components/ResultStatisticsTable.tsx index 9338c9e..2bc8a13 100644 --- a/src/components/ResultStaticsTable.tsx +++ b/src/components/ResultStatisticsTable.tsx @@ -1,4 +1,4 @@ -import { Button } from "@mantine/core" +import { Anchor, 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 From bc6ef3acf890c84f6f91179c819067e628f4ddd3 Mon Sep 17 00:00:00 2001 From: Dvir Komlosh Date: Fri, 25 Jul 2025 12:59:16 +0300 Subject: [PATCH 2/2] remove redundant import --- src/components/ResultStatisticsTable.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/ResultStatisticsTable.tsx b/src/components/ResultStatisticsTable.tsx index 2bc8a13..057acba 100644 --- a/src/components/ResultStatisticsTable.tsx +++ b/src/components/ResultStatisticsTable.tsx @@ -1,4 +1,4 @@ -import { Anchor, Button } from "@mantine/core" +import {Button } from "@mantine/core" import React from "react" import { useNavigate } from "react-router-dom" import { useLocalStorage } from "../hooks"