/* eslint-disable react-hooks/rules-of-hooks */
import { useState } from 'react';
import SelectField from '.';
export default { title: 'InputField/Select' };
const options = [
{ id: 0, name: 'First Entity' },
{ id: 1, name: 'Second Entity' },
{ id: 2, name: 'Third Entity' }
];
export const withThreeOptions = (): JSX.Element => {
const [selectedOptionId, setSelectedOptionId] = useState(0);
const changeSelectedOption = (event): void => {
setSelectedOptionId(event.target.value);
};
return (
);
};
export const withError = (): JSX.Element => (
undefined}
options={[{ id: 0, name: 'Selected' }]}
selectedOptionId={0}
/>
);
export const compact = (): JSX.Element => (
undefined}
options={[{ id: 0, name: 'Tiny' }]}
selectedOptionId={0}
/>
);
export const openWithColors = (): JSX.Element => (
undefined}
open
options={[
{ color: 'red', id: 0, name: 'Red' },
{ color: 'yellow', id: 1, name: 'Yellow' }
]}
selectedOptionId={0}
/>
);
export const openWithHeader = (): JSX.Element => (
undefined}
open
options={[
{
id: 0,
name: 'Header',
type: 'header'
},
{ id: 1, name: 'Item' }
]}
selectedOptionId={0}
/>
);