Add Meshkee sitemap config, technical-info labels, and footer credit.

Wire specs to /technical-info for field labels, match Safeteb footer credit, and publish build-time /meshkee/sitemap-config.json for SEO sync.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Alireza Hassani
2026-08-27 07:11:52 +03:30
co-authored by Cursor
parent 386787b4b5
commit d249d958eb
15 changed files with 590 additions and 108 deletions
+20 -13
View File
@@ -7,11 +7,11 @@ import { ProductTabs } from "@/components/ProductTabs";
import { Products } from "@/components/Products";
import { SiteShell } from "@/components/SiteShell";
import { site } from "@/data/home";
import { getCategoryVariationFieldMap } from "@/lib/api/product-fields";
import {
formatCondition,
formatPrice,
getUserProductBySlugOrNull,
getUserProductTechnicalInfo,
listUserProducts,
productCategory,
productTitle,
@@ -29,9 +29,17 @@ export async function generateMetadata({
const product = await getUserProductBySlugOrNull(slug);
if (!product) return { title: "محصول یافت نشد" };
const title = productTitle(product);
const description =
product.descriptionFa || product.description || product.descriptionEn || title;
const image = product.imageUrl || product.images?.[0]?.url || undefined;
return {
title,
description: product.descriptionFa || product.description || title,
description,
openGraph: {
title,
description,
...(image ? { images: [{ url: image, alt: title }] } : {}),
},
};
}
@@ -50,16 +58,15 @@ export default async function UserProductDetailPage({ params }: PageProps) {
const description =
product.descriptionFa || product.description || product.descriptionEn;
const deliveryNotes = product.deliveryNotes ?? product.deliveryNote ?? null;
const technicalFieldLabels = await getCategoryVariationFieldMap(
product.categoryId,
);
const similarResult = product.categoryId
? await listUserProducts({
categoryId: product.categoryId,
pageSize: 5,
})
: { items: [], total: 0 };
const [technicalInfo, similarResult] = await Promise.all([
getUserProductTechnicalInfo(slug),
product.categoryId
? listUserProducts({
categoryId: product.categoryId,
pageSize: 5,
})
: Promise.resolve({ items: [], total: 0 }),
]);
const similarProducts = similarResult.items
.filter((item) => item.id !== product.id)
@@ -149,7 +156,7 @@ export default async function UserProductDetailPage({ params }: PageProps) {
technicalNotes={product.technicalNotes}
deliveryNotes={deliveryNotes}
technicalValues={product.technicalValues}
technicalFieldLabels={technicalFieldLabels}
technicalInfo={technicalInfo}
/>
{similarProducts.length > 0 ? (