import type { Metadata } from "next"; import Link from "next/link"; import { notFound } from "next/navigation"; import { Container } from "@/components/Container"; import { PageHero } from "@/components/layout/PageHero"; import { blogPosts, getBlogPost } from "@/lib/data"; export function generateStaticParams() { return blogPosts.map((post) => ({ slug: post.slug })); } export async function generateMetadata({ params, }: { params: Promise<{ slug: string }>; }): Promise { const { slug } = await params; const post = getBlogPost(slug); if (!post) return { title: "مقاله" }; return { title: post.title, description: post.excerpt }; } export default async function BlogPostPage({ params, }: { params: Promise<{ slug: string }>; }) { const { slug } = await params; const post = getBlogPost(slug); if (!post) notFound(); return ( <>

{post.date}

{post.body.map((paragraph) => (

{paragraph}

))}
بازگشت به مقالات
); }