import { IconExternalLink, IconGitFork, IconStar } from "@tabler/icons-react"; import { notFound } from "next/navigation"; import { Suspense } from "react"; import { ActivityCalendar } from "@/components/activity-calendar"; import { PageTitle } from "@/components/layout/page-title"; import { FadeTransition } from "@/components/page-transition"; import { RelativeTime } from "@/components/relative-time"; import { Button } from "@/components/ui/button"; import { Skeleton } from "@/components/ui/skeleton"; import { createMetadata } from "@/lib/metadata"; import { cn } from "@/lib/utils"; import { getContributions, getRepos } from "./github"; export const metadata = createMetadata({ title: "Projects", description: `Most-starred repositories by @${process.env.NEXT_PUBLIC_GITHUB_USERNAME} on GitHub`, canonical: "/projects", }); const Page = async () => { // don't fail the entire site build if the required config for this page is missing, just return a 404 since this page // would be mostly blank anyways. if (!process.env.GITHUB_TOKEN) { console.error("[/projects] I can't fetch anything from GitHub without 'GITHUB_TOKEN' set!"); notFound(); } // fetch the repos and contributions in parallel const [contributions, repos] = await Promise.all([getContributions(), getRepos()]); return ( Projects

Contribution activity

}> {contributions.length > 0 ? (
) : (

Unable to load contribution data at this time.

)}

Popular repositories

{repos && repos.length > 0 ? (
{repos.map((repo) => (
{repo?.name} {repo?.description && (

{repo?.description}

)}
{repo?.primaryLanguage && (
{repo?.primaryLanguage.color && ( )} {repo?.primaryLanguage.name}
)} {repo?.stargazerCount > 0 && ( )} {repo?.forkCount > 0 && ( )}
Updated
))}
) : (

Unable to load repository data at this time.

)}