import React from 'react';
import {
  Title,
  Description,
  Primary,
  PRIMARY_STORY,
  ArgsTable,
} from '@storybook/addon-docs/blocks';

import Content from '../index';
import { contentTableOne } from '~tests/factories/modules/content.factory';

export default {
  title: 'Theme/Modules/Content/Template One',
  component: Content,
  argTypes: {
    module: {
      name: 'module',
      type: { name: 'object', required: false },
      defaultValue: null,
      description: 'The module data object',
      table: {
        type: { summary: 'object' },
        defaultValue: { summary: '' },
      },
    },
    style: {
      name: 'style',
      type: { name: 'string', required: false },
      defaultValue: 'template_one', // Set a default style here if desired
      description: 'The style for the Content component',
      control: {
        type: 'select',
        options: ['template_one', 'template_two', 'template_three'], // Add your
      },
    },
  },
  parameters: {
    docs: {
      description: {
        component:
          'The content component displays content received from Hercules and replaces all images within the data with the lazy image component.',
      },
      page: () => (
        <>
          <Title />
          <Description />
          <Primary />
          <ArgsTable story={PRIMARY_STORY} />
        </>
      ),
    },
  },
};

const TemplateContentImage = (args) => <Content {...args} />;

export const defaultTable = TemplateContentImage.bind({});
defaultTable.story = {
  args: {
    module: contentTableOne,
  },
};
