import { notFound } from "next/navigation"; import { getCommit } from "@/lib/api"; import { dec } from "@/lib/params"; import { fullDate, timeAgo } from "@/lib/format"; import Diff from "@/components/Diff"; type Props = { params: Promise<{ repo: string; hash: string }> }; export default async function CommitPage({ params }: Props) { const p = await params; const repo = dec(p.repo); const commit = await getCommit(repo, dec(p.hash)); if (!commit) notFound(); return (

{commit.subject}

{commit.hash}

{commit.author} · {fullDate(commit.when)} ({timeAgo(commit.when)})

{commit.truncated && (

diff truncated — see the full change locally with{" "} git show {commit.short}

)}
); }