Polish product pages with subcategory filters, gallery, and denser grids.
Move category showcase to product routes, add clickable subcategory chips on category pages, and tighten banner/card spacing for mobile-to-desktop layouts. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
8aeba175db
commit
c78abfa1de
@@ -200,6 +200,18 @@ export function productImage(product: Product): string | null {
|
||||
return product.thumbnail || product.image || product.thumbnailUrl || null;
|
||||
}
|
||||
|
||||
/** Unique gallery URLs: `images[]` first, then the primary thumbnail/image. */
|
||||
export function productImages(product: Product): string[] {
|
||||
const seen = new Set<string>();
|
||||
const out: string[] = [];
|
||||
for (const url of [...(product.images ?? []), product.thumbnail, product.image, product.thumbnailUrl]) {
|
||||
if (!url || seen.has(url)) continue;
|
||||
seen.add(url);
|
||||
out.push(url);
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
export function productPriceLabel(product: Product): string {
|
||||
if (product.store?.minPrice) {
|
||||
const formatted = new Intl.NumberFormat("fa-IR").format(product.store.minPrice);
|
||||
|
||||
Reference in New Issue
Block a user