import type { Metadata } from "next"; import Link from "next/link"; import { notFound } from "next/navigation"; import { Container } from "@/components/Container"; import { Placeholder } from "@/components/Placeholder"; import { ProductTabs } from "@/components/product/ProductTabs"; import { blogImage, fetchBlog } from "@/lib/blog"; import { fetchComments } from "@/lib/comments"; import { formatFaDate } from "@/lib/format"; export const revalidate = 60; export async function generateMetadata({ params, }: { params: Promise<{ slug: string }>; }): Promise { const { slug } = await params; const post = await fetchBlog(slug); return { title: post ? `${post.title} | مجله سلامت` : "مقاله" }; } export default async function BlogDetailsPage({ params }: { params: Promise<{ slug: string }> }) { const { slug } = await params; const post = await fetchBlog(slug); if (!post) notFound(); const comments = await fetchComments("blog", post.id); return (

خانه / مجله سلامت

{post.title}

{formatFaDate(post.publishedAt || post.createdAt)}

{post.abstract ?

{post.abstract}

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