diff --git a/frontend/src/pages/TripChecklist.tsx b/frontend/src/pages/TripChecklist.tsx index fe05d8f..9e22b95 100644 --- a/frontend/src/pages/TripChecklist.tsx +++ b/frontend/src/pages/TripChecklist.tsx @@ -91,6 +91,22 @@ export default function TripChecklist({ trips }: { trips: any[] }) { // Gruppiere Items nach Kategorie (item.tag) const itemsWithoutTag = items.filter((item) => !item.tag); + + // Split items into "slash" category items and normal items + const slashCategoryMap: Record = {}; + const normalItemsWithoutTag: any[] = []; + + itemsWithoutTag.forEach((item) => { + const name = item.name_calculated || ""; + if (name.includes("/")) { + const [cat, sub] = name.split("/", 2); + if (!slashCategoryMap[cat]) slashCategoryMap[cat] = []; + slashCategoryMap[cat].push({ ...item, _sub: sub }); + } else { + normalItemsWithoutTag.push(item); + } + }); + // Map: tagId -> { tag, items: [...] } const itemsByTag: Record = {}; items @@ -203,8 +219,8 @@ export default function TripChecklist({ trips }: { trips: any[] }) { {/* ...Rest der Checklist... */} );