import React from 'react'; import { ComponentMeta, ComponentStory } from '@storybook/react'; import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from '@100mslive/react-icons'; import { Flex } from '../Layout'; import { Text } from '../Text'; import { Select } from './ReactSelect'; export default { title: 'UI Components/ReactSelect', component: Select.Root, } as ComponentMeta; const data: { [key: string]: { id: string; name: string }[]; } = { FRUITS: [ { id: 'apple', name: 'Apple' }, { id: 'banana', name: 'Banana' }, { id: 'blueberry', name: 'Blueberry' }, { id: 'grapes', name: 'Grapes' }, { id: 'pineapple', name: 'Pineapple' }, ], VEGETABLES: [ { id: 'aubergine', name: 'Aubergine' }, { id: 'broccoli', name: 'Broccoli' }, { id: 'carrot', name: 'Carrot' }, { id: 'courgette', name: 'Courgette' }, ], MEATS: [ { id: 'beef', name: 'Beef' }, { id: 'chicken', name: 'Chicken' }, { id: 'lamb', name: 'Lamb' }, { id: 'pork', name: 'Pork' }, ], }; const Template: ComponentStory = () => { return ( {Object.keys(data).map((item: string, index: number) => ( <> {item} {data[item].map((type: { id: string; name: string }) => ( {type?.name} ))} {index < Object.keys(data).length - 1 && } ))} ); }; export const WithGroup = Template.bind({}); WithGroup.storyName = 'ReactSelect';