import { Story, Meta } from '@storybook/react' import { Eth, Steth, Solana } from '@lidofinance/icons' import { InputGroup, Input, InputColor } from '@lidofinance/input' import { SelectProps } from './types' import Select from './Select' import SelectIcon from './SelectIcon' import Option from './Option' import { useRef, useState } from 'react' const getOptions = (enumObject: Record) => Object.values(enumObject).filter((value) => typeof value === 'string') export default { component: Select, title: 'Controls/Select', args: { disabled: false, fullwidth: false, }, argTypes: { onChange: { action: 'change', table: { disable: true }, }, }, } as Meta export const Basic: Story = (props) => ( ) export const Labeled: Story = (props) => ( ) const iconsMap = { eth: , steth: , sol: , } export const Icons: Story = (props) => { const [value, setValue] = useState('eth') return ( ) } export const OnlyIcon: Story = (props) => { const [value, setValue] = useState('eth') return ( setValue(value as keyof typeof iconsMap)} > ) } OnlyIcon.argTypes = { fullwidth: { table: { disable: true }, }, } export const WithInput: Story = (props) => { const { fullwidth, disabled, color } = props const [value, setValue] = useState('eth') const ref = useRef(null) return ( setValue(value as keyof typeof iconsMap)} > ) } WithInput.argTypes = { color: { options: getOptions(InputColor), control: 'inline-radio', }, } export const Small: Story = (props) => ( )