+4
-20
apps/skillulator/src/routes/c/$class/route.tsx
+4
-20
apps/skillulator/src/routes/c/$class/route.tsx
···
1
-
import { createFileRoute } from "@tanstack/react-router";
2
-
import { Link, useParams } from "@tanstack/react-router";
1
+
import { Link, useParams, createFileRoute } from "@tanstack/react-router";
3
2
import clsx from "clsx";
4
3
import { t } from "i18next";
5
4
import { Suspense } from "react";
6
5
import Skill from "./components/Skill";
7
6
import { useSkillTree } from "@/hooks/useSkillTree";
7
+
import { CopyButton, ResetButton } from "./components/action-buttons";
8
8
9
9
export const Route = createFileRoute("/c/$class")({
10
10
component: SkillTree,
···
62
62
/>
63
63
</div>
64
64
</div>
65
-
<button
66
-
type="button"
67
-
disabled={copied}
68
-
onClick={copyToClipboard}
69
-
className={clsx(
70
-
"h-min w-full self-end rounded-md bg-indigo-500 px-4 py-1.5 font-semibold text-white duration-150 hover:bg-indigo-600 md:w-max a11y-focus",
71
-
copied ? "disabled:bg-green-500" : undefined,
72
-
)}
73
-
>
74
-
{copied ? t("copiedText") : t("copyText")}
75
-
</button>
76
-
<button
77
-
type="button"
78
-
className="h-min w-full self-end rounded-md border border-red-300 bg-red-100 px-4 py-1.5 text-red-900 duration-150 hover:bg-red-200 md:w-max a11y-focus"
79
-
onClick={handleReset}
80
-
>
81
-
{t("resetText")}
82
-
</button>
65
+
<CopyButton copied={copied} copyToClipboard={copyToClipboard} />
66
+
<ResetButton handleReset={handleReset} />
83
67
</div>
84
68
</div>
85
69
<div