Matches the width already used on the run and new-run cards. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
42 lines
1.1 KiB
TypeScript
42 lines
1.1 KiB
TypeScript
export const dynamic = "force-dynamic";
|
|
|
|
import type { Metadata } from "next";
|
|
import Link from "next/link";
|
|
import { notFound } from "next/navigation";
|
|
import { ArrowLeft } from "lucide-react";
|
|
import { getDocMeta, readDocContent } from "@/lib/docs";
|
|
import { MarkdownViewer } from "@/components/docs/markdown-viewer";
|
|
|
|
interface DocPageProps {
|
|
params: Promise<{ slug: string }>;
|
|
}
|
|
|
|
export async function generateMetadata({
|
|
params,
|
|
}: DocPageProps): Promise<Metadata> {
|
|
const { slug } = await params;
|
|
return { title: getDocMeta(slug)?.title ?? "Doc not found" };
|
|
}
|
|
|
|
export default async function DocPage({ params }: DocPageProps) {
|
|
const { slug } = await params;
|
|
const doc = getDocMeta(slug);
|
|
if (!doc) notFound();
|
|
|
|
const content = readDocContent(doc);
|
|
if (content === null) notFound();
|
|
|
|
return (
|
|
<div className="mx-auto flex max-w-5xl flex-col gap-6">
|
|
<Link
|
|
href="/docs"
|
|
className="text-muted-foreground hover:text-foreground flex w-fit items-center gap-1 text-sm"
|
|
>
|
|
<ArrowLeft className="size-3.5" />
|
|
All docs
|
|
</Link>
|
|
<MarkdownViewer content={content} />
|
|
</div>
|
|
);
|
|
}
|