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

import Sitemap from '.';

export default {
  title: 'Theme/Atoms/Sitemap',
  component: Sitemap,
  argTypes: {
    // pageContext: {
    //   name: 'sitemapData',
    //   type: { name: 'object', required: true },
    //   defaultValue: null,
    //   description: 'Object containing all links grouped by page type.',
    //   table: {
    //     type: { summary: 'object' },
    //     defaultValue: { summary: null },
    //   },
    // },
  },
  parameters: {
    docs: {
      description: {
        component: 'An HTML sitemap showing all pages as links',
      },
      page: () => (
        <>
          <Title />
          <Description />
          <Primary />
          <ArgsTable story={PRIMARY_STORY} />
        </>
      ),
    },
  },
};

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

export const Default = Template.bind({});
Default.args = {
  pageContext: {
    sitemapData: {
      ie_en: {
        1: [
          {
            title: 'test one',
            path: '/test_one',
          },
          {
            title: 'test two',
            path: '/test_two',
          },
          {
            title: 'test three',
            path: '/test_three',
          },
        ],
        2: [
          {
            title: 'template page one',
            path: '/template_page_one',
          },
          {
            title: 'template page two',
            path: '/template_page_two',
          },
        ],
        3: [
          {
            title: 'template two page',
            path: 'template_teo_page',
          },
        ],
      },
    },
    templates: {
      1: {
        short_name: 'template one',
      },
      2: {
        short_name: 'template two',
      },
      3: {
        short_name: 'template three',
      },
    },
  },
};
