From 86ef7fa18eda4348509da4c8bd26d2bfb3d2753e Mon Sep 17 00:00:00 2001 From: Xanh Date: Wed, 30 Oct 2024 16:46:37 +0700 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20add=20copy=20result=20button?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Leaderboard.tsx | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/src/components/Leaderboard.tsx b/src/components/Leaderboard.tsx index d1ad98b..f56eed5 100644 --- a/src/components/Leaderboard.tsx +++ b/src/components/Leaderboard.tsx @@ -4,6 +4,7 @@ import { Box, Button, Card, + CopyButton, Group, Indicator, ScrollArea, @@ -11,7 +12,7 @@ import { Text, } from '@mantine/core'; import { Sparkline } from '@mantine/charts'; -import { IconTableExport } from '@tabler/icons-react'; +import { IconClipboardCopy, IconTableExport } from '@tabler/icons-react'; import { useAppSelector } from '../redux/store'; import { selectAllRoundsFromGameId } from '../redux/round.selector'; @@ -165,11 +166,33 @@ function Leaderboard(props: Props) { ))} + `${x.name}: ${formatNumber(x.stat)}`) + .map((s) => `${s}\n`) + .join('')} + > + {({ copied, copy }) => ( + + )} +