import Link from 'next/link' import { notFound } from 'next/navigation' import { DOC_CATEGORIES, findPage, flatPages } from '@/lib/docs/nav' import { loadDocContent } from '@/lib/docs/load' import { DocsMarkdown } from '@/components/docs/docs-markdown' import { DocsSidebar } from '@/components/docs/docs-sidebar' export function generateStaticParams() { return DOC_CATEGORIES.flatMap(cat => cat.pages.map(page => ({ category: cat.id, slug: page.slug })), ) } export const dynamicParams = false type Params = { category: string; slug: string } export async function generateMetadata({ params }: { params: Promise }) { const { category, slug } = await params const found = findPage(category, slug) if (!found) return {} return { title: found.page.title, description: found.page.summary } } export default async function DocPage({ params }: { params: Promise }) { const { category, slug } = await params const found = findPage(category, slug) if (!found) notFound() const { category: cat, page } = found const content = await loadDocContent(cat.id, page.slug) const flat = flatPages() const idx = flat.findIndex(p => p.categoryId === cat.id && p.slug === page.slug) const prev = idx > 0 ? flat[idx - 1] : null const next = idx >= 0 && idx < flat.length - 1 ? flat[idx + 1] : null return (

{cat.label}

{page.title}

{page.summary}


{content ? ( ) : (

This page is being written. Check back shortly.

)}
) }