From c90799ef17f765467e0b5f8a29528996b47af9f9 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 27 Jun 2026 23:27:49 -0400 Subject: [PATCH] x --- apps/spa/src/components/ProductCard.tsx | 2 +- apps/spa/src/components/sections/AccordionSection.tsx | 2 +- packages/types/index.ts | 11 ++++++++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/apps/spa/src/components/ProductCard.tsx b/apps/spa/src/components/ProductCard.tsx index 5740773..458fae1 100644 --- a/apps/spa/src/components/ProductCard.tsx +++ b/apps/spa/src/components/ProductCard.tsx @@ -43,7 +43,7 @@ export default function ProductCard({ product, enableQuickShop = false, category const { addToCart } = useCartStore(); const { i18n, t } = useTranslation(); const isWished = isInWishlist(product.id); - const [selectedVariant, setSelectedVariant] = useState(product.variants?.[0] || null); + const [selectedVariant, _setSelectedVariant] = useState(product.variants?.[0] || null); const displayName = resolveStr(product.name, i18n.language) || (product.brand ? product.brand.name : ''); const displayCategoryName = categoryNameOverride || resolveStr(product.category.name, i18n.language); diff --git a/apps/spa/src/components/sections/AccordionSection.tsx b/apps/spa/src/components/sections/AccordionSection.tsx index e7ee6c7..3b6906f 100644 --- a/apps/spa/src/components/sections/AccordionSection.tsx +++ b/apps/spa/src/components/sections/AccordionSection.tsx @@ -29,7 +29,7 @@ export default function AccordionSection({ payload }: AccordionSectionProps) { {title} )} - {payload.categories.map((category, catIndex) => ( + {(payload.categories ?? []).map((category, catIndex) => (

{category.icon && ( diff --git a/packages/types/index.ts b/packages/types/index.ts index bf42c70..dd8b36a 100644 --- a/packages/types/index.ts +++ b/packages/types/index.ts @@ -409,10 +409,19 @@ export type ProductCarouselSectionPayload = z.infer