From dff8524d3d212f09465eb8b2d00f706cdafbafac Mon Sep 17 00:00:00 2001 From: diegosouzapw Date: Wed, 27 May 2026 22:10:01 -0300 Subject: [PATCH] refactor(agent-skills): rewrite dashboard page as server wrapper + client --- .../dashboard/agent-skills/page.tsx | 173 +----------------- 1 file changed, 3 insertions(+), 170 deletions(-) diff --git a/src/app/(dashboard)/dashboard/agent-skills/page.tsx b/src/app/(dashboard)/dashboard/agent-skills/page.tsx index af5de938a3..5dc69cd1e0 100644 --- a/src/app/(dashboard)/dashboard/agent-skills/page.tsx +++ b/src/app/(dashboard)/dashboard/agent-skills/page.tsx @@ -1,172 +1,5 @@ -"use client"; +import { AgentSkillsPageClient } from "./AgentSkillsPageClient"; -import { useTranslations } from "next-intl"; -import { - AGENT_SKILLS, - AGENT_SKILLS_REPO_URL, - getAgentSkillRawUrl, - getAgentSkillBlobUrl, - type AgentSkill, -} from "@/shared/constants/agentSkills"; -import { useCopyToClipboard } from "@/shared/hooks/useCopyToClipboard"; - -function CopyButton({ url }: { url: string }) { - const t = useTranslations("agents"); - const { copied, copy } = useCopyToClipboard(); - const isCopied = copied === url; - - return ( - - ); -} - -function SkillRow({ skill }: { skill: AgentSkill }) { - const t = useTranslations("agents"); - const rawUrl = getAgentSkillRawUrl(skill.id); - const blobUrl = getAgentSkillBlobUrl(skill.id); - - return ( -
-
- {skill.icon} -
- -
-
- {skill.name} - {skill.isEntry && ( - - {t("startHere")} - - )} - {skill.isNew && ( - - {t("badgeNew")} - - )} - {skill.endpoint && ( - - {skill.endpoint} - - )} -
-

{skill.description}

-
- -
- - open_in_new - - -
-
- ); -} - -function SkillSection({ - title, - subtitle, - icon, - skills, -}: { - title: string; - subtitle: string; - icon: string; - skills: AgentSkill[]; -}) { - return ( -
-
- {icon} -
-

{title}

-

{subtitle}

-
-
-
- {skills.map((skill) => ( - - ))} -
-
- ); -} - -export default function AgentSkillsPage() { - const t = useTranslations("agents"); - const apiSkills = AGENT_SKILLS.filter((s) => s.category === "api"); - const cliSkills = AGENT_SKILLS.filter((s) => s.category === "cli"); - - return ( -
- {/* How to use — full width */} -
-
- info - {t("howToUse")} -
-
    -
  1. - 1.{" "} - {t.rich("howToUseStep1", { - copyUrl: t("copyUrl"), - bold: (chunks) => {chunks}, - })} -
  2. -
  3. - 2. {t("howToUseStep2")} -
    - - {t("howToUseStep2Code")} - -
  4. -
  5. 3. {t("howToUseStep3")}
  6. -
- - open_in_new - {t("browseAllSkillsOnGithub")} - -
- - {/* Two-column grid: API Skills | CLI Skills */} -
- - -
-
- ); +export default function Page() { + return ; }