From 2a7e23a91d909d6d73e0491686284aa62193a3d6 Mon Sep 17 00:00:00 2001 From: Vincent Smedinga Date: Fri, 28 Jun 2024 13:06:44 +0200 Subject: [PATCH] chore: Improve Tabs story (#1275) Co-authored-by: Ruben Sibon --- .../src/components/Tabs/Tabs.stories.tsx | 31 ++++++++++--------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/storybook/src/components/Tabs/Tabs.stories.tsx b/storybook/src/components/Tabs/Tabs.stories.tsx index 445be865c3..32b46227bd 100644 --- a/storybook/src/components/Tabs/Tabs.stories.tsx +++ b/storybook/src/components/Tabs/Tabs.stories.tsx @@ -22,14 +22,16 @@ const SlowPanel = ({ children }: PropsWithChildren) => { } type TabContent = { + id: number label: string body: ReactNode } const tabsContent: Array = [ - { label: 'Gegevens', body: exampleParagraph() }, - { label: 'Aanslagen', body: exampleParagraph() }, + { id: 0, label: 'Gegevens', body: exampleParagraph() }, + { id: 1, label: 'Aanslagen', body: exampleParagraph() }, { + id: 2, label: 'Documenten', body: ( <> @@ -38,26 +40,25 @@ const tabsContent: Array = [ ), }, - { label: 'Acties', body: exampleParagraph() }, + { id: 3, label: 'Acties', body: exampleParagraph() }, ] const defaultTabs = [ - {tabsContent.map((content, index) => ( - - {content.label} + {tabsContent.map(({ id, label }) => ( + + {label} ))} , - ...(() => - tabsContent.map((content, index) => ( - -
- {content.label} - {content.body} -
-
- )))(), + tabsContent.map(({ id, body, label }) => ( + +
+ {label} + {body} +
+
+ )), ] const meta = {