import type { Metadata } from 'next'; import Link from 'next/link'; import { notFound } from 'next/navigation'; import { Section } from '@/components/Section'; import { contentPages, getContentPage, site } from '@/lib/site'; type ContentPageProps = { params: Promise<{ slug: string; }>; }; export function generateStaticParams() { return contentPages.map((page) => ({ slug: page.slug })); } export async function generateMetadata({ params }: { params: Promise<{ slug: string }> }): Promise { const { slug } = await params; const page = getContentPage(slug); if (!page) { return { title: site.name, description: site.description, }; } return { title: page.seoTitle, description: page.seoDescription, }; } export default async function ContentPage({ params }: ContentPageProps) { const { slug } = await params; const page = getContentPage(slug); if (!page) { notFound(); } return ( <>

Content page

{page.title}

{page.intro}

{page.sections.map((section) => (

{section.title}

{section.paragraphs.map((paragraph) => (

{paragraph}

))} {section.bullets ? (
    {section.bullets.map((bullet) => (
  • {bullet}
  • ))}
) : null}
))}
); }