import type { Metadata } from "next"; import { notFound } from "next/navigation"; import { PageHeader } from "@/components/PageHeader"; import { Section } from "@/components/Section"; import { ImagePlaceholder } from "@/components/ImagePlaceholder"; import { RichText } from "@/components/RichText"; import { getPostBySlug } from "@/lib/payload/content"; import { mediaAlt, mediaUrl } from "@/lib/payload/media"; export const dynamic = "force-dynamic"; type Args = { params: Promise<{ slug: string }> }; export async function generateMetadata({ params }: Args): Promise { const { slug } = await params; const post = await getPostBySlug(slug); if (!post) return {}; return { title: post.title, description: post.teaser }; } export default async function PostDetailPage({ params }: Args) { const { slug } = await params; const post = await getPostBySlug(slug); if (!post) notFound(); const publishDate = new Date(post.publishDate ?? post.createdAt).toLocaleDateString("de-DE", { day: "2-digit", month: "long", year: "numeric", }); return ( <>
); }