Skip to content

Commit 730681f

Browse files
committed
chore: update stories * 3
1 parent 8251ab2 commit 730681f

File tree

1 file changed

+12
-17
lines changed

1 file changed

+12
-17
lines changed

src/components/fields/FilterPicker/FilterPicker.stories.tsx

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -491,24 +491,19 @@ export const MultipleSelection: Story = {
491491
const trigger = canvas.getByRole('button');
492492
await userEvent.click(trigger);
493493
},
494-
render: (args) => (
495-
<FilterPicker {...args}>
496-
<FilterPicker.Section title="Fruits">
497-
{fruits.map((fruit) => (
498-
<FilterPicker.Item key={fruit.key} textValue={fruit.label}>
499-
{fruit.label}
500-
</FilterPicker.Item>
501-
))}
502-
</FilterPicker.Section>
503-
<FilterPicker.Section title="Vegetables">
504-
{vegetables.map((vegetable) => (
505-
<FilterPicker.Item key={vegetable.key} textValue={vegetable.label}>
506-
{vegetable.label}
494+
render: (args) => {
495+
const allItems = [...fruits, ...vegetables];
496+
497+
return (
498+
<FilterPicker<(typeof allItems)[number]> {...args} items={allItems}>
499+
{(item) => (
500+
<FilterPicker.Item key={item.key} textValue={item.label}>
501+
{item.label}
507502
</FilterPicker.Item>
508-
))}
509-
</FilterPicker.Section>
510-
</FilterPicker>
511-
),
503+
)}
504+
</FilterPicker>
505+
);
506+
},
512507
};
513508

514509
export const WithCheckboxes: Story = {

0 commit comments

Comments
 (0)