import { notFound } from "next/navigation"; import { getRepo, getTree, getReadme, cloneUrl } from "@/lib/api"; import { dec } from "@/lib/params"; import { timeAgo } from "@/lib/format"; import TreeTable from "@/components/TreeTable"; import Markdown from "@/components/Markdown"; export default async function RepoOverview({ params }: { params: Promise<{ repo: string }> }) { const name = dec((await params).repo); const repo = await getRepo(name); if (!repo) notFound(); if (repo.empty) { return (

❄ an empty vessel

The owner hasn't pushed anything yet:

          {`git remote add frieren ${cloneUrl(repo.name)}\ngit push frieren ${repo.default}`}
        
); } const [entries, readme] = await Promise.all([ getTree(name, repo.default, ""), getReadme(name, repo.default), ]); return (

{repo.default} · last commit{" "} {timeAgo(repo.lastCommit)}

{readme && (

{readme.name}

)}
); }