/* 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 TemplateOne from '.';

const pageData = getPageData();
pageData.featured_image_object = {
  alt: null,
  filename: '1673344017/456x343px.png',
  height: '343',
  title: '456x343px',
  url: 'https://assets-srv.s3.eu-west-1.amazonaws.com/1673344017/456x343px.png',
  width: '456',
};

export default {
  title: 'Theme/Layout/Header/Default/Template One',
  component: TemplateOne,
  argTypes: {
    title: {
      title: 'Title',
      type: { name: 'string', required: true },
      defaultValue: pageData.title,
      description: 'page title',
    },
    description: {
      name: 'Description',
      type: { name: 'string', required: true },
      defaultValue: pageData.description,
      description: 'page description',
    },
    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 One',
      },
      page: () => (
        <>
          <Title />
          <Description />
          <Primary />
          <ArgsTable story={PRIMARY_STORY} />
        </>
      ),
    },
  },
};

const Template = (args) => (
  <MainProvider
    value={{
      bannerIsActive: false,
      cookieAccepted: true,
      translations: {
        online_casino: 'Online Casino',
      },
    }}
  >
    <TemplateOne {...args} />
  </MainProvider>
);
export const Default = Template.bind({});
Default.args = {};
