import type { Metadata } from "next"; import Link from "next/link"; import { notFound } from "next/navigation"; import { Container } from "@/components/atoms/Container"; import { Section } from "@/components/atoms/Section"; import { TextLink } from "@/components/atoms/TextLink"; import { PageHero } from "@/components/molecules/PageHero"; import { buttonVariants } from "@/components/ui/button"; import { Separator } from "@/components/ui/separator"; import { cn } from "@/lib/utils"; import { getTopicBySlug } from "@/lib/data/site"; type Props = { params: Promise<{ slug: string }> }; export async function generateMetadata({ params }: Props): Promise { const { slug } = await params; const topic = await getTopicBySlug(slug); if (!topic) return { title: "موضوع یافت نشد" }; return { title: topic.title, description: topic.description }; } export default async function TopicPage({ params }: Props) { const { slug } = await params; const topic = await getTopicBySlug(slug); if (!topic) notFound(); return (

{topic.body}

    {topic.highlights.map((h) => (
  • {h}
  • ))}
); }