import React from 'react';
import {Meta, StoryFn} from '@storybook/react';
import {ICON_MAP} from '@components/Icon/constants';

import {TextInputProps, TextInput} from './index';

export default {
  title: 'Inputs/Text Input',
  component: TextInput,
  argTypes: {
    rightIcon: {control: 'select', options: Object.keys(ICON_MAP)},
    leftIcon: {control: 'select', options: Object.keys(ICON_MAP)},
  },
} as Meta;

const Template: StoryFn<TextInputProps> = args => <TextInput {...args} />;

export const CommonTextInput = Template.bind({});
CommonTextInput.args = {
  value: '',
  label: 'TextInput',
  editable: true,
  errorMessage: '',
  helperText: '',
  multiline: false,
};
