/* eslint-disable import/no-extraneous-dependencies */
import React from 'react';
import {
  Title,
  Description,
  Primary,
  PRIMARY_STORY,
  ArgsTable,
} from '@storybook/addon-docs/blocks';
import MainProvider from '~context/MainProvider';
import getPageData from '../../../../../../../tests/factories/pages/default.factory';
import TemplateTwo from '.';

const pageData = getPageData();
pageData.featured_image_object = {
  alt: null,
  filename: '1673351083/featured-image.png',
  height: '683',
  title: 'Featured image',
  url: 'https://assets-srv.s3.eu-west-1.amazonaws.com/1673351083/featured-image.png',
  width: '641',
};

export default {
  title: 'Theme/Layout/Header/Default/Template Two',
  component: TemplateTwo,
  argTypes: {
    extraFields: {
      name: 'Extra Fields',
      type: { name: 'object', required: true },
      defaultValue: pageData?.extra_fields,
      description: 'page link/CTA',
    },
    imageObj: {
      name: 'Featured image',
      type: { name: 'object', required: true },
      defaultValue: pageData?.featured_image_object,
      description: 'page featured image',
    },
  },
  parameters: {
    docs: {
      description: {
        component: 'A Default Header Component - Template two',
      },
      page: () => (
        <>
          <Title />
          <Description />
          <Primary />
          <ArgsTable story={PRIMARY_STORY} />
        </>
      ),
    },
  },
};

const Template = (args) => (
  <MainProvider
    value={{
      bannerIsActive: false,
      cookieAccepted: true,
      translations: {
        claim_reward: 'Claim Rewards',
        welcome_bonus: 'Welcome Bonus',
      },
    }}
  >
    <TemplateTwo {...args} />
  </MainProvider>
);
export const Default = Template.bind({});
Default.args = {};
