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

import getPageData from 'gatsby-core-theme/tests/factories/pages/default.factory';
import GameIframe from '.';

export default {
  title: 'Theme/Molecules/Game Iframe',
  component: GameIframe,
  argTypes: {
    page: {
      name: 'page',
      type: { name: 'object', required: true },
      defaultValue: null,
      description: 'The page object.',
      table: {
        type: { summary: 'object' },
        defaultValue: { summary: null },
      },
    },
  },
  parameters: {
    docs: {
      description: {
        component: 'Generates the game iframe',
      },
      page: () => (
        <>
          <Title />
          <Description />
          <Primary />
          <ArgsTable story={PRIMARY_STORY} />
        </>
      ),
    },
  },
};

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

export const Default = Template.bind({});
Default.args = {
  page: getPageData(),
};
