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

import Bonus from '.';
import getPageData from '~tests/factories/pages/default.factory';

export default {
  title: 'Theme/Modules/Bonus/Template One',
  component: Bonus,
  argTypes: {
    operator: {
      name: 'operator',
      type: { name: 'object', required: false },
      defaultValue: '',
      description: 'The Operator data object.',
      table: {
        type: { summary: 'object' },
        defaultValue: { summary: '' },
      },
    },
    tncEnable: {
      name: 'TNC',
      type: { name: 'boolean', required: false },
      defaultValue: false,
      description: 'If tnc is enabel we show data for it, if is false we hide data',
      table: {
        type: { summary: 'boolean' },
        defaultValue: { summary: false },
      },
    },
    tncFixed: {
      name: 'TNC  Fixed',
      type: { name: 'boolean', required: false },
      defaultValue: false,
      description:
        'If tnxFix is an arg that help us to show the tnc data in the bottom of component and with scroll',
      table: {
        type: { summary: 'boolean' },
        defaultValue: { summary: false },
      },
    },
  },
  parameters: {
    docs: {
      description: {
        component: 'Generates a banner including the operator data.',
      },
      page: () => (
        <>
          <Title />
          <Description />
          <Primary />
          <ArgsTable story={PRIMARY_STORY} />
        </>
      ),
    },
  },
};

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

export const Default = Template.bind({});
Default.args = {
  tncEnable: true,
  tncFixed: false,
  operator: getPageData().relation,
};
