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

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

export default {
  title: 'Theme/Modules/Content/Common/Lists',
  component: Content,
  argTypes: {
    module: {
      name: 'module',
      type: { name: 'object', required: false },
      defaultValue: '',
      description: 'The module data object',
      table: {
        type: { summary: 'object' },
        defaultValue: { summary: '' },
      },
    },
  },
  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 OrderedList = TemplateContentImage.bind({});
OrderedList.story = {
  parameters: {
    docs: {
      storyDescription:
        'In Hercules, clicking on an image in the content module will prompt several image alignment options. These include float right, float left, align right, align left and align center.',
    },
  },
  args: {
    module: orderedList,
  },
};

export const UnorderedList = TemplateContentImage.bind({});
UnorderedList.story = {
  parameters: {
    docs: {
      storyDescription:
        'In Hercules, clicking on an image in the content module will prompt several image alignment options. These include float right, float left, align right, align left and align center.',
    },
  },
  args: {
    module: unorderedList,
  },
};
