diff --git a/src/components/panels/info/PgnInput.tsx b/src/components/panels/info/PgnInput.tsx index b882182a..7d28db3b 100644 --- a/src/components/panels/info/PgnInput.tsx +++ b/src/components/panels/info/PgnInput.tsx @@ -1,12 +1,24 @@ -import { Checkbox, Group, Stack, Text, Textarea } from "@mantine/core"; +import { + ActionIcon, + Box, + Checkbox, + CopyButton, + Group, + Stack, + Text, + Textarea, + Tooltip, + rem, +} from "@mantine/core"; import { memo, useMemo } from "react"; import { getPGN } from "@/utils/chess"; import { GameHeaders, TreeNode } from "@/utils/treeReducer"; import { useAtom } from "jotai"; import { currentPgnOptionsAtom } from "@/atoms/atoms"; +import { IconCheck, IconCopy } from "@tabler/icons-react"; function PgnInput({ root, headers }: { root: TreeNode; headers: GameHeaders }) { - const [options, setOptions] = useAtom(currentPgnOptionsAtom) + const [options, setOptions] = useAtom(currentPgnOptionsAtom); const pgn = getPGN(root, { headers: headers, @@ -25,25 +37,33 @@ function PgnInput({ root, headers }: { root: TreeNode; headers: GameHeaders }) { label="Comments" size="xs" checked={options.comments} - onChange={() => setOptions({ ...options, comments: !options.comments })} + onChange={() => + setOptions({ ...options, comments: !options.comments }) + } /> setOptions({ ...options, annotations: !options.annotations })} + onChange={() => + setOptions({ ...options, annotations: !options.annotations }) + } /> setOptions({ ...options, variations: !options.variations })} + onChange={() => + setOptions({ ...options, variations: !options.variations }) + } /> setOptions({ ...options, symbols: !options.symbols })} + onChange={() => + setOptions({ ...options, symbols: !options.symbols }) + } /> @@ -52,7 +72,33 @@ function PgnInput({ root, headers }: { root: TreeNode; headers: GameHeaders }) { ); const pgnArea = useMemo( - () =>