diff --git a/src/app/(dashboard)/dashboard/agent-skills/page.tsx b/src/app/(dashboard)/dashboard/agent-skills/page.tsx index 4bfa047175..37b74023a2 100644 --- a/src/app/(dashboard)/dashboard/agent-skills/page.tsx +++ b/src/app/(dashboard)/dashboard/agent-skills/page.tsx @@ -1,6 +1,5 @@ "use client"; -import { useState } from "react"; import { AGENT_SKILLS, AGENT_SKILLS_REPO_URL, @@ -8,30 +7,28 @@ import { getAgentSkillBlobUrl, type AgentSkill, } from "@/shared/constants/agentSkills"; +import { useCopyToClipboard } from "@/shared/hooks/useCopyToClipboard"; function CopyButton({ url }: { url: string }) { - const [copied, setCopied] = useState(false); - - const handleCopy = async () => { - await navigator.clipboard.writeText(url); - setCopied(true); - setTimeout(() => setCopied(false), 2000); - }; + const { copied, copy } = useCopyToClipboard(); + const isCopied = copied === url; return ( ); }