storefront-layouts 1.0.6 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (160) hide show
  1. package/dist/components/ui/route-skeleton-loader.d.ts.map +1 -1
  2. package/dist/components/ui/route-skeleton-loader.js +6 -1
  3. package/dist/editor/alignment-schemas/booking-footer-section.d.ts.map +1 -1
  4. package/dist/editor/alignment-schemas/booking-footer-section.js +0 -1
  5. package/dist/editor/alignment-schemas/clothing.d.ts.map +1 -1
  6. package/dist/editor/alignment-schemas/clothing.js +0 -1
  7. package/dist/editor/alignment-schemas/food.d.ts.map +1 -1
  8. package/dist/editor/alignment-schemas/food.js +0 -1
  9. package/dist/hooks/use-category-products.d.ts +5 -1
  10. package/dist/hooks/use-category-products.d.ts.map +1 -1
  11. package/dist/hooks/use-category-products.js +8 -5
  12. package/dist/hooks/use-filtered-products-fetch.d.ts +12 -0
  13. package/dist/hooks/use-filtered-products-fetch.d.ts.map +1 -0
  14. package/dist/hooks/use-filtered-products-fetch.js +58 -0
  15. package/dist/index.d.ts +5 -0
  16. package/dist/index.d.ts.map +1 -1
  17. package/dist/index.js +5 -0
  18. package/dist/layouts/booking/components/BookingHomePage.d.ts.map +1 -1
  19. package/dist/layouts/booking/components/BookingHomePage.js +3 -1
  20. package/dist/layouts/booking/pages/AboutPage.d.ts.map +1 -1
  21. package/dist/layouts/booking/pages/AboutPage.js +3 -1
  22. package/dist/layouts/booking/pages/CategoryPage.d.ts.map +1 -1
  23. package/dist/layouts/booking/pages/CategoryPage.js +3 -1
  24. package/dist/layouts/booking/pages/ProductDetailPage.d.ts.map +1 -1
  25. package/dist/layouts/booking/pages/ProductDetailPage.js +2 -1
  26. package/dist/layouts/booking/pages/ServicesPage.d.ts.map +1 -1
  27. package/dist/layouts/booking/pages/ServicesPage.js +4 -2
  28. package/dist/layouts/booking-agenda/pages/AboutPage.d.ts.map +1 -1
  29. package/dist/layouts/booking-agenda/pages/AboutPage.js +3 -1
  30. package/dist/layouts/booking-agenda/pages/CategoryPage.d.ts.map +1 -1
  31. package/dist/layouts/booking-agenda/pages/CategoryPage.js +3 -1
  32. package/dist/layouts/booking-agenda/pages/ProductDetailPage.d.ts.map +1 -1
  33. package/dist/layouts/booking-agenda/pages/ProductDetailPage.js +2 -1
  34. package/dist/layouts/booking-agenda/pages/ServicesPage.d.ts.map +1 -1
  35. package/dist/layouts/booking-agenda/pages/ServicesPage.js +4 -2
  36. package/dist/layouts/clothing/components/ClothingHomePage.d.ts.map +1 -1
  37. package/dist/layouts/clothing/components/ClothingHomePage.js +5 -4
  38. package/dist/layouts/clothing/pages/AboutPage.d.ts.map +1 -1
  39. package/dist/layouts/clothing/pages/AboutPage.js +2 -1
  40. package/dist/layouts/clothing/pages/CategoriesPage.d.ts.map +1 -1
  41. package/dist/layouts/clothing/pages/CategoriesPage.js +3 -2
  42. package/dist/layouts/clothing/pages/CategoryPage.d.ts +3 -1
  43. package/dist/layouts/clothing/pages/CategoryPage.d.ts.map +1 -1
  44. package/dist/layouts/clothing/pages/CategoryPage.js +4 -3
  45. package/dist/layouts/clothing/pages/ProductDetailPage.d.ts.map +1 -1
  46. package/dist/layouts/clothing/pages/ProductDetailPage.js +3 -2
  47. package/dist/layouts/clothing/pages/ProductsPage.d.ts.map +1 -1
  48. package/dist/layouts/clothing/pages/ProductsPage.js +53 -60
  49. package/dist/layouts/clothing-minimal/components/ClothingHomePageMinimal.d.ts.map +1 -1
  50. package/dist/layouts/clothing-minimal/components/ClothingHomePageMinimal.js +4 -3
  51. package/dist/layouts/clothing-minimal/pages/AboutPage.d.ts.map +1 -1
  52. package/dist/layouts/clothing-minimal/pages/AboutPage.js +2 -1
  53. package/dist/layouts/clothing-minimal/pages/CategoriesPage.d.ts.map +1 -1
  54. package/dist/layouts/clothing-minimal/pages/CategoriesPage.js +3 -2
  55. package/dist/layouts/clothing-minimal/pages/CategoryPage.d.ts +3 -1
  56. package/dist/layouts/clothing-minimal/pages/CategoryPage.d.ts.map +1 -1
  57. package/dist/layouts/clothing-minimal/pages/CategoryPage.js +4 -3
  58. package/dist/layouts/clothing-minimal/pages/ProductDetailPage.d.ts.map +1 -1
  59. package/dist/layouts/clothing-minimal/pages/ProductDetailPage.js +2 -1
  60. package/dist/layouts/clothing-minimal/pages/ProductsPage.d.ts.map +1 -1
  61. package/dist/layouts/clothing-minimal/pages/ProductsPage.js +53 -60
  62. package/dist/layouts/electronics/components/ElectronicsHomePage.d.ts.map +1 -1
  63. package/dist/layouts/electronics/components/ElectronicsHomePage.js +2 -1
  64. package/dist/layouts/electronics/components/ElectronicsProductsPage.d.ts.map +1 -1
  65. package/dist/layouts/electronics/components/ElectronicsProductsPage.js +45 -36
  66. package/dist/layouts/electronics/components/ElectronicsStoreFooter.d.ts.map +1 -1
  67. package/dist/layouts/electronics/components/ElectronicsStoreFooter.js +2 -1
  68. package/dist/layouts/electronics/pages/AboutPage.d.ts.map +1 -1
  69. package/dist/layouts/electronics/pages/AboutPage.js +3 -1
  70. package/dist/layouts/electronics/pages/CategoryPage.d.ts +3 -1
  71. package/dist/layouts/electronics/pages/CategoryPage.d.ts.map +1 -1
  72. package/dist/layouts/electronics/pages/CategoryPage.js +4 -3
  73. package/dist/layouts/electronics/pages/ProductDetailPage.d.ts.map +1 -1
  74. package/dist/layouts/electronics/pages/ProductDetailPage.js +2 -1
  75. package/dist/layouts/electronics/pages/ProductsPage.d.ts.map +1 -1
  76. package/dist/layouts/electronics/pages/ProductsPage.js +53 -60
  77. package/dist/layouts/electronics-grid/components/ElectronicsHomePageGrid.d.ts.map +1 -1
  78. package/dist/layouts/electronics-grid/components/ElectronicsHomePageGrid.js +2 -1
  79. package/dist/layouts/electronics-grid/pages/AboutPage.d.ts.map +1 -1
  80. package/dist/layouts/electronics-grid/pages/AboutPage.js +3 -1
  81. package/dist/layouts/electronics-grid/pages/CategoryPage.d.ts +3 -1
  82. package/dist/layouts/electronics-grid/pages/CategoryPage.d.ts.map +1 -1
  83. package/dist/layouts/electronics-grid/pages/CategoryPage.js +4 -3
  84. package/dist/layouts/electronics-grid/pages/ProductDetailPage.d.ts.map +1 -1
  85. package/dist/layouts/electronics-grid/pages/ProductDetailPage.js +2 -1
  86. package/dist/layouts/electronics-grid/pages/ProductsPage.d.ts.map +1 -1
  87. package/dist/layouts/electronics-grid/pages/ProductsPage.js +53 -60
  88. package/dist/layouts/food/components/FoodHomePage.d.ts.map +1 -1
  89. package/dist/layouts/food/components/FoodHomePage.js +6 -4
  90. package/dist/layouts/food/pages/AboutPage.d.ts.map +1 -1
  91. package/dist/layouts/food/pages/AboutPage.js +2 -1
  92. package/dist/layouts/food/pages/CategoryPage.d.ts +3 -1
  93. package/dist/layouts/food/pages/CategoryPage.d.ts.map +1 -1
  94. package/dist/layouts/food/pages/CategoryPage.js +5 -3
  95. package/dist/layouts/food/pages/MenuPage.js +1 -1
  96. package/dist/layouts/food/pages/ProductDetailPage.d.ts.map +1 -1
  97. package/dist/layouts/food/pages/ProductDetailPage.js +2 -1
  98. package/dist/layouts/food/pages/ProductsPage.d.ts.map +1 -1
  99. package/dist/layouts/food/pages/ProductsPage.js +51 -54
  100. package/dist/layouts/food-modern/components/FoodHomePageModern.d.ts.map +1 -1
  101. package/dist/layouts/food-modern/components/FoodHomePageModern.js +4 -2
  102. package/dist/layouts/food-modern/pages/AboutPage.d.ts.map +1 -1
  103. package/dist/layouts/food-modern/pages/AboutPage.js +3 -1
  104. package/dist/layouts/food-modern/pages/CategoryPage.d.ts +3 -1
  105. package/dist/layouts/food-modern/pages/CategoryPage.d.ts.map +1 -1
  106. package/dist/layouts/food-modern/pages/CategoryPage.js +5 -3
  107. package/dist/layouts/food-modern/pages/MenuPage.js +1 -1
  108. package/dist/layouts/food-modern/pages/ProductDetailPage.d.ts.map +1 -1
  109. package/dist/layouts/food-modern/pages/ProductDetailPage.js +2 -1
  110. package/dist/layouts/food-modern/pages/ProductsPage.d.ts.map +1 -1
  111. package/dist/layouts/food-modern/pages/ProductsPage.js +51 -54
  112. package/dist/layouts/motivational-speaker/components/MotivationalHomePage.d.ts.map +1 -1
  113. package/dist/layouts/motivational-speaker/components/MotivationalHomePage.js +4 -2
  114. package/dist/layouts/motivational-speaker/pages/AboutPage.d.ts.map +1 -1
  115. package/dist/layouts/motivational-speaker/pages/AboutPage.js +3 -1
  116. package/dist/layouts/motivational-speaker/pages/CategoryPage.d.ts +3 -1
  117. package/dist/layouts/motivational-speaker/pages/CategoryPage.d.ts.map +1 -1
  118. package/dist/layouts/motivational-speaker/pages/CategoryPage.js +6 -4
  119. package/dist/layouts/motivational-speaker/pages/ProductsPage.d.ts.map +1 -1
  120. package/dist/layouts/motivational-speaker/pages/ProductsPage.js +53 -60
  121. package/dist/layouts/motivational-speaker/pages/ServiceDetailPage.d.ts.map +1 -1
  122. package/dist/layouts/motivational-speaker/pages/ServiceDetailPage.js +2 -1
  123. package/dist/layouts/motivational-speaker/pages/ServicesPage.d.ts.map +1 -1
  124. package/dist/layouts/motivational-speaker/pages/ServicesPage.js +4 -2
  125. package/dist/layouts/motivational-speaker/pages/SubscriptionPage.d.ts.map +1 -1
  126. package/dist/layouts/motivational-speaker/pages/SubscriptionPage.js +3 -2
  127. package/dist/layouts/shared/components/StoreFooter.d.ts.map +1 -1
  128. package/dist/layouts/shared/components/StoreFooter.js +3 -13
  129. package/dist/layouts/shared/pages/PortfolioPage.d.ts.map +1 -1
  130. package/dist/layouts/shared/pages/PortfolioPage.js +2 -1
  131. package/dist/layouts/shared/pages/StoreMaintenanceScreen.d.ts +9 -0
  132. package/dist/layouts/shared/pages/StoreMaintenanceScreen.d.ts.map +1 -0
  133. package/dist/layouts/shared/pages/StoreMaintenanceScreen.js +10 -0
  134. package/dist/layouts/shared/pages/StoreOfflinePage.d.ts +19 -0
  135. package/dist/layouts/shared/pages/StoreOfflinePage.d.ts.map +1 -0
  136. package/dist/layouts/shared/pages/StoreOfflinePage.js +113 -0
  137. package/dist/layouts/shared/pages/WishlistPage.d.ts.map +1 -1
  138. package/dist/layouts/shared/pages/WishlistPage.js +11 -14
  139. package/dist/lib/content-selectors.js +3 -3
  140. package/dist/lib/layout-route-utils.d.ts +1 -0
  141. package/dist/lib/layout-route-utils.d.ts.map +1 -1
  142. package/dist/lib/layout-route-utils.js +1 -1
  143. package/dist/lib/services/product.service.d.ts +1 -0
  144. package/dist/lib/services/product.service.d.ts.map +1 -1
  145. package/dist/lib/store-context.d.ts +1 -0
  146. package/dist/lib/store-context.d.ts.map +1 -1
  147. package/dist/lib/store-context.js +1 -0
  148. package/dist/lib/utils/catalog-price-bounds.d.ts +2 -0
  149. package/dist/lib/utils/catalog-price-bounds.d.ts.map +1 -1
  150. package/dist/lib/utils/catalog-price-bounds.js +21 -0
  151. package/dist/lib/utils/filtered-product-query.d.ts +22 -0
  152. package/dist/lib/utils/filtered-product-query.d.ts.map +1 -0
  153. package/dist/lib/utils/filtered-product-query.js +57 -0
  154. package/dist/lib/utils/filtered-products-inflight.d.ts +3 -0
  155. package/dist/lib/utils/filtered-products-inflight.d.ts.map +1 -0
  156. package/dist/lib/utils/filtered-products-inflight.js +15 -0
  157. package/dist/lib/utils/url-helpers.d.ts.map +1 -1
  158. package/dist/lib/utils/url-helpers.js +2 -11
  159. package/dist/styles/index.css +33 -6
  160. package/package.json +2 -2
@@ -13,15 +13,18 @@ import { useLoading } from '../../../lib/loading-context';
13
13
  import { useAnalytics } from '../../../hooks/use-analytics';
14
14
  import { ChevronDown, ChevronUp, Star, Check, Search, RotateCcw, SlidersHorizontal } from 'lucide-react';
15
15
  import { useSearchParams } from 'next/navigation';
16
- import { useState, useMemo, useEffect, useRef, Suspense } from 'react';
16
+ import { useState, useMemo, useEffect, Suspense } from 'react';
17
17
  import { useProductBrands } from '../../../hooks/use-product-brands.js';
18
+ import { useFilteredProductsFetch } from '../../../hooks/use-filtered-products-fetch.js';
18
19
  import { filterActiveProducts } from '../../../lib/utils';
19
20
  import { getAllCategoryIds, flattenCategoryTree, buildCategoryTree } from '../../../lib/utils/category-tree';
20
21
  import { getBannerImage, getLayoutText } from '../../../lib/utils/asset-helpers';
21
22
  import { SafeRichHtml } from '../../../components/rich-text/SafeRichHtml';
22
23
  import { shouldUseAPI } from '../../../lib/utils/demo-detection';
23
24
  import { useCatalogPriceRange } from '../../../hooks/use-catalog-price-range.js';
24
- import { isWithinActivePriceRange } from '../../../lib/utils/catalog-price-bounds.js';
25
+ import { getApiPriceFilterActive, isWithinActivePriceRange } from '../../../lib/utils/catalog-price-bounds.js';
26
+ import { buildFilteredProductQuery, getFilteredProductQueryKey, } from '../../../lib/utils/filtered-product-query.js';
27
+ import { transformProductToStoreProduct } from '../../../lib/store-config-utils.js';
25
28
  import { ProductPriceFilterSection } from '../../shared/components/ProductPriceFilterSection';
26
29
  function ProductsPageContent({ storeConfig: initialConfig }) {
27
30
  const { store, addToCart } = useStore();
@@ -64,7 +67,9 @@ function ProductsPageContent({ storeConfig: initialConfig }) {
64
67
  const [selectedBrands, setSelectedBrands] = useState([]);
65
68
  const [selectedCategories, setSelectedCategories] = useState([]);
66
69
  const storeCurrency = storeConfig.settings?.currency || 'NGN';
67
- const { priceRange, setPriceRange, catalogBounds, resetPriceRange, hasActivePriceFilter, } = useCatalogPriceRange(products);
70
+ const bootstrapProducts = useMemo(() => filterActiveProducts(storeConfig.products || []), [storeConfig.products]);
71
+ const priceCatalogItems = bootstrapProducts.length > 0 ? bootstrapProducts : products;
72
+ const { priceRange, setPriceRange, catalogBounds, resetPriceRange, hasActivePriceFilter, } = useCatalogPriceRange(priceCatalogItems);
68
73
  const [selectedCategoryFilter, setSelectedCategoryFilter] = useState(null);
69
74
  // Initialize filters from URL
70
75
  useEffect(() => {
@@ -182,64 +187,52 @@ function ProductsPageContent({ storeConfig: initialConfig }) {
182
187
  }
183
188
  return result;
184
189
  }, [products, selectedBrands, effectiveCategoryIds, priceRange, selectedCategoryFilter, minRating, showInStockOnly, sortBy, categories]);
185
- const productQuery = useMemo(() => {
186
- const categoryIds = new Set(effectiveCategoryIds);
187
- const selectedCategory = categories.find((category) => category.slug === selectedCategoryFilter);
188
- if (selectedCategory)
189
- getAllCategoryIds(selectedCategory).forEach((id) => categoryIds.add(id));
190
- return {
190
+ const hasApiPriceFilter = getApiPriceFilterActive(priceRange, bootstrapProducts);
191
+ const priceQueryMin = hasApiPriceFilter ? priceRange[0] : undefined;
192
+ const priceQueryMax = hasApiPriceFilter ? priceRange[1] : undefined;
193
+ const { productQueryParams, productQueryKey } = useMemo(() => {
194
+ const params = buildFilteredProductQuery({
191
195
  storeId: storeConfig.id,
192
- categoryIds: categoryIds.size ? Array.from(categoryIds).join(',') : undefined,
193
- brands: selectedBrands.length ? selectedBrands.join(',') : undefined,
194
- minPrice: priceRange[0] || undefined,
195
- maxPrice: priceRange[1] < catalogBounds.max ? priceRange[1] : undefined,
196
- rating: minRating || undefined,
197
- inStock: showInStockOnly || undefined,
196
+ categories,
197
+ effectiveCategoryIds,
198
+ selectedCategoryFilter,
199
+ selectedBrands,
200
+ priceRange,
201
+ hasActivePriceFilter: hasApiPriceFilter,
202
+ minRating,
203
+ showInStockOnly,
198
204
  sortBy,
205
+ });
206
+ return {
207
+ productQueryParams: params,
208
+ productQueryKey: getFilteredProductQueryKey(params),
199
209
  };
200
- }, [catalogBounds.max, categories, effectiveCategoryIds, minRating, priceRange, selectedBrands, selectedCategoryFilter, showInStockOnly, sortBy, storeConfig.id]);
201
- const skipBootstrapRefetch = useRef(true);
202
- useEffect(() => {
203
- let cancelled = false;
204
- const isDefaultQuery = !productQuery.categoryIds &&
205
- !productQuery.brands &&
206
- !productQuery.minPrice &&
207
- productQuery.maxPrice === undefined &&
208
- !productQuery.rating &&
209
- !productQuery.inStock &&
210
- productQuery.sortBy === 'featured';
211
- const fetchFilteredProducts = async () => {
212
- // Keep SSR bootstrap first paint; only refetch when filters/sort change.
213
- if (skipBootstrapRefetch.current && isDefaultQuery && products.length > 0) {
214
- skipBootstrapRefetch.current = false;
215
- setTotalProducts(storeConfig.productsTotal || products.length);
216
- return;
217
- }
218
- skipBootstrapRefetch.current = false;
219
- setIsLoadingProducts(true);
220
- try {
221
- const { productService } = await import('../../../lib/services/product.service.js');
222
- const { transformProductToStoreProduct } = await import('../../../lib/store-config-utils.js');
223
- const response = await productService.getProducts({ ...productQuery, page: 1, limit: 12 });
224
- if (cancelled)
225
- return;
226
- setProducts(response.data.map(transformProductToStoreProduct));
227
- setCurrentPage(1);
228
- setTotalProducts(response.meta.total);
229
- setVisibleProducts(12);
230
- }
231
- catch (error) {
232
- if (!cancelled)
233
- console.error('Failed to fetch products:', error);
234
- }
235
- finally {
236
- if (!cancelled)
237
- setIsLoadingProducts(false);
238
- }
239
- };
240
- fetchFilteredProducts();
241
- return () => { cancelled = true; };
242
- }, [productQuery]);
210
+ }, [
211
+ storeConfig.id,
212
+ categories,
213
+ effectiveCategoryIds,
214
+ selectedCategoryFilter,
215
+ selectedBrands,
216
+ hasApiPriceFilter,
217
+ priceQueryMin,
218
+ priceQueryMax,
219
+ minRating,
220
+ showInStockOnly,
221
+ sortBy,
222
+ ]);
223
+ useFilteredProductsFetch(productQueryParams, productQueryKey, {
224
+ bootstrapItemCount: bootstrapProducts.length,
225
+ bootstrapTotal: storeConfig.productsTotal,
226
+ mapResponse: (data) => data.map(transformProductToStoreProduct),
227
+ applyResults: (items, total) => {
228
+ setProducts(items);
229
+ setCurrentPage(1);
230
+ setTotalProducts(total);
231
+ setVisibleProducts(12);
232
+ },
233
+ setTotalProducts,
234
+ setLoading: setIsLoadingProducts,
235
+ });
243
236
  const displayedProducts = filteredAndSortedProducts.slice(0, visibleProducts);
244
237
  const hasMore = currentPage * 12 < totalProducts;
245
238
  const handleLoadMore = async () => {
@@ -250,7 +243,7 @@ function ProductsPageContent({ storeConfig: initialConfig }) {
250
243
  const { productService } = await import('../../../lib/services/product.service.js');
251
244
  const { transformProductToStoreProduct } = await import('../../../lib/store-config-utils.js');
252
245
  const nextPage = currentPage + 1;
253
- const response = await productService.getProducts({ ...productQuery, page: nextPage, limit: 12 });
246
+ const response = await productService.getProducts({ ...productQueryParams, page: nextPage, limit: 12 });
254
247
  setProducts((current) => [...current, ...response.data.map(transformProductToStoreProduct)]);
255
248
  setCurrentPage(nextPage);
256
249
  setTotalProducts(response.meta.total);
@@ -320,7 +313,7 @@ function ProductsPageContent({ storeConfig: initialConfig }) {
320
313
  const secondaryButtonText = hasSecondaryButtonFromConfig
321
314
  ? (categoryHeaderSecondaryButton && categoryHeaderSecondaryButton.trim() !== '' ? categoryHeaderSecondaryButton.trim() : null)
322
315
  : getLayoutText(storeConfig, 'sections.categories.viewAll', 'View Categories');
323
- return (_jsxs("div", { className: "min-h-screen bg-white font-sans text-slate-900", children: [layoutConfig?.sections?.productsHeader?.show !== false && (_jsxs("div", { className: "relative overflow-hidden bg-white", children: [(layoutConfig?.sections?.productsHeader?.image || categoryHeaderImage) && (_jsxs("div", { className: "absolute inset-0 z-0", children: [_jsx(ImageWithFallback, { src: layoutConfig?.sections?.productsHeader?.image || categoryHeaderImage, alt: layoutConfig?.sections?.productsHeader?.title || categoryHeaderTitle || storeConfig.name, className: "w-full h-full object-cover", skeletonAspectRatio: "16/9" }), _jsx("div", { className: "absolute inset-0 bg-gradient-to-r from-black/60 via-black/40 to-black/60" })] })), !(layoutConfig?.sections?.productsHeader?.image || categoryHeaderImage) && (_jsxs("div", { className: "absolute top-0 left-0 w-full h-full overflow-hidden z-0 pointer-events-none", children: [_jsx("div", { className: "absolute top-[-10%] right-[-5%] w-[500px] h-[500px] bg-gray-100 rounded-full mix-blend-multiply filter blur-3xl opacity-70 animate-pulse-slow" }), _jsx("div", { className: "absolute bottom-[-10%] left-[-10%] w-[400px] h-[400px] bg-gray-50 rounded-full mix-blend-multiply filter blur-3xl opacity-70 animate-pulse-slow", style: { animationDelay: '2s' } })] })), _jsx("div", { className: `container mx-auto px-4 sm:px-6 lg:px-8 relative z-10 pt-12 pb-16 lg:pt-20 lg:pb-24 ${(layoutConfig?.sections?.productsHeader?.image || categoryHeaderImage) ? 'min-h-[500px] flex items-center' : ''}`, children: _jsx("div", { className: "flex flex-col items-center w-full max-w-4xl mx-auto", children: _jsxs("div", { className: `w-full text-center lg:text-left animate-fade-in-up ${(layoutConfig?.sections?.productsHeader?.image || categoryHeaderImage) ? 'text-white' : ''}`, children: [_jsx("div", { className: "flex justify-center lg:justify-start mb-6", children: _jsx("div", { className: (layoutConfig?.sections?.productsHeader?.image || categoryHeaderImage) ? 'bg-white/10 backdrop-blur-md px-4 py-2 rounded-full border border-white/20' : '', children: _jsx(Breadcrumbs, { items: breadcrumbItems, variant: (layoutConfig?.sections?.productsHeader?.image || categoryHeaderImage) ? 'light' : 'default' }) }) }), _jsxs("div", { className: `inline-flex items-center gap-2 px-3 py-1 rounded-full text-xs font-bold tracking-wider uppercase mb-6 ${(layoutConfig?.sections?.productsHeader?.image || categoryHeaderImage) ? 'bg-white/20 backdrop-blur-md text-white border border-white/30' : 'bg-black/5 text-gray-900'}`, children: [_jsx("span", { className: `w-2 h-2 rounded-full animate-pulse ${(layoutConfig?.sections?.productsHeader?.image || categoryHeaderImage) ? 'bg-white' : 'bg-black'}` }), layoutConfig?.sections?.productsHeader?.badge || getLayoutText(storeConfig, 'common.newArrivals', 'New Arrivals 2024')] }), _jsx("h1", { className: `text-4xl sm:text-5xl lg:text-6xl font-bold tracking-tight mb-6 leading-[1.1] ${(layoutConfig?.sections?.productsHeader?.image || categoryHeaderImage) ? 'text-white' : 'text-gray-900'}`, children: layoutConfig?.sections?.productsHeader?.title || categoryHeaderTitle || (_jsxs(_Fragment, { children: ["Explore The Collections of ", _jsx("br", {}), _jsx("span", { className: "text-transparent bg-clip-text bg-gradient-to-r from-gray-900 via-gray-700 to-gray-900", children: storeConfig.name })] })) }), _jsx("div", { className: `text-lg mb-8 leading-relaxed max-w-lg mx-auto lg:mx-0 [&_p]:mb-3 [&_p:last-child]:mb-0 ${(layoutConfig?.sections?.productsHeader?.image || categoryHeaderImage) ? 'text-white/90' : 'text-gray-600'}`, children: _jsx(SafeRichHtml, { value: layoutConfig?.sections?.productsHeader?.description ||
316
+ return (_jsxs("div", { className: "min-h-screen bg-white font-sans text-slate-900", children: [layoutConfig?.sections?.productsHeader?.show !== false && (_jsxs("div", { className: "relative overflow-hidden bg-white", children: [(layoutConfig?.sections?.productsHeader?.image || categoryHeaderImage) && (_jsxs("div", { className: "absolute inset-0 z-0", children: [_jsx(ImageWithFallback, { src: layoutConfig?.sections?.productsHeader?.image || categoryHeaderImage, alt: layoutConfig?.sections?.productsHeader?.title || categoryHeaderTitle || storeConfig.name, className: "w-full h-full object-cover", skeletonAspectRatio: "16/9" }), _jsx("div", { className: "absolute inset-0 bg-gradient-to-r from-black/60 via-black/40 to-black/60" })] })), !(layoutConfig?.sections?.productsHeader?.image || categoryHeaderImage) && (_jsxs("div", { className: "absolute top-0 left-0 w-full h-full overflow-hidden z-0 pointer-events-none", children: [_jsx("div", { className: "absolute top-[-10%] right-[-5%] w-[500px] h-[500px] bg-gray-100 rounded-full mix-blend-multiply filter blur-3xl opacity-70 animate-pulse-slow" }), _jsx("div", { className: "absolute bottom-[-10%] left-[-10%] w-[400px] h-[400px] bg-gray-50 rounded-full mix-blend-multiply filter blur-3xl opacity-70 animate-pulse-slow", style: { animationDelay: '2s' } })] })), _jsx("div", { className: `container mx-auto px-4 sm:px-6 lg:px-8 relative z-10 pt-12 pb-16 lg:pt-20 lg:pb-24 ${(layoutConfig?.sections?.productsHeader?.image || categoryHeaderImage) ? 'min-h-[500px] flex items-center' : ''}`, children: _jsx("div", { className: "flex flex-col items-center w-full max-w-4xl mx-auto", children: _jsxs("div", { className: `w-full text-center lg:text-left animate-fade-in-up ${(layoutConfig?.sections?.productsHeader?.image || categoryHeaderImage) ? 'text-white' : ''}`, children: [_jsx("div", { className: "flex justify-center lg:justify-start mb-6", children: _jsx("div", { className: (layoutConfig?.sections?.productsHeader?.image || categoryHeaderImage) ? 'bg-white/10 backdrop-blur-md px-4 py-2 rounded-full border border-white/20' : '', children: _jsx(Breadcrumbs, { items: breadcrumbItems, variant: (layoutConfig?.sections?.productsHeader?.image || categoryHeaderImage) ? 'light' : 'default' }) }) }), _jsx("h1", { className: `text-4xl sm:text-5xl lg:text-6xl font-bold tracking-tight mb-6 leading-[1.1] ${(layoutConfig?.sections?.productsHeader?.image || categoryHeaderImage) ? 'text-white' : 'text-gray-900'}`, children: layoutConfig?.sections?.productsHeader?.title || categoryHeaderTitle || (_jsxs(_Fragment, { children: ["Explore The Collections of ", _jsx("br", {}), _jsx("span", { className: "text-transparent bg-clip-text bg-gradient-to-r from-gray-900 via-gray-700 to-gray-900", children: storeConfig.name })] })) }), _jsx("div", { className: `text-lg mb-8 leading-relaxed max-w-lg mx-auto lg:mx-0 [&_p]:mb-3 [&_p:last-child]:mb-0 ${(layoutConfig?.sections?.productsHeader?.image || categoryHeaderImage) ? 'text-white/90' : 'text-gray-600'}`, children: _jsx(SafeRichHtml, { value: layoutConfig?.sections?.productsHeader?.description ||
324
317
  getLayoutText(storeConfig, 'category_header:description', "Don't miss out on shopping our latest collection! curated for quality and style. Experience the perfect blend of modern aesthetics and premium craftsmanship."), fallbackPlain: "Don't miss out on shopping our latest collection! curated for quality and style. Experience the perfect blend of modern aesthetics and premium craftsmanship." }) }), _jsxs("div", { className: "flex flex-col sm:flex-row gap-4 justify-center lg:justify-start", children: [(layoutConfig?.sections?.productsHeader?.primaryButtonText || primaryButtonText) && (layoutConfig?.sections?.productsHeader?.primaryButtonText || primaryButtonText).trim() !== '' && (_jsx(Button, { className: `h-12 px-8 rounded-full text-base font-medium shadow-lg hover:shadow-xl transition-all duration-300 transform hover:-translate-y-1 ${(layoutConfig?.sections?.productsHeader?.image || categoryHeaderImage) ? 'bg-white text-gray-900 hover:bg-gray-100' : ''}`, onClick: () => {
325
318
  const element = document.getElementById('product-grid');
326
319
  element?.scrollIntoView({ behavior: 'smooth' });
@@ -1 +1 @@
1
- {"version":3,"file":"ElectronicsHomePage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/electronics/components/ElectronicsHomePage.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAgB,MAAM,mBAAmB,CAAC;AAe9D,UAAU,wBAAwB;IAC/B,WAAW,EAAE,WAAW,CAAC;CAC3B;AAED,wBAAgB,mBAAmB,CAAC,EAAE,WAAW,EAAE,aAAa,EAAE,EAAE,wBAAwB,+BA8c3F"}
1
+ {"version":3,"file":"ElectronicsHomePage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/electronics/components/ElectronicsHomePage.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAgB,MAAM,mBAAmB,CAAC;AAgB9D,UAAU,wBAAwB;IAC/B,WAAW,EAAE,WAAW,CAAC;CAC3B;AAED,wBAAgB,mBAAmB,CAAC,EAAE,WAAW,EAAE,aAAa,EAAE,EAAE,wBAAwB,+BAgd3F"}
@@ -14,6 +14,7 @@ import { useToast } from '../../../components/ui/toast.js';
14
14
  import { formatCurrency, filterActiveProducts } from '../../../lib/utils/index.js';
15
15
  import { getLayoutText } from '../../../lib/utils/asset-helpers.js';
16
16
  import { PromoBanner } from '../../shared/components/PromoBanner';
17
+ import { SafeRichHtml } from '../../../components/rich-text/SafeRichHtml.js';
17
18
  export function ElectronicsHomePage({ storeConfig: initialConfig }) {
18
19
  const { store, addToCart } = useStore();
19
20
  const storeConfig = store || initialConfig;
@@ -91,7 +92,7 @@ export function ElectronicsHomePage({ storeConfig: initialConfig }) {
91
92
  return _jsx(Camera, { className: "h-6 w-6" });
92
93
  return _jsx(Zap, { className: "h-6 w-6" });
93
94
  };
94
- return (_jsxs("div", { className: "min-h-screen bg-slate-50 text-slate-900 font-sans selection:bg-blue-600 selection:text-white", children: [_jsx(ElectronicsStoreHeader, { storeConfig: storeConfig }), layout?.hero?.show !== false && (_jsxs("section", { "data-section": "hero", ref: targetRef, className: "relative min-h-screen flex items-center pt-20 overflow-hidden bg-slate-950", children: [_jsxs("div", { className: "absolute inset-0 overflow-hidden pointer-events-none", children: [_jsx("div", { className: "absolute top-[-10%] right-[-5%] w-[600px] h-[600px] bg-blue-600/20 rounded-full blur-[120px]" }), _jsx("div", { className: "absolute bottom-[-10%] left-[-5%] w-[500px] h-[500px] bg-indigo-600/20 rounded-full blur-[100px]" }), _jsx("div", { className: "absolute top-[20%] left-[20%] w-[300px] h-[300px] bg-cyan-500/10 rounded-full blur-[80px]" })] }), _jsx("div", { className: "container mx-auto px-6 relative z-10 py-20", children: _jsxs("div", { className: "grid lg:grid-cols-2 gap-16 items-center", children: [_jsxs(MotionDiv, { style: { opacity, scale }, className: "space-y-8 relative z-20", children: [layout?.hero?.showBadges !== false && (_jsxs("div", { className: "inline-flex items-center gap-2 px-4 py-1.5 rounded-full bg-slate-900/50 border border-slate-800 text-blue-400 text-xs font-bold uppercase tracking-wider backdrop-blur-md", children: [_jsx("span", { className: "w-2 h-2 rounded-full bg-blue-500 animate-pulse" }), layout?.sections?.hero?.badge || getLayoutText(storeConfig, 'electronics.newArrivals', 'Next Gen • 2025 Series')] })), _jsxs("h1", { className: "text-4xl sm:text-6xl md:text-7xl lg:text-8xl font-black tracking-tighter leading-[0.9] text-white", children: [layout?.sections?.hero?.title || getLayoutText(storeConfig, 'hero.title', 'Future Realized'), " ", _jsx("br", {}), _jsx("span", { className: "text-transparent bg-clip-text bg-gradient-to-r from-blue-400 via-indigo-400 to-cyan-400", children: "Realized." })] }), _jsx("div", { className: "lg:hidden w-full max-w-[300px] mx-auto py-8", children: _jsx("div", { className: "relative aspect-square bg-gradient-to-br from-slate-800/50 to-slate-900/50 rounded-3xl p-6 border border-slate-700/30", children: _jsx(ImageWithFallback, { src: products[0]?.images?.[0], alt: "Hero Product", className: "w-full h-full object-contain drop-shadow-2xl", skeletonAspectRatio: "square" }) }) }), _jsx("p", { className: "text-lg text-slate-400 max-w-xl leading-relaxed font-medium", children: layout?.sections?.hero?.subtitle || `${storeConfig.description} Experience the pinnacle of engineering with our curated collection of premium electronics.` }), _jsxs("div", { className: "flex flex-wrap items-center gap-4 pt-4", children: [layout?.hero?.showCTA !== false && (_jsx(Link, { href: `/${storeConfig.slug}/products`, children: _jsxs(Button, { className: "h-14 px-10 rounded-full bg-blue-600 hover:bg-blue-500 text-white font-bold text-lg transition-all hover:scale-105 shadow-[0_0_40px_-10px_rgba(59,130,246,0.5)] border-0 ring-0", children: [layout?.sections?.hero?.primaryCTA || getLayoutText(storeConfig, 'common.shopNow', 'Shop Now'), " ", _jsx(ArrowRight, { className: "ml-2 h-5 w-5" })] }) })), layout?.sections?.featuredProducts?.show !== false && (_jsxs("div", { className: "flex items-center gap-4 text-slate-400 text-sm font-medium ml-4", children: [_jsx("div", { className: "flex -space-x-3", children: [1, 2, 3].map(i => (_jsx("div", { className: "w-10 h-10 rounded-full border-2 border-slate-950 bg-slate-800 flex items-center justify-center text-xs text-white", children: _jsx("span", { className: "sr-only", children: "User" }) }, i))) }), _jsxs("div", { children: [_jsx("p", { className: "text-white font-bold", children: getLayoutText(storeConfig, 'common.account', '10k+ Happy') }), _jsx("p", { children: getLayoutText(storeConfig, 'common.account', 'Customers') })] })] }))] })] }), _jsx("div", { className: "relative h-[600px] hidden lg:block perspective-1000", children: _jsxs(MotionDiv, { initial: { opacity: 0, x: 100, rotateY: -20 }, animate: { opacity: 1, x: 0, rotateY: 0 }, transition: { duration: 1, ease: "easeOut" }, className: "relative z-10 w-full h-full", children: [_jsxs("div", { className: "absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[400px] h-[500px] bg-gradient-to-br from-slate-800/80 to-slate-900/80 backdrop-blur-xl rounded-[3rem] border border-slate-700/50 p-8 shadow-2xl shadow-blue-900/20 transform rotate-[-6deg] hover:rotate-0 transition-transform duration-700", children: [_jsx("div", { className: "absolute top-8 right-8", children: _jsx(Zap, { className: "text-blue-500 w-8 h-8" }) }), _jsx(ImageWithFallback, { src: products[0]?.images?.[0], alt: "Hero Product", className: "w-full h-3/4 object-contain drop-shadow-[0_20px_50px_rgba(0,0,0,0.5)]", skeletonAspectRatio: "square" }), _jsx("div", { className: "absolute bottom-8 left-8 right-8", children: _jsxs("div", { className: "flex justify-between items-end", children: [_jsxs("div", { children: [_jsx("p", { className: "text-blue-400 font-bold text-sm mb-1", children: "New Arrival" }), _jsx("h3", { className: "text-white text-2xl font-bold", children: products[0]?.name })] }), _jsx("div", { className: "text-right", children: _jsx("p", { className: "text-white text-2xl font-bold", children: formatCurrency(products[0]?.price || 0, products[0]?.currency || storeConfig?.settings?.currency || 'USD') }) })] }) })] }), _jsx(MotionDiv, { animate: { y: [0, -20, 0] }, transition: { repeat: Infinity, duration: 6, ease: "easeInOut" }, className: "absolute top-20 right-10 bg-white/10 backdrop-blur-md p-4 rounded-2xl border border-white/10", children: _jsxs("div", { className: "flex items-center gap-3", children: [_jsx("div", { className: "bg-green-500/20 p-2 rounded-lg", children: _jsx(Battery, { className: "text-green-400 w-5 h-5" }) }), _jsxs("div", { children: [_jsx("p", { className: "text-xs text-slate-400", children: "Battery Life" }), _jsx("p", { className: "text-sm font-bold text-white", children: "24 Hours" })] })] }) }), _jsx(MotionDiv, { animate: { y: [0, 20, 0] }, transition: { repeat: Infinity, duration: 5, ease: "easeInOut", delay: 1 }, className: "absolute bottom-40 left-0 bg-white/10 backdrop-blur-md p-4 rounded-2xl border border-white/10", children: _jsxs("div", { className: "flex items-center gap-3", children: [_jsx("div", { className: "bg-blue-500/20 p-2 rounded-lg", children: _jsx(Wifi, { className: "text-blue-400 w-5 h-5" }) }), _jsxs("div", { children: [_jsx("p", { className: "text-xs text-slate-400", children: "Connectivity" }), _jsx("p", { className: "text-sm font-bold text-white", children: "5G Ultra" })] })] }) })] }) })] }) })] })), layout?.sections?.brands?.show !== false && (_jsx("div", { "data-section": "brands", className: "bg-slate-950 border-y border-slate-900 overflow-hidden py-10", children: _jsx("div", { className: "flex gap-16 items-center animate-scroll whitespace-nowrap opacity-50 hover:opacity-100 transition-opacity duration-300", children: [...Array(2)].map((_, i) => (_jsx("div", { className: "flex gap-16 items-center", children: ['SONY', 'SAMSUNG', 'APPLE', 'DELL', 'LG', 'ASUS', 'HP', 'BOSE', 'CANON', 'NIKON'].map((brand) => (_jsx("span", { className: "text-3xl font-black text-slate-800 tracking-tight hover:text-slate-600 transition-colors cursor-default select-none", children: brand }, brand))) }, i))) }) })), layout?.sections?.categories?.show !== false && (_jsx("section", { "data-section": "categories", className: "py-16 md:py-32 bg-slate-50", children: _jsxs("div", { className: "container mx-auto px-6", children: [_jsxs("div", { className: "flex justify-between items-end mb-10 md:mb-16", children: [_jsxs("div", { children: [_jsx("h2", { className: "text-4xl font-bold mb-4 text-slate-900 tracking-tight", children: "Ecosystems" }), _jsx("p", { className: "text-lg text-slate-500", children: "Curated collections for every aspect of your digital life." })] }), layout?.sections?.categories?.showViewAll !== false && (_jsxs(Link, { href: `/${storeConfig.slug}/categories`, className: "flex items-center gap-2 text-blue-600 font-bold hover:gap-3 transition-all", children: ["View All ", _jsx(ArrowRight, { className: "h-5 w-5" })] }))] }), categories.length === 0 ? (_jsxs("div", { className: "text-center py-20 bg-white rounded-2xl border border-slate-200", children: [_jsx("h3", { className: "text-xl font-semibold text-slate-900 mb-2", children: "No categories available" }), _jsx("p", { className: "text-slate-500", children: "Categories will appear here once they are added to the store." })] })) : (_jsx("div", { className: "grid grid-cols-1 md:grid-cols-4 gap-6 auto-rows-[300px]", children: categories.slice(0, layout?.sections?.categories?.limit || 5).map((category, idx) => {
95
+ return (_jsxs("div", { className: "min-h-screen bg-slate-50 text-slate-900 font-sans selection:bg-blue-600 selection:text-white", children: [_jsx(ElectronicsStoreHeader, { storeConfig: storeConfig }), layout?.hero?.show !== false && (_jsxs("section", { "data-section": "hero", ref: targetRef, className: "relative min-h-screen flex items-center pt-20 overflow-hidden bg-slate-950", children: [_jsxs("div", { className: "absolute inset-0 overflow-hidden pointer-events-none", children: [_jsx("div", { className: "absolute top-[-10%] right-[-5%] w-[600px] h-[600px] bg-blue-600/20 rounded-full blur-[120px]" }), _jsx("div", { className: "absolute bottom-[-10%] left-[-5%] w-[500px] h-[500px] bg-indigo-600/20 rounded-full blur-[100px]" }), _jsx("div", { className: "absolute top-[20%] left-[20%] w-[300px] h-[300px] bg-cyan-500/10 rounded-full blur-[80px]" })] }), _jsx("div", { className: "container mx-auto px-6 relative z-10 py-20", children: _jsxs("div", { className: "grid lg:grid-cols-2 gap-16 items-center", children: [_jsxs(MotionDiv, { style: { opacity, scale }, className: "space-y-8 relative z-20", children: [layout?.hero?.showBadges !== false && (_jsxs("div", { className: "inline-flex items-center gap-2 px-4 py-1.5 rounded-full bg-slate-900/50 border border-slate-800 text-blue-400 text-xs font-bold uppercase tracking-wider backdrop-blur-md", children: [_jsx("span", { className: "w-2 h-2 rounded-full bg-blue-500 animate-pulse" }), layout?.sections?.hero?.badge || getLayoutText(storeConfig, 'electronics.newArrivals', 'Next Gen • 2025 Series')] })), _jsxs("h1", { className: "text-4xl sm:text-6xl md:text-7xl lg:text-8xl font-black tracking-tighter leading-[0.9] text-white", children: [layout?.sections?.hero?.title || getLayoutText(storeConfig, 'hero.title', 'Future Realized'), " ", _jsx("br", {}), _jsx("span", { className: "text-transparent bg-clip-text bg-gradient-to-r from-blue-400 via-indigo-400 to-cyan-400", children: "Realized." })] }), _jsx("div", { className: "lg:hidden w-full max-w-[300px] mx-auto py-8", children: _jsx("div", { className: "relative aspect-square bg-gradient-to-br from-slate-800/50 to-slate-900/50 rounded-3xl p-6 border border-slate-700/30", children: _jsx(ImageWithFallback, { src: products[0]?.images?.[0], alt: "Hero Product", className: "w-full h-full object-contain drop-shadow-2xl", skeletonAspectRatio: "square" }) }) }), _jsx(SafeRichHtml, { value: layout?.sections?.hero?.subtitle || `${storeConfig.description || ''} Experience the pinnacle of engineering with our curated collection of premium electronics.`, as: "div", className: "text-lg text-slate-400 max-w-xl leading-relaxed font-medium [&_p]:mb-0" }), _jsxs("div", { className: "flex flex-wrap items-center gap-4 pt-4", children: [layout?.hero?.showCTA !== false && (_jsx(Link, { href: `/${storeConfig.slug}/products`, children: _jsxs(Button, { className: "h-14 px-10 rounded-full bg-blue-600 hover:bg-blue-500 text-white font-bold text-lg transition-all hover:scale-105 shadow-[0_0_40px_-10px_rgba(59,130,246,0.5)] border-0 ring-0", children: [layout?.sections?.hero?.primaryCTA || getLayoutText(storeConfig, 'common.shopNow', 'Shop Now'), " ", _jsx(ArrowRight, { className: "ml-2 h-5 w-5" })] }) })), layout?.sections?.featuredProducts?.show !== false && (_jsxs("div", { className: "flex items-center gap-4 text-slate-400 text-sm font-medium ml-4", children: [_jsx("div", { className: "flex -space-x-3", children: [1, 2, 3].map(i => (_jsx("div", { className: "w-10 h-10 rounded-full border-2 border-slate-950 bg-slate-800 flex items-center justify-center text-xs text-white", children: _jsx("span", { className: "sr-only", children: "User" }) }, i))) }), _jsxs("div", { children: [_jsx("p", { className: "text-white font-bold", children: getLayoutText(storeConfig, 'common.account', '10k+ Happy') }), _jsx("p", { children: getLayoutText(storeConfig, 'common.account', 'Customers') })] })] }))] })] }), _jsx("div", { className: "relative h-[600px] hidden lg:block perspective-1000", children: _jsxs(MotionDiv, { initial: { opacity: 0, x: 100, rotateY: -20 }, animate: { opacity: 1, x: 0, rotateY: 0 }, transition: { duration: 1, ease: "easeOut" }, className: "relative z-10 w-full h-full", children: [_jsxs("div", { className: "absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[400px] h-[500px] bg-gradient-to-br from-slate-800/80 to-slate-900/80 backdrop-blur-xl rounded-[3rem] border border-slate-700/50 p-8 shadow-2xl shadow-blue-900/20 transform rotate-[-6deg] hover:rotate-0 transition-transform duration-700", children: [_jsx("div", { className: "absolute top-8 right-8", children: _jsx(Zap, { className: "text-blue-500 w-8 h-8" }) }), _jsx(ImageWithFallback, { src: products[0]?.images?.[0], alt: "Hero Product", className: "w-full h-3/4 object-contain drop-shadow-[0_20px_50px_rgba(0,0,0,0.5)]", skeletonAspectRatio: "square" }), _jsx("div", { className: "absolute bottom-8 left-8 right-8", children: _jsxs("div", { className: "flex justify-between items-end", children: [_jsxs("div", { children: [_jsx("p", { className: "text-blue-400 font-bold text-sm mb-1", children: "New Arrival" }), _jsx("h3", { className: "text-white text-2xl font-bold", children: products[0]?.name })] }), _jsx("div", { className: "text-right", children: _jsx("p", { className: "text-white text-2xl font-bold", children: formatCurrency(products[0]?.price || 0, products[0]?.currency || storeConfig?.settings?.currency || 'USD') }) })] }) })] }), _jsx(MotionDiv, { animate: { y: [0, -20, 0] }, transition: { repeat: Infinity, duration: 6, ease: "easeInOut" }, className: "absolute top-20 right-10 bg-white/10 backdrop-blur-md p-4 rounded-2xl border border-white/10", children: _jsxs("div", { className: "flex items-center gap-3", children: [_jsx("div", { className: "bg-green-500/20 p-2 rounded-lg", children: _jsx(Battery, { className: "text-green-400 w-5 h-5" }) }), _jsxs("div", { children: [_jsx("p", { className: "text-xs text-slate-400", children: "Battery Life" }), _jsx("p", { className: "text-sm font-bold text-white", children: "24 Hours" })] })] }) }), _jsx(MotionDiv, { animate: { y: [0, 20, 0] }, transition: { repeat: Infinity, duration: 5, ease: "easeInOut", delay: 1 }, className: "absolute bottom-40 left-0 bg-white/10 backdrop-blur-md p-4 rounded-2xl border border-white/10", children: _jsxs("div", { className: "flex items-center gap-3", children: [_jsx("div", { className: "bg-blue-500/20 p-2 rounded-lg", children: _jsx(Wifi, { className: "text-blue-400 w-5 h-5" }) }), _jsxs("div", { children: [_jsx("p", { className: "text-xs text-slate-400", children: "Connectivity" }), _jsx("p", { className: "text-sm font-bold text-white", children: "5G Ultra" })] })] }) })] }) })] }) })] })), layout?.sections?.brands?.show !== false && (_jsx("div", { "data-section": "brands", className: "bg-slate-950 border-y border-slate-900 overflow-hidden py-10", children: _jsx("div", { className: "flex gap-16 items-center animate-scroll whitespace-nowrap opacity-50 hover:opacity-100 transition-opacity duration-300", children: [...Array(2)].map((_, i) => (_jsx("div", { className: "flex gap-16 items-center", children: ['SONY', 'SAMSUNG', 'APPLE', 'DELL', 'LG', 'ASUS', 'HP', 'BOSE', 'CANON', 'NIKON'].map((brand) => (_jsx("span", { className: "text-3xl font-black text-slate-800 tracking-tight hover:text-slate-600 transition-colors cursor-default select-none", children: brand }, brand))) }, i))) }) })), layout?.sections?.categories?.show !== false && (_jsx("section", { "data-section": "categories", className: "py-16 md:py-32 bg-slate-50", children: _jsxs("div", { className: "container mx-auto px-6", children: [_jsxs("div", { className: "flex justify-between items-end mb-10 md:mb-16", children: [_jsxs("div", { children: [_jsx("h2", { className: "text-4xl font-bold mb-4 text-slate-900 tracking-tight", children: "Ecosystems" }), _jsx("p", { className: "text-lg text-slate-500", children: "Curated collections for every aspect of your digital life." })] }), layout?.sections?.categories?.showViewAll !== false && (_jsxs(Link, { href: `/${storeConfig.slug}/categories`, className: "flex items-center gap-2 text-blue-600 font-bold hover:gap-3 transition-all", children: ["View All ", _jsx(ArrowRight, { className: "h-5 w-5" })] }))] }), categories.length === 0 ? (_jsxs("div", { className: "text-center py-20 bg-white rounded-2xl border border-slate-200", children: [_jsx("h3", { className: "text-xl font-semibold text-slate-900 mb-2", children: "No categories available" }), _jsx("p", { className: "text-slate-500", children: "Categories will appear here once they are added to the store." })] })) : (_jsx("div", { className: "grid grid-cols-1 md:grid-cols-4 gap-6 auto-rows-[300px]", children: categories.slice(0, layout?.sections?.categories?.limit || 5).map((category, idx) => {
95
96
  const isLarge = idx === 0 || idx === 3;
96
97
  return (_jsxs(Link, { href: `/${storeConfig.slug}/categories/${category.slug}`, className: `group relative overflow-hidden rounded-[2.5rem] bg-white shadow-sm border border-slate-100 hover:shadow-2xl hover:shadow-blue-500/10 transition-all duration-500 ${isLarge ? 'md:col-span-2' : 'md:col-span-1'}`, children: [_jsx(ImageWithFallback, { src: category.image, alt: category.name, className: "absolute inset-0 w-full h-full object-cover transition-transform duration-700 group-hover:scale-105", skeletonAspectRatio: "auto" }), _jsx("div", { className: "absolute inset-0 bg-gradient-to-t from-slate-950/80 via-slate-950/20 to-transparent opacity-80 group-hover:opacity-90 transition-opacity" }), _jsxs("div", { className: "absolute bottom-0 left-0 p-8 w-full", children: [_jsx("div", { className: "mb-3 text-white/80 group-hover:text-blue-400 transition-colors", children: getCategoryIcon(category.slug) }), _jsx("h3", { className: `font-bold text-white mb-2 ${isLarge ? 'text-3xl' : 'text-xl'}`, children: category.name }), _jsx("div", { className: "w-10 h-1 bg-blue-500 rounded-full transform scale-x-0 group-hover:scale-x-100 transition-transform origin-left duration-300" })] })] }, idx));
97
98
  }) }))] }) })), layout?.sections?.featuredProducts?.show !== false && (_jsx("section", { "data-section": "featuredProducts", className: "py-16 md:py-32 bg-white relative overflow-hidden", children: _jsxs("div", { className: "container mx-auto px-6 relative z-10", children: [_jsxs("div", { className: "flex flex-col md:flex-row justify-between items-end mb-8 md:mb-12 gap-6", children: [_jsxs("div", { className: "max-w-2xl", children: [_jsx("span", { className: "text-blue-600 font-bold tracking-widest text-xs uppercase mb-3 block", children: "Latest Drops" }), _jsx("h2", { className: "text-4xl md:text-5xl font-bold text-slate-900 tracking-tight", children: layout?.sections?.featuredProducts?.title || "Performance Redefined" })] }), _jsxs("div", { className: "flex gap-2", children: [_jsx(Button, { variant: "outline", size: "icon", onClick: scrollLeft, className: "rounded-full border-slate-200 hover:bg-slate-100 hover:text-slate-900", children: _jsx(ArrowRight, { className: "h-5 w-5 rotate-180" }) }), _jsx(Button, { variant: "outline", size: "icon", onClick: scrollRight, className: "rounded-full border-slate-200 hover:bg-slate-100 hover:text-slate-900", children: _jsx(ArrowRight, { className: "h-5 w-5" }) })] })] }), _jsx("div", { ref: scrollContainerRef, className: "flex overflow-x-auto snap-x snap-mandatory gap-8 pb-12 -mx-6 px-6 scrollbar-hide", children: products.map((product) => (_jsxs("div", { className: "min-w-[280px] md:min-w-[320px] snap-center group", children: [_jsxs("div", { className: "relative aspect-[4/5] bg-slate-50 rounded-[2.5rem] overflow-hidden mb-6 border border-slate-100", children: [_jsx("div", { className: "absolute top-4 left-4 z-20", children: product.compareAtPrice != null && product.compareAtPrice > product.price && (_jsx("span", { className: "bg-slate-900 text-white text-[10px] font-bold px-3 py-1.5 rounded-full", children: "SALE" })) }), layout?.sections?.featuredProducts?.showAddToCart !== false && (_jsx("div", { className: "absolute top-4 right-4 z-20 opacity-0 group-hover:opacity-100 transition-opacity", children: _jsx(Button, { size: "icon", onClick: (e) => handleAddToCart(e, product), className: "rounded-full bg-white text-slate-900 hover:bg-blue-600 hover:text-white shadow-lg", children: _jsx(ShoppingCart, { className: "h-4 w-4" }) }) })), _jsx("div", { className: "absolute inset-0 flex items-center justify-center p-8 bg-gradient-to-br from-white to-slate-50", children: _jsx(ImageWithFallback, { src: product.images?.[0], alt: product.name, className: "w-full h-full object-contain group-hover:scale-110 transition-transform duration-500", skeletonAspectRatio: "square" }) })] }), _jsxs("div", { className: "space-y-1 px-2", children: [_jsx("h3", { className: "font-bold text-lg text-slate-900 truncate group-hover:text-blue-600 transition-colors", children: product.name }), _jsxs("div", { className: "flex items-baseline gap-2", children: [_jsx("span", { className: "text-slate-900 font-bold", children: formatCurrency(product.price, product.currency || 'USD') }), product.compareAtPrice != null && product.compareAtPrice > product.price && _jsx("span", { className: "text-slate-400 text-sm line-through", children: formatCurrency(product.compareAtPrice, product.currency || 'USD') })] })] }), _jsx(Link, { href: `/${storeConfig.slug}/products/${product.slug}`, className: "absolute inset-0 z-10" })] }, product.id))) })] }) })), layout?.features?.show !== false && (_jsxs("section", { "data-section": "features", className: "py-16 md:py-32 bg-slate-950 text-white relative overflow-hidden", children: [_jsx("div", { className: "absolute inset-0 bg-[linear-gradient(rgba(255,255,255,0.03)_1px,transparent_1px),linear-gradient(90deg,rgba(255,255,255,0.03)_1px,transparent_1px)] bg-[size:64px_64px] [mask-image:radial-gradient(ellipse_60%_60%_at_50%_50%,#000_70%,transparent_100%)]" }), _jsx("div", { className: "container mx-auto px-6 relative z-10", children: _jsx("div", { className: "grid md:grid-cols-3 gap-8 md:gap-12", children: [
@@ -1 +1 @@
1
- {"version":3,"file":"ElectronicsProductsPage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/electronics/components/ElectronicsProductsPage.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAgB,MAAM,mBAAmB,CAAC;AAsB9D,UAAU,4BAA4B;IACnC,WAAW,EAAE,WAAW,CAAC;CAC3B;AAwUD,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,4BAA4B,+BAM1E"}
1
+ {"version":3,"file":"ElectronicsProductsPage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/electronics/components/ElectronicsProductsPage.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAgB,MAAM,mBAAmB,CAAC;AA2B9D,UAAU,4BAA4B;IACnC,WAAW,EAAE,WAAW,CAAC;CAC3B;AAgVD,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,4BAA4B,+BAM1E"}
@@ -7,7 +7,8 @@ import { useStore } from '../../../lib/store-context.js';
7
7
  import { useToast } from '../../../components/ui/toast.js';
8
8
  import { Filter, ChevronDown, Search } from 'lucide-react';
9
9
  import { useSearchParams } from 'next/navigation';
10
- import { useState, useMemo, useEffect, useRef, Suspense } from 'react';
10
+ import { useState, useMemo, Suspense } from 'react';
11
+ import { useFilteredProductsFetch } from '../../../hooks/use-filtered-products-fetch.js';
11
12
  import { ElectronicsStoreHeader } from './ElectronicsStoreHeader';
12
13
  import { ElectronicsStoreFooter } from './ElectronicsStoreFooter';
13
14
  import { ElectronicsGridProductCard } from './ElectronicsGridProductCard';
@@ -18,7 +19,8 @@ import { buildCategoryTree, getAllCategoryIds, flattenCategoryTree } from '../..
18
19
  import { productService } from '../../../lib/services/product.service.js';
19
20
  import { transformProductToStoreProduct } from '../../../lib/store-config-utils.js';
20
21
  import { useCatalogPriceRange } from '../../../hooks/use-catalog-price-range.js';
21
- import { isWithinActivePriceRange } from '../../../lib/utils/catalog-price-bounds.js';
22
+ import { getApiPriceFilterActive, isWithinActivePriceRange } from '../../../lib/utils/catalog-price-bounds.js';
23
+ import { buildFilteredProductQuery, getFilteredProductQueryKey, } from '../../../lib/utils/filtered-product-query.js';
22
24
  import { ProductPriceFilterSection } from '../../shared/components/ProductPriceFilterSection';
23
25
  function ElectronicsProductsPageContent({ storeConfig }) {
24
26
  const searchParams = useSearchParams();
@@ -30,7 +32,9 @@ function ElectronicsProductsPageContent({ storeConfig }) {
30
32
  // Filter States
31
33
  const [selectedCategoryFilter, setSelectedCategoryFilter] = useState(categoryParam);
32
34
  const storeCurrency = storeConfig.settings?.currency || 'NGN';
33
- const { priceRange, setPriceRange, catalogBounds, resetPriceRange, hasActivePriceFilter, } = useCatalogPriceRange(products);
35
+ const bootstrapProducts = useMemo(() => filterActiveProducts(storeConfig.products || []), [storeConfig.products]);
36
+ const priceCatalogItems = bootstrapProducts.length > 0 ? bootstrapProducts : products;
37
+ const { priceRange, setPriceRange, catalogBounds, resetPriceRange, hasActivePriceFilter, } = useCatalogPriceRange(priceCatalogItems);
34
38
  const [sortBy, setSortBy] = useState('featured');
35
39
  const [visibleProducts, setVisibleProducts] = useState(12);
36
40
  const [isFilterOpen, setIsFilterOpen] = useState(false);
@@ -50,40 +54,45 @@ function ElectronicsProductsPageContent({ storeConfig }) {
50
54
  // Return all category IDs including children
51
55
  return getAllCategoryIds(selectedCategory);
52
56
  }, [selectedCategoryFilter, categoryTree]);
53
- const productQuery = useMemo(() => ({
54
- storeId: storeConfig.id,
55
- categoryIds: selectedCategoryIds.length ? selectedCategoryIds.join(',') : undefined,
56
- minPrice: priceRange[0] || undefined,
57
- maxPrice: priceRange[1] < catalogBounds.max ? priceRange[1] : undefined,
58
- sortBy: sortBy,
59
- }), [catalogBounds.max, priceRange, selectedCategoryIds, sortBy, storeConfig.id]);
60
- const skipBootstrapRefetch = useRef(true);
61
- useEffect(() => {
62
- let cancelled = false;
63
- const isDefaultQuery = !productQuery.categoryIds &&
64
- !productQuery.minPrice &&
65
- productQuery.maxPrice === undefined &&
66
- productQuery.sortBy === 'featured';
67
- if (skipBootstrapRefetch.current && isDefaultQuery && products.length > 0) {
68
- skipBootstrapRefetch.current = false;
69
- setTotalProducts(storeConfig.productsTotal || products.length);
70
- return;
71
- }
72
- skipBootstrapRefetch.current = false;
73
- setIsLoadingProducts(true);
74
- productService.getProducts({ ...productQuery, page: 1, limit: 12 })
75
- .then((response) => {
76
- if (cancelled)
77
- return;
78
- setProducts(response.data.map(transformProductToStoreProduct));
57
+ const hasApiPriceFilter = getApiPriceFilterActive(priceRange, bootstrapProducts);
58
+ const priceQueryMin = hasApiPriceFilter ? priceRange[0] : undefined;
59
+ const priceQueryMax = hasApiPriceFilter ? priceRange[1] : undefined;
60
+ const { productQueryParams, productQueryKey } = useMemo(() => {
61
+ const params = buildFilteredProductQuery({
62
+ storeId: storeConfig.id,
63
+ categories,
64
+ effectiveCategoryIds: selectedCategoryIds,
65
+ selectedCategoryFilter: null,
66
+ priceRange,
67
+ hasActivePriceFilter: hasApiPriceFilter,
68
+ sortBy: sortBy,
69
+ });
70
+ return {
71
+ productQueryParams: params,
72
+ productQueryKey: getFilteredProductQueryKey(params),
73
+ };
74
+ }, [
75
+ storeConfig.id,
76
+ categories,
77
+ selectedCategoryIds,
78
+ hasApiPriceFilter,
79
+ priceQueryMin,
80
+ priceQueryMax,
81
+ sortBy,
82
+ ]);
83
+ useFilteredProductsFetch(productQueryParams, productQueryKey, {
84
+ bootstrapItemCount: bootstrapProducts.length,
85
+ bootstrapTotal: storeConfig.productsTotal,
86
+ mapResponse: (data) => data.map(transformProductToStoreProduct),
87
+ applyResults: (items, total) => {
88
+ setProducts(items);
79
89
  setCurrentPage(1);
80
- setTotalProducts(response.meta.total);
90
+ setTotalProducts(total);
81
91
  setVisibleProducts(12);
82
- })
83
- .catch((error) => !cancelled && console.error('Failed to fetch products:', error))
84
- .finally(() => !cancelled && setIsLoadingProducts(false));
85
- return () => { cancelled = true; };
86
- }, [productQuery]);
92
+ },
93
+ setTotalProducts,
94
+ setLoading: setIsLoadingProducts,
95
+ });
87
96
  // Filter Logic
88
97
  const filteredAndSortedProducts = useMemo(() => {
89
98
  const result = products.filter(product => {
@@ -122,7 +131,7 @@ function ElectronicsProductsPageContent({ storeConfig }) {
122
131
  setIsLoadingProducts(true);
123
132
  try {
124
133
  const nextPage = currentPage + 1;
125
- const response = await productService.getProducts({ ...productQuery, page: nextPage, limit: 12 });
134
+ const response = await productService.getProducts({ ...productQueryParams, page: nextPage, limit: 12 });
126
135
  setProducts((current) => [...current, ...response.data.map(transformProductToStoreProduct)]);
127
136
  setCurrentPage(nextPage);
128
137
  setTotalProducts(response.meta.total);
@@ -1 +1 @@
1
- {"version":3,"file":"ElectronicsStoreFooter.d.ts","sourceRoot":"","sources":["../../../../src/layouts/electronics/components/ElectronicsStoreFooter.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAMhD,UAAU,2BAA2B;IACnC,WAAW,EAAE,WAAW,CAAC;CAC1B;AAED,wBAAgB,sBAAsB,CAAC,EAAE,WAAW,EAAE,EAAE,2BAA2B,+BA8GlF"}
1
+ {"version":3,"file":"ElectronicsStoreFooter.d.ts","sourceRoot":"","sources":["../../../../src/layouts/electronics/components/ElectronicsStoreFooter.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAOhD,UAAU,2BAA2B;IACnC,WAAW,EAAE,WAAW,CAAC;CAC1B;AAED,wBAAgB,sBAAsB,CAAC,EAAE,WAAW,EAAE,EAAE,2BAA2B,+BAgHlF"}
@@ -4,8 +4,9 @@ import Link from 'next/link';
4
4
  import { Zap, Facebook, Twitter, Instagram, Mail, MapPin, Phone } from 'lucide-react';
5
5
  import { getLayoutText, getThemeColor } from '../../../lib/utils/asset-helpers.js';
6
6
  import { getCurrentYear } from '../../../utils/date.js';
7
+ import { RichTextExcerpt } from '../../../components/rich-text/RichTextExcerpt.js';
7
8
  export function ElectronicsStoreFooter({ storeConfig }) {
8
9
  const bgDark = getThemeColor(storeConfig, 'background', 'dark', '#0F172A');
9
10
  const textSecondary = getThemeColor(storeConfig, 'text', 'secondary', '#CBD5E1');
10
- return (_jsx("footer", { className: "pt-20 pb-10", style: { backgroundColor: bgDark, color: textSecondary }, children: _jsxs("div", { className: "container mx-auto px-6", children: [_jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-12 mb-16", children: [_jsxs("div", { className: "space-y-6", children: [_jsxs("div", { className: "flex items-center gap-2.5", children: [_jsx("div", { className: "w-10 h-10 bg-blue-600 rounded-xl flex items-center justify-center shadow-lg shadow-blue-900/50", children: _jsx(Zap, { className: "h-5 w-5 text-white", fill: "currentColor" }) }), _jsx("span", { className: "font-black text-2xl tracking-tight text-white", children: storeConfig.name })] }), _jsx("p", { className: "text-slate-400 leading-relaxed", children: storeConfig.description || "Leading the future of technology with premium electronics and cutting-edge innovation." }), storeConfig.branding.socialMedia && (_jsxs("div", { className: "flex gap-4", children: [storeConfig.branding.socialMedia.facebook && (_jsx(Link, { href: storeConfig.branding.socialMedia.facebook, target: "_blank", rel: "noopener noreferrer", className: "rounded-full bg-slate-900 text-slate-400 hover:bg-blue-600 hover:text-white transition-all h-10 w-10 flex items-center justify-center", children: _jsx(Facebook, { className: "h-4 w-4" }) })), storeConfig.branding.socialMedia.twitter && (_jsx(Link, { href: storeConfig.branding.socialMedia.twitter, target: "_blank", rel: "noopener noreferrer", className: "rounded-full bg-slate-900 text-slate-400 hover:bg-blue-600 hover:text-white transition-all h-10 w-10 flex items-center justify-center", children: _jsx(Twitter, { className: "h-4 w-4" }) })), storeConfig.branding.socialMedia.instagram && (_jsx(Link, { href: storeConfig.branding.socialMedia.instagram, target: "_blank", rel: "noopener noreferrer", className: "rounded-full bg-slate-900 text-slate-400 hover:bg-blue-600 hover:text-white transition-all h-10 w-10 flex items-center justify-center", children: _jsx(Instagram, { className: "h-4 w-4" }) }))] }))] }), _jsxs("div", { children: [_jsx("h4", { className: "font-bold text-white mb-6", children: "Shop" }), _jsxs("ul", { className: "space-y-4 text-sm font-medium", children: [_jsx("li", { children: _jsx(Link, { href: `/${storeConfig.slug}/products`, className: "hover:text-blue-400 transition-colors", children: "All Products" }) }), _jsx("li", { children: _jsx(Link, { href: `/${storeConfig.slug}/products?sort=newest`, className: "hover:text-blue-400 transition-colors", children: getLayoutText(storeConfig, 'electronics.newArrivals', 'New Arrivals') }) }), _jsx("li", { children: _jsx(Link, { href: `/${storeConfig.slug}/categories`, className: "hover:text-blue-400 transition-colors", children: "Collections" }) }), _jsx("li", { children: _jsx(Link, { href: `/${storeConfig.slug}/products?sale=true`, className: "hover:text-blue-400 transition-colors", children: "Deals & Offers" }) })] })] }), _jsxs("div", { children: [_jsx("h4", { className: "font-bold text-white mb-6", children: "Support" }), _jsxs("ul", { className: "space-y-4 text-sm font-medium", children: [_jsx("li", { children: _jsx(Link, { href: `/${storeConfig.slug}/help-center`, className: "hover:text-blue-400 transition-colors", children: "Help Center" }) }), _jsx("li", { children: _jsx(Link, { href: `/${storeConfig.slug}/track-order`, className: "hover:text-blue-400 transition-colors", children: "Track Order" }) }), _jsx("li", { children: _jsx(Link, { href: `/${storeConfig.slug}/help-center`, className: "hover:text-blue-400 transition-colors", children: "Warranty Info" }) }), _jsx("li", { children: _jsx(Link, { href: `/${storeConfig.slug}/style-guide`, className: "hover:text-blue-400 transition-colors", children: "Style Guide" }) })] })] }), _jsxs("div", { children: [_jsx("h4", { className: "font-bold text-white mb-6", children: "Contact" }), _jsxs("ul", { className: "space-y-4 text-sm font-medium", children: [_jsxs("li", { className: "flex items-start gap-3", children: [_jsx(MapPin, { className: "h-5 w-5 text-blue-500 shrink-0" }), _jsx("span", { children: "123 Tech Avenue, Silicon Valley, CA 94025" })] }), _jsxs("li", { className: "flex items-center gap-3", children: [_jsx(Phone, { className: "h-5 w-5 text-blue-500 shrink-0" }), _jsx("span", { children: "+1 (555) 123-4567" })] }), _jsxs("li", { className: "flex items-center gap-3", children: [_jsx(Mail, { className: "h-5 w-5 text-blue-500 shrink-0" }), _jsxs("span", { children: ["support@", storeConfig.slug.replace(/-/g, ''), ".com"] })] })] })] })] }), _jsxs("div", { className: "pt-8 border-t border-slate-900 flex flex-col md:flex-row justify-between items-center gap-4 text-xs font-medium text-slate-500", children: [_jsxs("div", { className: "flex gap-6", children: [_jsx(Link, { href: `/${storeConfig.slug}/privacy`, className: "hover:text-white transition-colors", children: "Privacy Policy" }), _jsx(Link, { href: `/${storeConfig.slug}/terms`, className: "hover:text-white transition-colors", children: "Terms of Service" }), _jsx(Link, { href: `/${storeConfig.slug}/cookie-policy`, className: "hover:text-white transition-colors", children: "Cookie Policy" })] }), _jsx("div", { children: getLayoutText(storeConfig, 'footer.copyright', `© ${getCurrentYear()} ${storeConfig.name}. All rights reserved.`) })] })] }) }));
11
+ return (_jsx("footer", { className: "pt-20 pb-10", style: { backgroundColor: bgDark, color: textSecondary }, children: _jsxs("div", { className: "container mx-auto px-6", children: [_jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-12 mb-16", children: [_jsxs("div", { className: "space-y-6", children: [_jsxs("div", { className: "flex items-center gap-2.5", children: [_jsx("div", { className: "w-10 h-10 bg-blue-600 rounded-xl flex items-center justify-center shadow-lg shadow-blue-900/50", children: _jsx(Zap, { className: "h-5 w-5 text-white", fill: "currentColor" }) }), _jsx("span", { className: "font-black text-2xl tracking-tight text-white", children: storeConfig.name })] }), _jsx(RichTextExcerpt, { value: storeConfig.description || "Leading the future of technology with premium electronics and cutting-edge innovation.", as: "p", className: "text-slate-400 leading-relaxed" }), storeConfig.branding.socialMedia && (_jsxs("div", { className: "flex gap-4", children: [storeConfig.branding.socialMedia.facebook && (_jsx(Link, { href: storeConfig.branding.socialMedia.facebook, target: "_blank", rel: "noopener noreferrer", className: "rounded-full bg-slate-900 text-slate-400 hover:bg-blue-600 hover:text-white transition-all h-10 w-10 flex items-center justify-center", children: _jsx(Facebook, { className: "h-4 w-4" }) })), storeConfig.branding.socialMedia.twitter && (_jsx(Link, { href: storeConfig.branding.socialMedia.twitter, target: "_blank", rel: "noopener noreferrer", className: "rounded-full bg-slate-900 text-slate-400 hover:bg-blue-600 hover:text-white transition-all h-10 w-10 flex items-center justify-center", children: _jsx(Twitter, { className: "h-4 w-4" }) })), storeConfig.branding.socialMedia.instagram && (_jsx(Link, { href: storeConfig.branding.socialMedia.instagram, target: "_blank", rel: "noopener noreferrer", className: "rounded-full bg-slate-900 text-slate-400 hover:bg-blue-600 hover:text-white transition-all h-10 w-10 flex items-center justify-center", children: _jsx(Instagram, { className: "h-4 w-4" }) }))] }))] }), _jsxs("div", { children: [_jsx("h4", { className: "font-bold text-white mb-6", children: "Shop" }), _jsxs("ul", { className: "space-y-4 text-sm font-medium", children: [_jsx("li", { children: _jsx(Link, { href: `/${storeConfig.slug}/products`, className: "hover:text-blue-400 transition-colors", children: "All Products" }) }), _jsx("li", { children: _jsx(Link, { href: `/${storeConfig.slug}/products?sort=newest`, className: "hover:text-blue-400 transition-colors", children: getLayoutText(storeConfig, 'electronics.newArrivals', 'New Arrivals') }) }), _jsx("li", { children: _jsx(Link, { href: `/${storeConfig.slug}/categories`, className: "hover:text-blue-400 transition-colors", children: "Collections" }) }), _jsx("li", { children: _jsx(Link, { href: `/${storeConfig.slug}/products?sale=true`, className: "hover:text-blue-400 transition-colors", children: "Deals & Offers" }) })] })] }), _jsxs("div", { children: [_jsx("h4", { className: "font-bold text-white mb-6", children: "Support" }), _jsxs("ul", { className: "space-y-4 text-sm font-medium", children: [_jsx("li", { children: _jsx(Link, { href: `/${storeConfig.slug}/help-center`, className: "hover:text-blue-400 transition-colors", children: "Help Center" }) }), _jsx("li", { children: _jsx(Link, { href: `/${storeConfig.slug}/track-order`, className: "hover:text-blue-400 transition-colors", children: "Track Order" }) }), _jsx("li", { children: _jsx(Link, { href: `/${storeConfig.slug}/help-center`, className: "hover:text-blue-400 transition-colors", children: "Warranty Info" }) }), _jsx("li", { children: _jsx(Link, { href: `/${storeConfig.slug}/style-guide`, className: "hover:text-blue-400 transition-colors", children: "Style Guide" }) })] })] }), _jsxs("div", { children: [_jsx("h4", { className: "font-bold text-white mb-6", children: "Contact" }), _jsxs("ul", { className: "space-y-4 text-sm font-medium", children: [_jsxs("li", { className: "flex items-start gap-3", children: [_jsx(MapPin, { className: "h-5 w-5 text-blue-500 shrink-0" }), _jsx("span", { children: "123 Tech Avenue, Silicon Valley, CA 94025" })] }), _jsxs("li", { className: "flex items-center gap-3", children: [_jsx(Phone, { className: "h-5 w-5 text-blue-500 shrink-0" }), _jsx("span", { children: "+1 (555) 123-4567" })] }), _jsxs("li", { className: "flex items-center gap-3", children: [_jsx(Mail, { className: "h-5 w-5 text-blue-500 shrink-0" }), _jsxs("span", { children: ["support@", storeConfig.slug.replace(/-/g, ''), ".com"] })] })] })] })] }), _jsxs("div", { className: "pt-8 border-t border-slate-900 flex flex-col md:flex-row justify-between items-center gap-4 text-xs font-medium text-slate-500", children: [_jsxs("div", { className: "flex gap-6", children: [_jsx(Link, { href: `/${storeConfig.slug}/privacy`, className: "hover:text-white transition-colors", children: "Privacy Policy" }), _jsx(Link, { href: `/${storeConfig.slug}/terms`, className: "hover:text-white transition-colors", children: "Terms of Service" }), _jsx(Link, { href: `/${storeConfig.slug}/cookie-policy`, className: "hover:text-white transition-colors", children: "Cookie Policy" })] }), _jsx("div", { children: getLayoutText(storeConfig, 'footer.copyright', `© ${getCurrentYear()} ${storeConfig.name}. All rights reserved.`) })] })] }) }));
11
12
  }
@@ -1 +1 @@
1
- {"version":3,"file":"AboutPage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/electronics/pages/AboutPage.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAOhD,UAAU,cAAc;IACtB,WAAW,EAAE,WAAW,CAAC;CAC1B;AAED,wBAAgB,SAAS,CAAC,EAAE,WAAW,EAAE,aAAa,EAAE,EAAE,cAAc,+BA2OvE"}
1
+ {"version":3,"file":"AboutPage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/electronics/pages/AboutPage.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAShD,UAAU,cAAc;IACtB,WAAW,EAAE,WAAW,CAAC;CAC1B;AAED,wBAAgB,SAAS,CAAC,EAAE,WAAW,EAAE,aAAa,EAAE,EAAE,cAAc,+BA6OvE"}
@@ -5,6 +5,8 @@ import { Button } from '../../../components/ui/button.js';
5
5
  import { DotPattern } from '../../../components/ui/background-patterns.js';
6
6
  import { useStore } from '../../../lib/store-context.js';
7
7
  import Image from 'next/image';
8
+ import { SafeRichHtml } from '../../../components/rich-text/SafeRichHtml.js';
9
+ import { RichTextExcerpt } from '../../../components/rich-text/RichTextExcerpt.js';
8
10
  export function AboutPage({ storeConfig: initialConfig }) {
9
11
  const { store } = useStore();
10
12
  const storeConfig = store || initialConfig;
@@ -39,7 +41,7 @@ export function AboutPage({ storeConfig: initialConfig }) {
39
41
  description: "Promoting energy-efficient devices and responsible e-waste disposal."
40
42
  }
41
43
  ];
42
- return (_jsxs("div", { className: "min-h-screen bg-white pb-20 overflow-hidden", children: [_jsxs("section", { "data-section": "hero", className: "relative h-[60vh] min-h-[500px] w-full overflow-hidden", children: [_jsxs("div", { className: "absolute inset-0", children: [_jsx(Image, { src: heroImage, alt: "About Us", fill: true, className: "w-full h-full object-cover transform scale-105 animate-pulse-slow" }), _jsx("div", { className: "absolute inset-0 bg-gradient-to-r from-black/80 via-black/50 to-transparent" })] }), _jsx("div", { className: "absolute inset-0 flex items-center", children: _jsx("div", { className: "container mx-auto px-4 sm:px-6 lg:px-8", children: _jsxs("div", { className: "max-w-3xl animate-fade-in-up", children: [_jsxs("div", { className: "inline-flex items-center gap-2 px-4 py-1.5 rounded-full bg-white/10 backdrop-blur-md border border-white/20 text-white text-sm font-medium mb-6", children: [_jsx("span", { className: "w-2 h-2 rounded-full bg-white animate-pulse" }), "Est. 2024"] }), _jsx("h1", { className: "text-5xl md:text-7xl font-bold text-white mb-6 tracking-tight leading-tight", children: pageTitle }), _jsx("p", { className: "text-xl md:text-2xl text-gray-200 max-w-2xl leading-relaxed font-light", children: missionStatement || storeConfig.description })] }) }) })] }), _jsxs("section", { "data-section": "story", className: "py-24 px-4 sm:px-6 lg:px-8 relative", children: [_jsx("div", { className: "absolute top-0 right-0 -mt-24 -mr-24 w-96 h-96 bg-gray-50 rounded-full blur-3xl -z-10" }), _jsx("div", { className: "container mx-auto max-w-7xl", children: _jsxs("div", { className: "grid grid-cols-1 lg:grid-cols-2 gap-16 items-center", children: [_jsxs("div", { className: "relative", children: [galleryImages && galleryImages.length > 0 ? (_jsx("div", { className: "grid grid-cols-2 gap-4", children: galleryImages.slice(0, 4).map((img, i) => (_jsx("div", { className: `relative overflow-hidden rounded-2xl shadow-lg ${i === 0 ? 'col-span-2 aspect-[16/9]' : 'aspect-square'}`, children: _jsx(Image, { src: img.image, alt: img.caption || "Gallery Image", fill: true, className: "w-full h-full object-cover hover:scale-110 transition-transform duration-500" }) }, i))) })) : (_jsxs("div", { className: "relative aspect-[4/5] rounded-[2rem] overflow-hidden shadow-2xl", children: [_jsx(Image, { src: "https://images.unsplash.com/photo-1522202176988-66273c2fd55f?q=80&w=2071&auto=format&fit=crop", alt: "Our Team", fill: true, className: "w-full h-full object-cover" }), _jsx("div", { className: "absolute inset-0 bg-gradient-to-t from-black/60 via-transparent to-transparent opacity-60" }), _jsxs("div", { className: "absolute bottom-8 left-8 text-white", children: [_jsx("p", { className: "font-bold text-lg", children: "The Dream Team" }), _jsx("p", { className: "text-white/80 text-sm", children: "Working together to serve you better" })] })] })), _jsx("div", { className: "absolute -bottom-6 -right-6 w-24 h-24 bg-white rounded-2xl shadow-xl flex items-center justify-center p-4 animate-bounce duration-[3000ms]", children: _jsx(Heart, { className: "w-10 h-10", style: { color: primaryColor, fill: primaryColor } }) })] }), _jsxs("div", { className: "space-y-10", children: [_jsxs("div", { children: [_jsx("span", { className: "text-sm font-bold uppercase tracking-widest mb-3 block", style: { color: primaryColor }, children: "Who We Are" }), _jsx("h2", { className: "text-4xl md:text-5xl font-black text-gray-900 mb-6 tracking-tight", children: "Our Journey" }), _jsxs("div", { className: "prose prose-lg text-gray-600 leading-relaxed space-y-6", children: [pageContent?.split('\n').map((paragraph, idx) => (_jsx("p", { children: paragraph }, idx))), !pageContent && (_jsxs(_Fragment, { children: [_jsxs("p", { children: ["Founded with a bold vision to redefine excellence in the ", _jsx("span", { className: "font-semibold text-gray-900", children: storeConfig.type }), " industry, ", storeConfig.name, " has grown from a small passion project into a beloved brand. We believe in the power of quality, innovation, and community."] }), _jsx("p", { children: "Every day, we strive to bring you the best products, curated with care and delivered with a smile. Our team is dedicated to ensuring that your experience with us is nothing short of exceptional." })] }))] })] }), _jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-8", children: values.map((item, idx) => (_jsxs("div", { className: "flex gap-4 group", children: [_jsx("div", { className: "flex-shrink-0", children: _jsx("div", { className: "w-14 h-14 rounded-2xl flex items-center justify-center transition-colors group-hover:bg-gray-100", style: { backgroundColor: `${primaryColor}10` }, children: _jsx(item.icon, { className: "h-7 w-7 transition-transform group-hover:scale-110", style: { color: primaryColor } }) }) }), _jsxs("div", { children: [_jsx("h4", { className: "font-bold text-gray-900 mb-2 text-lg", children: item.title }), _jsx("p", { className: "text-gray-600 text-sm leading-relaxed", children: item.description })] })] }, idx))) })] })] }) })] }), _jsxs("section", { "data-section": "stats", className: "py-20 relative overflow-hidden", children: [_jsx("div", { className: "absolute inset-0 opacity-10", children: _jsx(DotPattern, { color: primaryColor, cx: 2, cy: 2, cr: 2, width: 30, height: 30 }) }), _jsx("div", { className: "absolute inset-0", style: { backgroundColor: `${secondaryColor}15` } }), _jsx("div", { className: "container mx-auto px-4 relative z-10", children: _jsx("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-8 md:gap-12", children: [
44
+ return (_jsxs("div", { className: "min-h-screen bg-white pb-20 overflow-hidden", children: [_jsxs("section", { "data-section": "hero", className: "relative h-[60vh] min-h-[500px] w-full overflow-hidden", children: [_jsxs("div", { className: "absolute inset-0", children: [_jsx(Image, { src: heroImage, alt: "About Us", fill: true, className: "w-full h-full object-cover transform scale-105 animate-pulse-slow" }), _jsx("div", { className: "absolute inset-0 bg-gradient-to-r from-black/80 via-black/50 to-transparent" })] }), _jsx("div", { className: "absolute inset-0 flex items-center", children: _jsx("div", { className: "container mx-auto px-4 sm:px-6 lg:px-8", children: _jsxs("div", { className: "max-w-3xl animate-fade-in-up", children: [_jsxs("div", { className: "inline-flex items-center gap-2 px-4 py-1.5 rounded-full bg-white/10 backdrop-blur-md border border-white/20 text-white text-sm font-medium mb-6", children: [_jsx("span", { className: "w-2 h-2 rounded-full bg-white animate-pulse" }), "Est. 2024"] }), _jsx("h1", { className: "text-5xl md:text-7xl font-bold text-white mb-6 tracking-tight leading-tight", children: pageTitle }), _jsx(SafeRichHtml, { value: missionStatement || storeConfig.description, as: "div", className: "text-xl md:text-2xl text-gray-200 max-w-2xl leading-relaxed font-light [&_p]:mb-0" })] }) }) })] }), _jsxs("section", { "data-section": "story", className: "py-24 px-4 sm:px-6 lg:px-8 relative", children: [_jsx("div", { className: "absolute top-0 right-0 -mt-24 -mr-24 w-96 h-96 bg-gray-50 rounded-full blur-3xl -z-10" }), _jsx("div", { className: "container mx-auto max-w-7xl", children: _jsxs("div", { className: "grid grid-cols-1 lg:grid-cols-2 gap-16 items-center", children: [_jsxs("div", { className: "relative", children: [galleryImages && galleryImages.length > 0 ? (_jsx("div", { className: "grid grid-cols-2 gap-4", children: galleryImages.slice(0, 4).map((img, i) => (_jsx("div", { className: `relative overflow-hidden rounded-2xl shadow-lg ${i === 0 ? 'col-span-2 aspect-[16/9]' : 'aspect-square'}`, children: _jsx(Image, { src: img.image, alt: img.caption || "Gallery Image", fill: true, className: "w-full h-full object-cover hover:scale-110 transition-transform duration-500" }) }, i))) })) : (_jsxs("div", { className: "relative aspect-[4/5] rounded-[2rem] overflow-hidden shadow-2xl", children: [_jsx(Image, { src: "https://images.unsplash.com/photo-1522202176988-66273c2fd55f?q=80&w=2071&auto=format&fit=crop", alt: "Our Team", fill: true, className: "w-full h-full object-cover" }), _jsx("div", { className: "absolute inset-0 bg-gradient-to-t from-black/60 via-transparent to-transparent opacity-60" }), _jsxs("div", { className: "absolute bottom-8 left-8 text-white", children: [_jsx("p", { className: "font-bold text-lg", children: "The Dream Team" }), _jsx("p", { className: "text-white/80 text-sm", children: "Working together to serve you better" })] })] })), _jsx("div", { className: "absolute -bottom-6 -right-6 w-24 h-24 bg-white rounded-2xl shadow-xl flex items-center justify-center p-4 animate-bounce duration-[3000ms]", children: _jsx(Heart, { className: "w-10 h-10", style: { color: primaryColor, fill: primaryColor } }) })] }), _jsxs("div", { className: "space-y-10", children: [_jsxs("div", { children: [_jsx("span", { className: "text-sm font-bold uppercase tracking-widest mb-3 block", style: { color: primaryColor }, children: "Who We Are" }), _jsx("h2", { className: "text-4xl md:text-5xl font-black text-gray-900 mb-6 tracking-tight", children: "Our Journey" }), _jsxs("div", { className: "prose prose-lg text-gray-600 leading-relaxed space-y-6", children: [pageContent?.split('\n').map((paragraph, idx) => (_jsx("p", { children: paragraph }, idx))), !pageContent && (_jsxs(_Fragment, { children: [_jsxs("p", { children: ["Founded with a bold vision to redefine excellence in the ", _jsx("span", { className: "font-semibold text-gray-900", children: storeConfig.type }), " industry, ", storeConfig.name, " has grown from a small passion project into a beloved brand. We believe in the power of quality, innovation, and community."] }), _jsx("p", { children: "Every day, we strive to bring you the best products, curated with care and delivered with a smile. Our team is dedicated to ensuring that your experience with us is nothing short of exceptional." })] }))] })] }), _jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-8", children: values.map((item, idx) => (_jsxs("div", { className: "flex gap-4 group", children: [_jsx("div", { className: "flex-shrink-0", children: _jsx("div", { className: "w-14 h-14 rounded-2xl flex items-center justify-center transition-colors group-hover:bg-gray-100", style: { backgroundColor: `${primaryColor}10` }, children: _jsx(item.icon, { className: "h-7 w-7 transition-transform group-hover:scale-110", style: { color: primaryColor } }) }) }), _jsxs("div", { children: [_jsx("h4", { className: "font-bold text-gray-900 mb-2 text-lg", children: item.title }), _jsx(RichTextExcerpt, { value: item.description, as: "p", className: "text-gray-600 text-sm leading-relaxed" })] })] }, idx))) })] })] }) })] }), _jsxs("section", { "data-section": "stats", className: "py-20 relative overflow-hidden", children: [_jsx("div", { className: "absolute inset-0 opacity-10", children: _jsx(DotPattern, { color: primaryColor, cx: 2, cy: 2, cr: 2, width: 30, height: 30 }) }), _jsx("div", { className: "absolute inset-0", style: { backgroundColor: `${secondaryColor}15` } }), _jsx("div", { className: "container mx-auto px-4 relative z-10", children: _jsx("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-8 md:gap-12", children: [
43
45
  { label: "Devices Sold", value: "50k+" },
44
46
  { label: "Products", value: storeConfig.products?.length ? `${storeConfig.products.length}+` : "100+" },
45
47
  { label: "Years in Tech", value: "12+" },
@@ -1,8 +1,10 @@
1
+ import { type CategoryProductsSeed } from '../../../hooks/use-category-products.js';
1
2
  import { StoreConfig } from '../../../lib/store-types.js';
2
3
  interface CategoryPageProps {
3
4
  storeConfig: StoreConfig;
4
5
  categorySlug: string;
6
+ categoryProductsSeed?: CategoryProductsSeed;
5
7
  }
6
- export declare function CategoryPage({ storeConfig, categorySlug }: CategoryPageProps): import("react").JSX.Element;
8
+ export declare function CategoryPage({ storeConfig, categorySlug, categoryProductsSeed }: CategoryPageProps): import("react").JSX.Element;
7
9
  export {};
8
10
  //# sourceMappingURL=CategoryPage.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CategoryPage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/electronics/pages/CategoryPage.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAA8B,MAAM,mBAAmB,CAAC;AAc5E,UAAU,iBAAiB;IACzB,WAAW,EAAE,WAAW,CAAC;IACzB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,wBAAgB,YAAY,CAAC,EAAE,WAAW,EAAE,YAAY,EAAE,EAAE,iBAAiB,+BAsH5E"}
1
+ {"version":3,"file":"CategoryPage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/electronics/pages/CategoryPage.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAuB,KAAK,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAE/F,OAAO,EAAE,WAAW,EAA8B,MAAM,mBAAmB,CAAC;AAe5E,UAAU,iBAAiB;IACzB,WAAW,EAAE,WAAW,CAAC;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;CAC7C;AAED,wBAAgB,YAAY,CAAC,EAAE,WAAW,EAAE,YAAY,EAAE,oBAAoB,EAAE,EAAE,iBAAiB,+BAwHlG"}
@@ -10,10 +10,11 @@ import { useToast } from '../../../components/ui/toast.js';
10
10
  import { useAnalytics } from '../../../hooks/use-analytics.js';
11
11
  import { useEffect } from 'react';
12
12
  import { ProductCard } from '../../../components/ui/product-card.js';
13
- export function CategoryPage({ storeConfig, categorySlug }) {
13
+ import { CategoryDescription } from '../../../components/rich-text/CategoryDescription.js';
14
+ export function CategoryPage({ storeConfig, categorySlug, categoryProductsSeed }) {
14
15
  const categories = storeConfig.categories || [];
15
16
  const category = categories.find(c => c.slug === categorySlug);
16
- const { products, isLoading, hasMore, loadMore } = useCategoryProducts(storeConfig.id, category?.id);
17
+ const { products, isLoading, hasMore, loadMore } = useCategoryProducts(storeConfig.id, category?.id, categoryProductsSeed);
17
18
  const { addToCart } = useStore();
18
19
  const { addToast } = useToast();
19
20
  const { trackEvent } = useAnalytics();
@@ -45,5 +46,5 @@ export function CategoryPage({ storeConfig, categorySlug }) {
45
46
  const isDarkTheme = storeConfig.type === 'food-modern' || storeConfig.branding.theme === 'dark';
46
47
  const bgColor = isDarkTheme ? 'bg-[#0F0F0F]' : 'bg-gray-50';
47
48
  const textColor = isDarkTheme ? 'text-white' : 'text-gray-900';
48
- return (_jsxs("div", { className: "min-h-screen bg-gray-50 text-gray-900 transition-colors duration-300", children: [_jsxs("div", { className: "relative h-[40vh] overflow-hidden", children: [_jsx(ImageWithFallback, { src: category.image, alt: category.name, className: "w-full h-full object-cover", skeletonAspectRatio: "16/9" }), _jsx("div", { className: "absolute inset-0 bg-black/40 backdrop-blur-[2px]" }), _jsxs("div", { className: "absolute inset-0 flex flex-col items-center justify-center text-center p-6 text-white", children: [_jsx("h1", { className: "text-5xl md:text-7xl font-bold tracking-tight mb-4", children: category.name }), category.description && (_jsx("p", { className: "text-lg md:text-xl max-w-2xl opacity-90 font-light", children: category.description }))] })] }), _jsxs("div", { className: "container mx-auto max-w-7xl px-4 sm:px-6 lg:px-8 py-12", children: [_jsxs("div", { className: "flex flex-col md:flex-row justify-between items-center mb-10 gap-4", children: [_jsxs(Link, { href: `/${storeConfig.slug}/categories`, className: "inline-flex items-center text-sm font-medium text-gray-600 hover:text-gray-900", children: [_jsx(ArrowLeft, { className: "h-4 w-4 mr-2" }), "Back to All Categories"] }), _jsx("div", { className: "flex items-center gap-4", children: _jsxs(Button, { variant: "outline", className: "bg-white", children: [_jsx(Filter, { className: "h-4 w-4 mr-2" }), " Filter"] }) })] }), !hasItems ? (_jsxs("div", { className: "text-center py-20 border border-dashed border-gray-300 rounded-3xl", children: [_jsx("p", { className: "text-gray-500 text-lg", children: "No products found in this category." }), _jsx(Button, { className: "mt-4", onClick: () => window.history.back(), children: "Go Back" })] })) : (_jsxs(_Fragment, { children: [_jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-8", children: products.map((product) => (_jsx(ProductCard, { product: product, storeSlug: storeConfig.slug, onAddToCart: handleAddToCart, onQuickView: handleQuickView }, product.id))) }), hasMore && (_jsx("div", { className: "mt-10 flex justify-center", children: _jsx(Button, { onClick: loadMore, disabled: isLoading, children: "Load more" }) }))] }))] })] }));
49
+ return (_jsxs("div", { className: "min-h-screen bg-gray-50 text-gray-900 transition-colors duration-300", children: [_jsxs("div", { className: "relative h-[40vh] overflow-hidden", children: [_jsx(ImageWithFallback, { src: category.image, alt: category.name, className: "w-full h-full object-cover", skeletonAspectRatio: "16/9" }), _jsx("div", { className: "absolute inset-0 bg-black/40 backdrop-blur-[2px]" }), _jsxs("div", { className: "absolute inset-0 flex flex-col items-center justify-center text-center p-6 text-white", children: [_jsx("h1", { className: "text-5xl md:text-7xl font-bold tracking-tight mb-4", children: category.name }), _jsx(CategoryDescription, { description: category.description })] })] }), _jsxs("div", { className: "container mx-auto max-w-7xl px-4 sm:px-6 lg:px-8 py-12", children: [_jsxs("div", { className: "flex flex-col md:flex-row justify-between items-center mb-10 gap-4", children: [_jsxs(Link, { href: `/${storeConfig.slug}/categories`, className: "inline-flex items-center text-sm font-medium text-gray-600 hover:text-gray-900", children: [_jsx(ArrowLeft, { className: "h-4 w-4 mr-2" }), "Back to All Categories"] }), _jsx("div", { className: "flex items-center gap-4", children: _jsxs(Button, { variant: "outline", className: "bg-white", children: [_jsx(Filter, { className: "h-4 w-4 mr-2" }), " Filter"] }) })] }), !hasItems ? (_jsxs("div", { className: "text-center py-20 border border-dashed border-gray-300 rounded-3xl", children: [_jsx("p", { className: "text-gray-500 text-lg", children: "No products found in this category." }), _jsx(Button, { className: "mt-4", onClick: () => window.history.back(), children: "Go Back" })] })) : (_jsxs(_Fragment, { children: [_jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-8", children: products.map((product) => (_jsx(ProductCard, { product: product, storeSlug: storeConfig.slug, onAddToCart: handleAddToCart, onQuickView: handleQuickView }, product.id))) }), hasMore && (_jsx("div", { className: "mt-10 flex justify-center", children: _jsx(Button, { onClick: loadMore, disabled: isLoading, children: "Load more" }) }))] }))] })] }));
49
50
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ProductDetailPage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/electronics/pages/ProductDetailPage.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAA8C,MAAM,mBAAmB,CAAC;AA4B5F,UAAU,sBAAsB;IAC9B,WAAW,EAAE,WAAW,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;CACrB;AAsHD,wBAAgB,iBAAiB,CAAC,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,EAAE,EAAE,sBAAsB,+BA2iCpG"}
1
+ {"version":3,"file":"ProductDetailPage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/electronics/pages/ProductDetailPage.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAA8C,MAAM,mBAAmB,CAAC;AA6B5F,UAAU,sBAAsB;IAC9B,WAAW,EAAE,WAAW,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;CACrB;AAsHD,wBAAgB,iBAAiB,CAAC,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,EAAE,EAAE,sBAAsB,+BA2iCpG"}