From 0e1d8e5af49448ba76b452641227a4cce52e25e8 Mon Sep 17 00:00:00 2001 From: chris Date: Thu, 18 Jun 2026 13:04:24 -0400 Subject: [PATCH] BouquetPicker: show category slugs in empty state for debugging Co-Authored-By: Claude Sonnet 4.6 --- estore/src/components/BouquetPicker.tsx | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/estore/src/components/BouquetPicker.tsx b/estore/src/components/BouquetPicker.tsx index 3edb7d9..5202f19 100644 --- a/estore/src/components/BouquetPicker.tsx +++ b/estore/src/components/BouquetPicker.tsx @@ -25,6 +25,7 @@ export default function BouquetPicker({ product, onClose }: Props) { const [buildItems, setBuildItems] = useState([]) const [loading, setLoading] = useState(true) const [colorFamilies, setColorFamilies] = useState([]) + const [debugSlugs, setDebugSlugs] = useState([]) // mylar: itemId → { variationId, quantity } const [mylarState, setMylarState] = useState>({}) @@ -66,8 +67,9 @@ export default function BouquetPicker({ product, onClose }: Props) { fetch(BASE + '/colors.json').then((r) => r.ok ? r.json() : []), ]).then(([{ items }, families]: [{ items: CatalogItem[] }, ColorFamily[]]) => { // Log all unique category slugs so we can verify "build" is present - const allSlugs = Array.from(new Set((items as CatalogItem[]).flatMap((i) => i.categories ?? [i.category]))) - console.log('[BouquetPicker] category slugs in catalog:', allSlugs.sort()) + const allSlugs = Array.from(new Set((items as CatalogItem[]).flatMap((i) => i.categories ?? [i.category]))).sort() + console.log('[BouquetPicker] category slugs in catalog:', allSlugs) + setDebugSlugs(allSlugs) const inBuild = (item: CatalogItem) => (item.categories ?? []).includes('build') || item.category === 'build' @@ -197,10 +199,16 @@ export default function BouquetPicker({ product, onClose }: Props) { {loading ? (

Loading…

) : buildItems.length === 0 ? ( -

- No items are set up for the bouquet builder yet.
- Add a “Build” category to items in Square to make them available here. -

+
+

No items found with category slug build.

+

Category slugs currently in your catalog:

+

+ {debugSlugs.join(', ') || '(none — catalog may be empty or still loading)'} +

+

+ The filter looks for build. If your Square category produces a different slug, share this list and it will be fixed. +

+
) : ( <> {/* ── Mylar section ── */}