import React from 'react';
// eslint-disable-next-line import/no-extraneous-dependencies
import {
  Title,
  Description,
  Primary,
  PRIMARY_STORY,
  ArgsTable,
} from '@storybook/addon-docs/blocks';
import { singleToplistData } from 'gatsby-core-theme/tests/factories/modules/toplist.factory';

import Popup from '.';

export default {
  title: 'Theme/Organisms/Popup',
  component: Popup,
  argTypes: {
    module: {
      name: 'module',
      type: { name: 'object', required: true },
      defaultValue: '',
      description: 'Module object',
      table: {
        type: { summary: 'object' },
        defaultValue: { summary: '' },
      },
    },
  },
  parameters: {
    docs: {
      description: {
        component: 'A component that displays toplist Popup',
      },
      page: () => (
        <>
          <Title />
          <Description />
          <Primary />
          <ArgsTable story={PRIMARY_STORY} />
        </>
      ),
    },
  },
};

const Template = (args) => <Popup {...args} />;
export const Default = Template.bind({});
Default.args = {
  isStorybook: true,
  module: singleToplistData,
};
