import { ComponentMeta, ComponentStory } from '@storybook/react';
import Components from '../components';
import { ITenantOption, IUserOption } from '../types';

export default {
  title: 'Forms/Global Search/Options',
  component: Components.Option,
  args: {
    state: {
      inputValue: '',
      selected: false
    },
    option: {
      label: 'Option label'
    },
    componentType: 'Default'
  }
} as ComponentMeta<typeof Components.Option>;

const Template: ComponentStory<typeof Components.Option> = args => <Components.Option {...args} />;

export const DefaultOption = Template.bind({});

export const UserOption = Template.bind({});
UserOption.args = {
  componentType: 'User',
  option: {
    label: 'User Name',
    email: 'username@example.com'
  } as IUserOption
};

export const TenantOption = Template.bind({});
TenantOption.args = {
  componentType: 'Tenant',
  option: {
    label: 'Tenant',
    subtitle: 'Tenant name'
  } as ITenantOption
};
