import React from 'react';
import { Meta, Story } from '@storybook/react';
import { AtomTag, ITagProps } from 'native/atoms/Tag';
import { theme } from 'data/dataMx';

const meta: Meta = {
  title: 'React Native/atoms/Tag',
  component: AtomTag,
  argTypes: {
    backgroundColor: {
      control: {
        type: 'select'
      },
      options: Object.keys(theme),
    },
    textColor: {
      control: {
        type: 'select'
      },
      options: Object.keys(theme),
    }
  },
  parameters: {
    controls: { expanded: true },
  },
};

export default meta;

const TemplateTag: Story<ITagProps> = (props) => <AtomTag {...props} />;

// By passing using the Args format for exported stories, you can control the props for a component for reuse in a test
// https://storybook.js.org/docs/react/workflows/unit-testing
export const Tag = TemplateTag.bind({});

Tag.args = {
  backgroundColor: 'secondary100',
  iconLeft: 'diamond',
  iconRight: 'diamond',
  text: 'Label',
  textColor: 'neutral100',
  size: 'small',
  displayIconLeft: false,
  displayIconRight: false,
};
