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 (
<>
{repo!.description}
}View more on{" "} {" "} GitHub.
> ); }; export default Page;