import Link from "next/link"; import { getOpenAPIOperations } from "@/lib/openapi-operations"; const methodColors: Record = { GET: "bg-emerald-100 text-emerald-700", POST: "bg-blue-100 text-blue-700", PUT: "bg-amber-100 text-amber-700", PATCH: "bg-purple-100 text-purple-700", DELETE: "bg-rose-100 text-rose-700", }; function MethodBadge({ method }: { method: string }) { const color = methodColors[method] ?? "bg-slate-100 text-slate-700"; return ( {method} ); } export function APIOverviewTable() { const operations = getOpenAPIOperations(); if (operations.length === 0) { return null; } return (
{operations.map((operation) => ( ))}
路径 方法 摘要
{operation.route} {operation.summary || "—"}
); }