Add gallery lightbox, tabs, marketplace CTAs, and similar products on product pages; load the business logo and level-2 category dropdown in the header. Co-authored-by: Cursor <cursoragent@cursor.com>
10 lines
308 B
TypeScript
10 lines
308 B
TypeScript
export function resolveProductGallery(product: {
|
|
images?: { url: string }[] | null;
|
|
imageUrl?: string | null;
|
|
}) {
|
|
const fromImages =
|
|
product.images?.map((img) => img.url).filter(Boolean) ?? [];
|
|
if (fromImages.length > 0) return fromImages;
|
|
return product.imageUrl ? [product.imageUrl] : [];
|
|
}
|