import Link from "next/link"; import { notFound } from "next/navigation"; import { getRefs } from "@/lib/api"; import { dec } from "@/lib/params"; import { timeAgo } from "@/lib/format"; type Props = { params: Promise<{ repo: string }> }; function RefList({ repo, kind, refs, }: { repo: string; kind: "branch" | "tag"; refs: { name: string; short: string; when: string; subject: string }[]; }) { return (

{kind === "branch" ? "branches" : "tags"}

{refs.length === 0 ? (

none

) : (
{refs.map((r) => (
{kind === "branch" ? ( {r.name} ) : ( {r.name} )} {r.subject} {timeAgo(r.when)}
))}
)}
); } export default async function RefsPage({ params }: Props) { const repo = dec((await params).repo); const refs = await getRefs(repo); if (!refs) notFound(); return (
); }