github-link.tsx — ui Source File
Architecture documentation for github-link.tsx, a tsx file in the ui codebase. 6 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR 6c5b7866_6251_4799_d639_c6925eb7996d["github-link.tsx"] 1d141819_425e_b5fd_4c8e_32f7c6a42cf2["react"] 6c5b7866_6251_4799_d639_c6925eb7996d --> 1d141819_425e_b5fd_4c8e_32f7c6a42cf2 ba3d44f3_7b34_f9cc_6283_44817785c0df["link"] 6c5b7866_6251_4799_d639_c6925eb7996d --> ba3d44f3_7b34_f9cc_6283_44817785c0df 8964a549_2e67_58d7_11c7_c9265d5c7971["config"] 6c5b7866_6251_4799_d639_c6925eb7996d --> 8964a549_2e67_58d7_11c7_c9265d5c7971 aae3c3f1_230a_9c11_a663_8bbc3f0ad054["icons"] 6c5b7866_6251_4799_d639_c6925eb7996d --> aae3c3f1_230a_9c11_a663_8bbc3f0ad054 57e86e45_ac6e_7278_be08_9092724e8401["button"] 6c5b7866_6251_4799_d639_c6925eb7996d --> 57e86e45_ac6e_7278_be08_9092724e8401 334339cf_a0db_b417_9d88_14840f1e3173["skeleton"] 6c5b7866_6251_4799_d639_c6925eb7996d --> 334339cf_a0db_b417_9d88_14840f1e3173 style 6c5b7866_6251_4799_d639_c6925eb7996d fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import * as React from "react"
import Link from "next/link"
import { siteConfig } from "@/lib/config"
import { Icons } from "@/components/icons"
import { Button } from "@/registry/new-york-v4/ui/button"
import { Skeleton } from "@/registry/new-york-v4/ui/skeleton"
export function GitHubLink() {
return (
<Button asChild size="sm" variant="ghost" className="h-8 shadow-none">
<Link href={siteConfig.links.github} target="_blank" rel="noreferrer">
<Icons.gitHub />
<React.Suspense fallback={<Skeleton className="h-4 w-[42px]" />}>
<StarsCount />
</React.Suspense>
</Link>
</Button>
)
}
export async function StarsCount() {
const data = await fetch("https://api.github.com/repos/shadcn-ui/ui", {
next: { revalidate: 86400 },
})
const json = await data.json()
const formattedCount =
json.stargazers_count >= 1000
? `${Math.round(json.stargazers_count / 1000)}k`
: json.stargazers_count.toLocaleString()
return (
<span className="text-muted-foreground w-fit text-xs tabular-nums">
{formattedCount}
</span>
)
}
Domain
Subdomains
Functions
Dependencies
- button
- config
- icons
- link
- react
- skeleton
Source
Frequently Asked Questions
What does github-link.tsx do?
github-link.tsx is a source file in the ui codebase, written in tsx. It belongs to the Internationalization domain, Dictionary subdomain.
What functions are defined in github-link.tsx?
github-link.tsx defines 2 function(s): GitHubLink, StarsCount.
What does github-link.tsx depend on?
github-link.tsx imports 6 module(s): button, config, icons, link, react, skeleton.
Where is github-link.tsx in the architecture?
github-link.tsx is located at apps/v4/components/github-link.tsx (domain: Internationalization, subdomain: Dictionary, directory: apps/v4/components).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free