Connect the storefront to Meshkee catalog, blogs, and static image slots.

Wire homepage specials, product/blog pages, instant search, and the customer portal so the live pharmacy site can be managed from the dashboard.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Alireza Hassani
2026-08-19 23:51:41 +03:30
co-authored by Cursor
parent cd2f9dfc9d
commit 66e604c426
39 changed files with 1900 additions and 188 deletions
+50
View File
@@ -0,0 +1,50 @@
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<Metadata> {
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 (
<article className="pt-8">
<Container className="max-w-3xl">
<p className="text-[13px] text-muted">
<Link href="/" className="hover:text-primary">خانه</Link>
<span className="mx-2">/</span>
<Link href="/blog" className="hover:text-primary">مجله سلامت</Link>
</p>
<h1 className="mt-3 text-[24px] font-bold leading-10 text-navy">{post.title}</h1>
<p className="mt-2 text-[13px] text-muted">{formatFaDate(post.publishedAt || post.createdAt)}</p>
<div className="mt-5 overflow-hidden rounded-2xl bg-sky">
<Placeholder src={blogImage(post)} alt={post.title} className="aspect-[16/8] w-full object-cover" />
</div>
{post.abstract ? <p className="mt-6 text-[15px] leading-8 text-ink">{post.abstract}</p> : null}
{post.mainTextHtml ? (
<div className="rich-text mt-6 text-[14px] leading-8 text-ink" dangerouslySetInnerHTML={{ __html: post.mainTextHtml }} />
) : null}
<ProductTabs showDescription={false} comments={comments} />
</Container>
</article>
);
}