{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "template-link-hub",
  "title": "Link hub workspace",
  "description": "A creator or team profile with grouped destinations, filtering, external-link semantics and contact copy recovery.",
  "registryDependencies": [
    "@neumorphism-ui/button",
    "@neumorphism-ui/utils"
  ],
  "files": [
    {
      "path": "src/components/blocks/link-hub.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nimport { Button } from \"@/components/ui/button\";\nimport { cn } from \"@/lib/utils\";\n\nexport type LinkHubLocale = \"ko\" | \"en\" | \"ja\" | \"zh\";\n\nexport type LinkHubProfile = {\n  name: string;\n  handle?: string;\n  bio?: string;\n  initials?: string;\n};\n\nexport type LinkHubLink = {\n  group: string;\n  title: string;\n  detail?: string;\n  href: string;\n  external?: boolean;\n  highlighted?: boolean;\n};\n\nexport interface LinkHubProps {\n  profile: LinkHubProfile;\n  links: readonly LinkHubLink[];\n  contactEmail?: string;\n  locale?: LinkHubLocale;\n  className?: string;\n}\n\nconst copy = {\n  ko: {\n    all: \"전체\",\n    filter: \"링크 필터\",\n    destinations: \"링크\",\n    links: \"개 링크\",\n    link: \"개 링크\",\n    contact: \"연락하기\",\n    copy: \"이메일 복사\",\n    copied: \"이메일 주소를 복사했습니다.\",\n    copyFailed: \"복사하지 못했습니다. 위 이메일 주소를 직접 복사하세요.\",\n    newTab: \"새 탭에서 열림\",\n  },\n  en: {\n    all: \"All\",\n    filter: \"Filter links\",\n    destinations: \"Links\",\n    links: \"links\",\n    link: \"link\",\n    contact: \"Contact\",\n    copy: \"Copy email\",\n    copied: \"Email copied.\",\n    copyFailed: \"Could not copy. Select the email address above and copy it manually.\",\n    newTab: \"Opens in a new tab\",\n  },\n  ja: {\n    all: \"すべて\",\n    filter: \"リンクを絞り込む\",\n    destinations: \"リンク\",\n    links: \"件のリンク\",\n    link: \"件のリンク\",\n    contact: \"連絡先\",\n    copy: \"メールをコピー\",\n    copied: \"メールアドレスをコピーしました。\",\n    copyFailed: \"コピーできませんでした。上のメールアドレスを手動でコピーしてください。\",\n    newTab: \"新しいタブで開きます\",\n  },\n  zh: {\n    all: \"全部\",\n    filter: \"筛选链接\",\n    destinations: \"链接\",\n    links: \"个链接\",\n    link: \"个链接\",\n    contact: \"联系\",\n    copy: \"复制邮箱\",\n    copied: \"邮箱地址已复制。\",\n    copyFailed: \"复制失败，请手动复制上方邮箱地址。\",\n    newTab: \"在新标签页打开\",\n  },\n} as const;\n\nfunction LinkHub({\n  profile,\n  links,\n  contactEmail,\n  locale = \"en\",\n  className,\n}: LinkHubProps) {\n  const t = copy[locale];\n  const groups = React.useMemo(\n    () => Array.from(new Set(links.map((link) => link.group))),\n    [links],\n  );\n  const [group, setGroup] = React.useState<string | null>(null);\n  const [copyState, setCopyState] = React.useState(\"\");\n\n  React.useEffect(() => {\n    if (group !== null && !groups.includes(group)) setGroup(null);\n  }, [group, groups]);\n\n  const filteredLinks = links.filter(\n    (link) => group === null || link.group === group,\n  );\n\n  async function copyEmail() {\n    if (!contactEmail) return;\n    try {\n      await navigator.clipboard.writeText(contactEmail);\n      setCopyState(t.copied);\n    } catch {\n      setCopyState(t.copyFailed);\n    }\n  }\n\n  return (\n    <section\n      data-slot=\"link-hub\"\n      className={cn(\n        \"mx-auto grid min-w-0 w-full max-w-2xl gap-7 text-[var(--foreground)] [overflow-wrap:anywhere]\",\n        locale === \"ko\" && \"break-keep\",\n        className,\n      )}\n    >\n      <header className=\"grid justify-items-center gap-3 text-center\">\n        <div\n          aria-hidden=\"true\"\n          className=\"grid size-24 place-items-center rounded-full border border-[color:var(--neu-edge)] bg-[var(--neu-surface)] text-xl font-semibold [box-shadow:var(--neu-shadow-raised)]\"\n        >\n          {profile.initials ?? profile.name.slice(0, 2).toUpperCase()}\n        </div>\n        <div className=\"grid min-w-0 max-w-full gap-1\">\n          <h2 className=\"text-2xl font-semibold tracking-tight sm:text-3xl\">\n            {profile.name}\n          </h2>\n          {profile.handle ? (\n            <p className=\"text-sm text-[var(--muted-foreground)]\">{profile.handle}</p>\n          ) : null}\n        </div>\n        {profile.bio ? (\n          <p className=\"max-w-md text-sm leading-relaxed text-[var(--muted-foreground)] sm:text-base\">\n            {profile.bio}\n          </p>\n        ) : null}\n      </header>\n\n      <section className=\"grid min-w-0 gap-3\">\n        <h3 className=\"text-sm font-semibold\">\n          {t.destinations}\n        </h3>\n        <div role=\"group\" aria-label={t.filter} className=\"flex flex-wrap gap-2\">\n          <Button\n            type=\"button\"\n            size=\"sm\"\n            variant={group === null ? \"primary\" : \"ghost\"}\n            aria-pressed={group === null}\n            onClick={() => setGroup(null)}\n          >\n            {t.all}\n          </Button>\n          {groups.map((item) => (\n            <Button\n              key={item}\n              type=\"button\"\n              size=\"sm\"\n              variant={group === item ? \"primary\" : \"ghost\"}\n              aria-pressed={group === item}\n              onClick={() => setGroup(item)}\n            >\n              {item}\n            </Button>\n          ))}\n        </div>\n        <p role=\"status\" className=\"text-xs text-[var(--muted-foreground)]\">\n          {filteredLinks.length} {filteredLinks.length === 1 ? t.link : t.links}\n        </p>\n      </section>\n\n      <ul className=\"grid gap-3 sm:grid-cols-2\">\n        {filteredLinks.map((link) => (\n          <li key={`${link.group}:${link.title}`} className=\"min-w-0\">\n            <a\n              href={link.href}\n              target={link.external ? \"_blank\" : undefined}\n              rel={link.external ? \"noreferrer\" : undefined}\n              data-highlighted={link.highlighted}\n              className={cn(\n                \"flex min-h-20 h-full min-w-0 w-full items-center gap-3 rounded-[var(--neu-radius-surface)] border border-[color:var(--neu-edge)] bg-[var(--neu-surface)] p-4 text-left text-[var(--foreground)] no-underline [box-shadow:var(--neu-shadow-raised-sm)] outline-none transition-[box-shadow,transform] duration-[var(--neu-duration)] motion-reduce:transition-none hover:[box-shadow:var(--neu-shadow-hover)] focus-visible:ring-2 focus-visible:ring-[var(--ring)] active:translate-y-px active:[box-shadow:var(--neu-shadow-inset)] data-[highlighted=true]:border-transparent data-[highlighted=true]:bg-[var(--neu-surface)] data-[highlighted=true]:text-[var(--neu-accent-ink)] data-[highlighted=true]:[box-shadow:var(--neu-shadow-raised-sm)]\",\n              )}\n            >\n              <span className=\"min-w-0 flex-1\">\n                <span className=\"block font-semibold\">{link.title}</span>\n                {link.detail ? (\n                  <span className=\"mt-1 block text-xs leading-5 opacity-70\">\n                    {link.detail}\n                  </span>\n                ) : null}\n                {link.external ? <span className=\"sr-only\">{t.newTab}</span> : null}\n              </span>\n              <svg aria-hidden=\"true\" className=\"size-4 shrink-0 opacity-60\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\"><path d={link.external ? \"M6 18 18 6M8 6h10v10\" : \"M4 12h16m-6-6 6 6-6 6\"} /></svg>\n            </a>\n          </li>\n        ))}\n      </ul>\n\n      {contactEmail ? (\n        <section\n          aria-label={t.contact}\n          className=\"grid gap-3 border-t border-[var(--border)] pt-5\"\n        >\n          <h3 className=\"text-lg font-semibold\">{t.contact}</h3>\n          <p className=\"break-all text-sm text-[var(--muted-foreground)]\">\n            {contactEmail}\n          </p>\n          <Button className=\"w-fit\" size=\"sm\" onClick={() => void copyEmail()}>\n            {t.copy}\n          </Button>\n          <p role=\"status\" className=\"min-h-5 text-xs text-[var(--muted-foreground)]\">\n            {copyState}\n          </p>\n        </section>\n      ) : null}\n    </section>\n  );\n}\n\nconst exampleCopy = {\n  en: { guides: \"Guides\", code: \"Code\", contact: \"Contact\", docs: \"Documentation\", components: \"Components\", issues: \"Report an issue\", email: \"Email\", bio: \"Documentation, component examples and source code.\", note: \"The email address is an example and is not monitored.\" },\n  ko: { guides: \"문서\", code: \"코드\", contact: \"연락\", docs: \"시작하기\", components: \"컴포넌트\", issues: \"문제 신고\", email: \"이메일\", bio: \"사용 문서, 컴포넌트 예제와 소스 코드를 모았습니다.\", note: \"이메일은 예제 주소이며 문의를 받지 않습니다.\" },\n  ja: { guides: \"ガイド\", code: \"コード\", contact: \"連絡先\", docs: \"ドキュメント\", components: \"コンポーネント\", issues: \"問題を報告\", email: \"メール\", bio: \"ドキュメント、コンポーネントの使用例、ソースコード。\", note: \"メールアドレスはサンプルです。お問い合わせは受け付けていません。\" },\n  zh: { guides: \"指南\", code: \"代码\", contact: \"联系\", docs: \"使用文档\", components: \"组件\", issues: \"报告问题\", email: \"邮箱\", bio: \"使用文档、组件示例和源代码。\", note: \"邮箱地址仅供演示，不接收咨询。\" },\n} as const;\n\nexport function LinkHubExample({ locale = \"en\" }: { locale?: LinkHubLocale }) {\n  const t = exampleCopy[locale];\n  const homepage = \"https://neumorphism-ui.andongmin.com\";\n  const repository = \"https://github.com/andongmin94/neumorphism-ui\";\n  const links: LinkHubLink[] = [\n    { group: t.guides, title: t.docs, detail: `${homepage}/${locale}/docs`, href: `${homepage}/${locale}/docs`, external: true, highlighted: true },\n    { group: t.guides, title: t.components, detail: `${homepage}/${locale}/components`, href: `${homepage}/${locale}/components`, external: true },\n    { group: t.code, title: \"GitHub\", detail: repository, href: repository, external: true },\n    { group: t.code, title: t.issues, detail: `${repository}/issues`, href: `${repository}/issues`, external: true },\n    { group: t.contact, title: t.email, detail: \"hello@example.com\", href: \"mailto:hello@example.com\" },\n  ];\n  return (\n    <div className=\"grid min-w-0 gap-5\">\n      <LinkHub\n        locale={locale}\n        profile={{ name: \"Neumorphism UI\", bio: t.bio, initials: \"N\" }}\n        links={links}\n        contactEmail=\"hello@example.com\"\n      />\n      <p className=\"mx-auto w-full max-w-2xl text-xs leading-relaxed text-[var(--muted-foreground)]\">{t.note}</p>\n    </div>\n  );\n}\n\nexport { LinkHub };\n",
      "type": "registry:component",
      "target": "@components/blocks/link-hub.tsx"
    }
  ],
  "categories": [
    "template"
  ],
  "type": "registry:block"
}