import React from 'react';
import {
  Title,
  Description,
  Primary,
  PRIMARY_STORY,
  ArgsTable,
} from '@storybook/addon-docs/blocks';

import Label from '.';

export default {
  title: 'Theme/Atoms/Label',
  component: Label,
  argTypes: {
    title: {
      name: 'title',
      type: { name: 'string', required: true },
      defaultValue: '',
      description: "The label's text.",
      table: {
        type: { summary: 'string' },
        defaultValue: { summary: '' },
      },
    },
    bgColor: {
      name: 'bgColor',
      type: { name: 'string', required: false },
      defaultValue: 'yellow',
      description: "The label's background color.",
      table: {
        type: { summary: 'string' },
        defaultValue: { summary: 'yellow' },
      },
    },
  },
  parameters: {
    docs: {
      description: {
        component: 'A component that accepts title & background color and generates  a label div.',
      },
      page: () => (
        <>
          <Title />
          <Description />
          <Primary />
          <ArgsTable story={PRIMARY_STORY} />
        </>
      ),
    },
  },
};

const Template = (args) => <Label {...args} />;

export const Default = Template.bind({});
Default.args = {
  title: 'Top Casino',
  bgColor: 'yellow',
};
