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

import Timeline from '.';

export default {
  title: 'Theme/Atoms/Timeline',
  component: Timeline,
  argTypes: {
    items: {
      name: 'items',
      type: { name: 'array', required: true },
      defaultValue: '',
      description: 'Array of data objects.',
      table: {
        type: { summary: 'array of objects' },
        defaultValue: { summary: '' },
      },
    },
  },
  parameters: {
    docs: {
      description: {
        component: 'A component that accepts an array of objects and returns a timeline.',
      },
      page: () => (
        <>
          <Title />
          <Description />
          <Primary />
          <ArgsTable story={PRIMARY_STORY} />
        </>
      ),
    },
  },
};

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

export const Default = Template.bind({});
Default.args = {
  items: [
    {
      date: '2013',
      title: 'Launched',
      text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. At urna in sapien posuere leo imperdiet pulvinar dictum.',
      isActive: false,
    },
    {
      date: '2015',
      title: 'Rebrand + New Website',
      text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. At urna in sapien posuere leo imperdiet pulvinar dictum.',
      isActive: false,
    },
    {
      date: '2017',
      title: '150+ Employees',
      text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. At urna in sapien posuere leo imperdiet pulvinar dictum.',
      isActive: false,
    },
    {
      date: '2019',
      title: 'We acquired XXX',
      text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. At urna in sapien posuere leo imperdiet pulvinar dictum.',
      isActive: false,
    },
    {
      date: 'Today',
      title: 'Over 500 Casino Reviews',
      text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. At urna in sapien posuere leo imperdiet pulvinar dictum.',
      isActive: true,
    },
  ],
};
