pagination/filter product api
This commit is contained in:
@@ -9,9 +9,7 @@ interface PageProps {
|
||||
}
|
||||
|
||||
export default async function SingleProductPage({ params }: PageProps) {
|
||||
// --------------------------------------------------------
|
||||
// ۱. منطق دریافت دادهها (دقیقا مشابه درخواست شما)
|
||||
// --------------------------------------------------------
|
||||
|
||||
const resolvedParams = await params;
|
||||
const slug = resolvedParams.slug;
|
||||
|
||||
@@ -28,10 +26,7 @@ export default async function SingleProductPage({ params }: PageProps) {
|
||||
return notFound();
|
||||
}
|
||||
|
||||
// --------------------------------------------------------
|
||||
// ۲. آمادهسازی و مپ کردن دادههای API برای UI
|
||||
// --------------------------------------------------------
|
||||
|
||||
|
||||
// فرمت کردن قیمت
|
||||
const formattedPrice = product.display_price
|
||||
? product.display_price.toLocaleString('fa-IR')
|
||||
@@ -49,12 +44,10 @@ export default async function SingleProductPage({ params }: PageProps) {
|
||||
return attr ? attr.valueText : "-";
|
||||
};
|
||||
|
||||
// --------------------------------------------------------
|
||||
// ۳. خروجی UI (بدون تغییر در ساختار و استایلها)
|
||||
// --------------------------------------------------------
|
||||
|
||||
return (
|
||||
<div className="bg-[#f8f9fc] min-h-screen py-8" dir="rtl">
|
||||
<div className="mx-auto px-4 lg:px-8 container max-w-7xl">
|
||||
<div className="mx-auto px-4 lg:px-8 container max-w-6xl">
|
||||
<ScrollToTop />
|
||||
|
||||
{/* مسیر راهنما */}
|
||||
|
||||
Reference in New Issue
Block a user