\n {active.label}\n \n Contribution snapshot across current inventory value. Segment selection changes the inspected group without moving the card.\n \n
\n
\n );\n}\n\n/* content shape for one insight page in the carousel */\nexport type InsightPage = {\n key: string;\n prose: React.ReactNode;\n Card: React.ComponentType;\n pill: string;\n};\n\nconst PAGES: InsightPage[] = [\n {\n key: \"compare\",\n prose: (\n <>\n The worst performer in your is\n Rocky Road — down -6% or -$2,453.44.\n >\n ),\n Card: CompareCard,\n pill: \"Should I rebalance flavors?\",\n },\n {\n key: \"anomaly\",\n prose: (\n <>\n Unusually high freezer bill on Dec 13 —{\" \"}\n +$1,834.66 above your average.\n >\n ),\n Card: AnomalyCard,\n pill: \"Get tips on cutting freezer costs\",\n },\n {\n key: \"allocation\",\n prose: (\n <>\n You’re heavily invested in — it’s{\" \"}\n 72.5% of your case.\n >\n ),\n Card: AllocationCard,\n pill: \"If we look at seasonals, what changes?\",\n },\n];\n\nexport type InsightCardsLabels = {\n /** carousel heading shown before the page count */\n title: string;\n};\n\nconst DEFAULT_INSIGHT_LABELS: InsightCardsLabels = {\n title: \"Insights\",\n};\n\nexport default function InsightCards({\n pages = PAGES,\n labels,\n}: {\n variant?: string;\n pages?: InsightPage[];\n labels?: Partial;\n} = {}) {\n const l = { ...DEFAULT_INSIGHT_LABELS, ...labels };\n const [page, setPage] = useState(0);\n\n const move = (direction: -1 | 1) => {\n setPage((current) => (current + direction + pages.length) % pages.length);\n };\n\n const { prose, Card, pill } = pages[page];\n\n return (\n