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

import Spotlights from '.';

export default {
  title: 'Theme/Atoms/Spotlights',
  component: Spotlights,
  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:
          'A component that displays a list of linked items (including image/icon & text) coming from Hercules. Works with the Hercules spotlights module.',
      },
      page: () => (
        <>
          <Title />
          <Subtitle />
          <Description />
          <Primary />
          <ArgsTable story={PRIMARY_STORY} />
        </>
      ),
    },
  },
};

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

export const Default = Template.bind({});
Default.args = {
  module: {
    mode: 'image_text',
    read_more_text:
      "<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s <br/>when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged</p>",
    show_read_more: '1',
    items: [
      {
        icon: null,
        image: `fit-in/960x250/313df295c19d7c5f137ceda9d0cc5df7.jpeg`,
        label: `Lorem Ipsum `,
        link: {
          title: null,
          type: 'internal',
          value: `/rizk`,
        },
        link_text: 'Read More',
        text: `<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s</p>`,
      },
      {
        icon: null,
        image: `fit-in/960x250/313df295c19d7c5f137ceda9d0cc5df7.jpeg`,
        label: `Lorem Ipsum `,
        link: {
          title: null,
          type: 'internal',
          value: `/rizk`,
        },
        link_text: 'Read More',
        text: `<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s</p>`,
      },
      {
        icon: null,
        image: `fit-in/960x250/313df295c19d7c5f137ceda9d0cc5df7.jpeg`,
        label: `Lorem Ipsum `,
        link: {
          title: null,
          type: 'internal',
          value: `/rizk`,
        },
        link_text: 'Read More',
        text: `<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s</p>`,
      },
      {
        icon: null,
        image: `fit-in/960x250/313df295c19d7c5f137ceda9d0cc5df7.jpeg`,
        label: `Lorem Ipsum `,
        link: {
          title: null,
          type: 'internal',
          value: `/rizk`,
        },
        link_text: 'Read More',
        text: `<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s</p>`,
      },
    ],
  },
};
