import { env } from "../../lib/env"; import { Suspense } from "react"; import { notFound } from "next/navigation"; import { GitForkIcon, StarIcon } from "lucide-react"; import Calendar from "./calendar"; import PageTitle from "../../components/PageTitle"; import Link from "../../components/Link"; import RelativeTime from "../../components/RelativeTime"; import cn from "../../lib/helpers/classnames"; import { createMetadata } from "../../lib/helpers/metadata"; import { getContributions, getRepos } from "./github"; export const metadata = createMetadata({ title: "Projects", description: `Most-starred repositories by @${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 (!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

Failed to generate activity calendar.

}>

Popular repositories

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

{repo!.description}

}
{repo!.primaryLanguage && (
{repo!.primaryLanguage.color && ( )} {repo!.primaryLanguage.name}
)} {repo!.stargazerCount > 0 && (
{Intl.NumberFormat(env.NEXT_PUBLIC_SITE_LOCALE).format(repo!.stargazerCount)}
)} {repo!.forkCount > 0 && (
{Intl.NumberFormat(env.NEXT_PUBLIC_SITE_LOCALE).format(repo!.forkCount)}
)}
Updated
))}

View more on{" "} {" "} GitHub.

); }; export default Page;