import type { Metadata } from 'next' import { notFound } from 'next/navigation' import { getManualChapter, getManualToc } from '@/lib/manual-server' import { MarkdownView } from '../_components/markdown-view' type Params = { slug?: string[] } export async function generateStaticParams(): Promise { return getManualToc().map((entry) => ({ slug: entry.slug.length > 0 ? [...entry.slug] : undefined, })) } export async function generateMetadata({ params, }: { params: Promise }): Promise { const { slug = [] } = await params const chapter = getManualChapter(slug) if (!chapter) return { title: 'Manual — not found' } return { title: `${chapter.entry.title} — Scrum4Me Manual`, description: chapter.entry.description.slice(0, 200), } } export default async function ManualChapterPage({ params, }: { params: Promise }) { const { slug = [] } = await params const chapter = getManualChapter(slug) if (!chapter) notFound() return (
) }