import React from 'react';
import {Meta, StoryFn} from '@storybook/react';

import SelectInput, {SelectInputProps, SelectOption} from './index';

const meta: Meta<typeof SelectInput> = {
  title: 'Inputs/Select Input',
  component: SelectInput,
};

const Template: StoryFn<SelectInputProps> = args => <SelectInput {...args} />;

const options: SelectOption[] = [
  {id: 1, name: 'Data one'},
  {id: 2, name: 'Data two'},
  {id: 3, name: 'Data three'},
  {id: 4, name: 'Data four'},
  {id: 5, name: 'Data five'},
  {id: 6, name: 'Data six'},
];

export const Select = Template.bind({});
Select.args = {
  value: 1,
  placeholder: 'Select input placeholder',
  label: 'Select input label',
  errorMessage: '',
  helperText: '',
  isLoading: false,
  disabled: false,
  options,
};

export default meta;
