/* eslint-disable import/no-extraneous-dependencies */
import React from 'react';
import {
  Title,
  Description,
  Primary,
  PRIMARY_STORY,
  ArgsTable,
} from '@storybook/addon-docs/blocks';

import Header from '.';
import getHeaderSection from '~tests/factories/sections/header.factory';

export default {
  title: 'Theme/Molecules/Header',
  component: Header,
  argTypes: {
    section: {
      name: 'section',
      type: { name: 'object', required: true },
      defaultValue: '',
      description: 'contains extra_fields values.',
      table: {
        type: { summary: 'object' },
        defaultValue: { summary: '' },
      },
    },
    content: {
      name: 'content',
      type: { name: 'element', required: false },
      defaultValue: '',
      description: 'Custom header content component.',
      table: {
        type: { summary: 'element | any' },
        defaultValue: { summary: '' },
      },
      control: {
        type: null,
      },
    },
    backgroundImage: {
      name: 'backgroundImage',
      type: { name: 'boolean', required: false },
      defaultValue: true,
      description: 'Show or hide the background image.',
      table: {
        type: { summary: 'boolean' },
        defaultValue: { summary: true },
      },
    },
  },
  parameters: {
    docs: {
      description: {
        component:
          'A component shown between the main and navigation component. Shows a background image with content on top. The header is page-specific, as opposed to market-specific sections coming from Hercules such as the footer or navigation. This means that each page can have a different header..',
      },
      page: () => (
        <>
          <Title />
          <Description />
          <Primary />
          <ArgsTable story={PRIMARY_STORY} />
        </>
      ),
    },
  },
};

const Template = (args) => <Header {...args} />;
const headerSection = getHeaderSection();
export const Default = Template.bind({});
Default.args = {
  section: headerSection,
  content: `Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, `,
};
