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

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

export default {
  title: 'Theme/Molecules/Bonus box/Template Three',
  component: BonusBox,
  args: {
    translations: {
      bonus_info: 'It only takes 2 minutes!',
      gratis_spins: 'Gratis-Spins:',
    },
    item: {
      name: 'operator',
      type: { name: 'object', required: false },
      description: 'The Operator data object.',
      table: {
        type: { summary: 'object' },
        defaultValue: { summary: '' },
      },
    },
  },
  parameters: {
    docs: {
      description: {
        component: 'Generates a banner including the operator data.',
      },
      page: () => (
        <>
          <Title />
          <Description />
          <Primary />
          <ArgsTable story={PRIMARY_STORY} />
        </>
      ),
    },
  },
};

const Template = (args) => (
  <MainProvider
    value={{
      translations: args?.translations,
    }}
  >
    <BonusBox {...args} />
  </MainProvider>
);

export const Default = Template.bind({});
Default.args = {
  ctaBtn: true,
  welcomeBonus: true,
  item: getPageData().relation,
  showVariablesComponent: true,
};
