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 PopupCard from '.';

export default {
  title: 'Theme/Modules/Cards/Popup/Propup Card',
  component: PopupCard,
  argTypes: {
    item: {
      name: 'item',
      type: { name: 'object', required: true },
      defaultValue: '',
      description: 'item object',
      table: {
        type: { summary: 'object' },
        defaultValue: { summary: '' },
      },
    },
  },
  parameters: {
    docs: {
      description: {
        component: 'A component that displays a single Popup Card',
      },
      page: () => (
        <>
          <Title />
          <Description />
          <Primary />
          <ArgsTable story={PRIMARY_STORY} />
        </>
      ),
    },
  },
};

const Template = (args) => <PopupCard {...args} />;
export const Default = Template.bind({});
Default.args = {
  isStorybook: true,
  item: singleToplistData.items[0].items[0],
};
