@digilogiclabs/saas-factory-ui 0.15.3 → 0.15.4

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.
package/dist/index.js CHANGED
@@ -8398,13 +8398,14 @@ var SearchWithFilters = ({
8398
8398
  ).slice(0, 8);
8399
8399
  }, [suggestions, localQuery]);
8400
8400
  const activeFiltersCount = (0, import_react14.useMemo)(() => {
8401
+ if (!filters) return 0;
8401
8402
  let count = 0;
8402
- if (filters.category !== "all") count++;
8403
- if (filters.sortBy !== "relevance") count++;
8404
- if (filters.duration !== "any") count++;
8405
- if (filters.dateRange !== "any") count++;
8406
- if (filters.genres?.length > 0) count++;
8407
- if (filters.tags?.length > 0) count++;
8403
+ if (filters.category && filters.category !== "all") count++;
8404
+ if (filters.sortBy && filters.sortBy !== "relevance") count++;
8405
+ if (filters.duration && filters.duration !== "any") count++;
8406
+ if (filters.dateRange && filters.dateRange !== "any") count++;
8407
+ if (filters.genres && filters.genres.length > 0) count++;
8408
+ if (filters.tags && filters.tags.length > 0) count++;
8408
8409
  if (filters.verified) count++;
8409
8410
  if (filters.downloadable) count++;
8410
8411
  if (filters.hasLyrics) count++;
@@ -8592,7 +8593,7 @@ var SearchWithFilters = ({
8592
8593
  onClick: () => handleFilterChange("category", option.id),
8593
8594
  className: cn(
8594
8595
  "p-3 rounded-lg border text-sm font-medium transition-colors flex items-center gap-2",
8595
- filters.category === option.id ? "border-primary bg-primary/10 text-primary" : "border-border hover:border-muted-foreground"
8596
+ filters?.category === option.id ? "border-primary bg-primary/10 text-primary" : "border-border hover:border-muted-foreground"
8596
8597
  ),
8597
8598
  children: [
8598
8599
  /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(option.icon, { className: "w-4 h-4" }),
@@ -8629,7 +8630,7 @@ var SearchWithFilters = ({
8629
8630
  onClick: () => handleFilterChange("sortBy", option.id),
8630
8631
  className: cn(
8631
8632
  "p-3 rounded-lg border text-sm font-medium transition-colors flex items-center gap-2",
8632
- filters.sortBy === option.id ? "border-primary bg-primary/10 text-primary" : "border-border hover:border-muted-foreground"
8633
+ filters?.sortBy === option.id ? "border-primary bg-primary/10 text-primary" : "border-border hover:border-muted-foreground"
8633
8634
  ),
8634
8635
  children: [
8635
8636
  /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(option.icon, { className: "w-4 h-4" }),
@@ -8667,7 +8668,7 @@ var SearchWithFilters = ({
8667
8668
  type: "radio",
8668
8669
  name: "duration",
8669
8670
  value: option.id,
8670
- checked: filters.duration === option.id,
8671
+ checked: filters?.duration === option.id,
8671
8672
  onChange: () => handleFilterChange("duration", option.id),
8672
8673
  className: "text-primary focus:ring-primary"
8673
8674
  }
@@ -8700,12 +8701,13 @@ var SearchWithFilters = ({
8700
8701
  "button",
8701
8702
  {
8702
8703
  onClick: () => {
8703
- const newGenres = filters.genres.includes(genre) ? filters.genres.filter((g) => g !== genre) : [...filters.genres, genre];
8704
+ const currentGenres = filters?.genres || [];
8705
+ const newGenres = currentGenres.includes(genre) ? currentGenres.filter((g) => g !== genre) : [...currentGenres, genre];
8704
8706
  handleFilterChange("genres", newGenres);
8705
8707
  },
8706
8708
  className: cn(
8707
8709
  "px-3 py-1 rounded-full text-xs font-medium transition-colors",
8708
- filters.genres.includes(genre) ? "bg-primary text-primary-foreground" : "bg-muted text-muted-foreground hover:bg-muted-foreground hover:text-background"
8710
+ (filters?.genres || []).includes(genre) ? "bg-primary text-primary-foreground" : "bg-muted text-muted-foreground hover:bg-muted-foreground hover:text-background"
8709
8711
  ),
8710
8712
  children: genre
8711
8713
  },
@@ -8722,7 +8724,7 @@ var SearchWithFilters = ({
8722
8724
  "input",
8723
8725
  {
8724
8726
  type: "checkbox",
8725
- checked: filters.verified || false,
8727
+ checked: filters?.verified || false,
8726
8728
  onChange: (e) => handleFilterChange("verified", e.target.checked),
8727
8729
  className: "text-primary focus:ring-primary"
8728
8730
  }
@@ -8734,7 +8736,7 @@ var SearchWithFilters = ({
8734
8736
  "input",
8735
8737
  {
8736
8738
  type: "checkbox",
8737
- checked: filters.downloadable || false,
8739
+ checked: filters?.downloadable || false,
8738
8740
  onChange: (e) => handleFilterChange("downloadable", e.target.checked),
8739
8741
  className: "text-primary focus:ring-primary"
8740
8742
  }
@@ -8746,7 +8748,7 @@ var SearchWithFilters = ({
8746
8748
  "input",
8747
8749
  {
8748
8750
  type: "checkbox",
8749
- checked: filters.hasLyrics || false,
8751
+ checked: filters?.hasLyrics || false,
8750
8752
  onChange: (e) => handleFilterChange("hasLyrics", e.target.checked),
8751
8753
  className: "text-primary focus:ring-primary"
8752
8754
  }