{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "github-stars",
  "title": "GitHub Stars",
  "description": "Displays the star count of a repository.",
  "dependencies": [
    "lucide-react"
  ],
  "registryDependencies": [
    "button",
    "skeleton"
  ],
  "files": [
    {
      "path": "registry/github-stats/github-stars.tsx",
      "content": "import * as React from \"react\";\n\nimport { Button } from \"@/components/ui/button\";\nimport { Skeleton } from \"@/components/ui/skeleton\";\nimport { StarIcon } from \"lucide-react\";\n\nexport function GithubStars({ repo }: { repo: string }) {\n  return (\n    <Button\n      nativeButton={false}\n      size=\"sm\"\n      variant=\"ghost\"\n      className=\"h-8 shadow-none group\"\n      render={\n        <a\n          href={`https://github.com/${repo}`}\n          target=\"_blank\"\n          rel=\"noreferrer\"\n        />\n      }\n    >\n      <StarIcon className=\"fill-transparent group-hover:fill-foreground group-hover:scale-110 transition-[fill,scale] duration-200 ease-out\" />\n      <React.Suspense fallback={<Skeleton className=\"h-4 w-9\" />}>\n        <StarsCount repo={repo} />\n      </React.Suspense>\n    </Button>\n  );\n}\n\nexport async function StarsCount({ repo }: { repo: string }) {\n  const data = await fetch(`https://api.github.com/repos/${repo}`, {\n    next: { revalidate: 86400 }, // Cache for 1 day (86400 seconds)\n  });\n  const json: { stargazers_count: number } = await data.json();\n\n  return (\n    <p className=\"text-xs text-muted-foreground/70 group-hover:text-muted-foreground transition-colors duration-200 ease-out\">\n      <span className=\"tabular-nums\">\n        {json.stargazers_count >= 1000\n          ? `${(json.stargazers_count / 1000).toFixed(1)}k`\n          : json.stargazers_count.toLocaleString()}\n      </span>{\" \"}\n      stars\n    </p>\n  );\n}\n",
      "type": "registry:component"
    }
  ],
  "type": "registry:block"
}