import { ComponentMeta, ComponentStory } from "@storybook/react"; import { Page } from "components/Page"; import { useEffect, useState } from "react"; import InputMultiSelect from "./InputMultiSelect"; export default { title: 'Inputs/InputMultiSelect', component: InputMultiSelect, parameters: { actions: { argTypesRegex: '^on.*' } }, } as ComponentMeta; const Template: ComponentStory = args => { const [value, setValue] = useState(args.selected) useEffect(() => { setValue(args.selected); }, [args.selected]) return { setValue(a); args.onChange(a); }} options={args.options} selected={value} /> } export const Simple = Template.bind({}) Simple.args = { label: "Room Tags", options: [ "Bears", "Cats", "Kitchen", "Bathroom", ], selected: [1], }