From 5be1c24bc2b548e72f5595c1d46c1fa9ba1f75ad Mon Sep 17 00:00:00 2001 From: hamid zarghami Date: Mon, 15 Dec 2025 16:06:42 +0330 Subject: [PATCH] short desc --- src/app/product/components/BaseInformation.tsx | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/app/product/components/BaseInformation.tsx b/src/app/product/components/BaseInformation.tsx index 000b387..c7f960f 100644 --- a/src/app/product/components/BaseInformation.tsx +++ b/src/app/product/components/BaseInformation.tsx @@ -20,6 +20,14 @@ const BaseInformation: FC = ({ product, stats }) => { const brand = product.brand + const descriptionSource = + product.metaDescription || product.seoDescription || product.description + + const shortDescription = + descriptionSource && descriptionSource.length > 160 + ? `${descriptionSource.slice(0, 160)}...` + : descriptionSource + // محاسبه میانگین امتیاز و تعداد دیدگاه‌ها @@ -90,7 +98,7 @@ const BaseInformation: FC = ({ product, stats }) => { } return ( -
+
{/* بررسی وجود فیلدهای خاص در variant ها */} {(() => { // اگر هیچ فیلد خاصی وجود نداشت، نمایش عمومی @@ -281,6 +289,12 @@ const BaseInformation: FC = ({ product, stats }) => { : null } + {product.specifications.length === 0 && shortDescription && ( +

+ {shortDescription} +

+ )} +
{product.specifications.slice(0, 3).map((spec, index) => (