From 58c2cfccd9b59ff0902ab32debe38d567fc7df7d Mon Sep 17 00:00:00 2001 From: diegosouzapw Date: Fri, 15 May 2026 12:23:51 -0300 Subject: [PATCH] fix(skills): use useCopyToClipboard hook in AgentSkills for HTTP fallback --- .../dashboard/agent-skills/page.tsx | 23 ++++++++----------- 1 file changed, 10 insertions(+), 13 deletions(-) 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 ( ); }