import type { Metadata } from "next"; import Image from "next/image"; import { notFound } from "next/navigation"; import { getBlogById } from "@/lib/meshkee/api"; import { formatDate } from "@/lib/meshkee/format"; type PageProps = { params: Promise<{ id: string; slug: string }>; }; export async function generateMetadata({ params }: PageProps): Promise { const { id } = await params; try { const post = await getBlogById(id); return { title: `${post.title} | مبلمان هومت`, description: post.abstract || post.title, }; } catch { return { title: "مقاله | مبلمان هومت" }; } } export default async function BlogDetailPage({ params }: PageProps) { const { id } = await params; let post; try { post = await getBlogById(id); } catch { notFound(); } return (

{post.categoryName || "Article"}

{post.title}

{post.titleImageUrl ? (
{post.title}
) : null} {post.abstract ?

{post.abstract}

: null} {post.mainTextHtml ? (
) : (

متن مقاله در دسترس نیست.

)}
); }