/* eslint-disable import/no-extraneous-dependencies */
import React from 'react';
import {
  Title,
  Description,
  Primary,
  Stories,
  PRIMARY_STORY,
  ArgsTable,
} from '@storybook/addon-docs/blocks';
import VerifiedAuthor from '../../../../images/icons/verified-author';
import { getToplistItem } from '../../../../../tests/factories/modules/toplist.factory';
import Row from './variant-one';

export default {
  title: 'Theme/Modules/Toplist/Row/Variant One',
  component: Row,
  argTypes: {
    item: {
      name: 'item',
      type: { name: 'object', required: true },
      defaultValue: getToplistItem(),
      description: 'toplist item',
    },
    tracker: {
      name: 'tracker',
      type: { name: 'string', required: false },
      defaultValue: 'main',
      description: 'tracker name',
    },
    oneliner: {
      name: 'oneliner',
      type: { name: 'string', required: false },
      defaultValue: 'main',
      description: 'oneliner name',
    },
    layout: {
      name: 'layout',
      type: { name: 'string', required: false },
      defaultValue: 'list',
      description: 'Layout for toplist (Check Theme > Modules > Toplist > Layout for differences)',
      table: {
        type: { summary: 'string' },
        defaultValue: { summary: 'list' },
      },
      control: {
        type: 'inline-radio',
        options: ['list', 'grid'],
      },
    },
    index: {
      name: 'index',
      type: { name: 'number', required: false },
      defaultValue: 4,
      description: 'Index of current item',
    },
    className: {
      name: 'className',
      type: { name: 'string', required: false },
      defaultValue: '',
      description: 'classes names passed from parent component',
    },
    itemRefs: {
      name: 'itemRefs',
      type: { name: 'string', required: false },
      defaultValue: '',
      description: 'itemRefs passed from parent component',
    },
    authorTemplateTwo: {
      name: 'authorTemplateTwo',
      type: { name: 'boolean', required: false },
      defaultValue: false,
      description: 'Show the correct author template',
    },
    showAuthor: {
      name: 'showAuthor',
      type: { name: 'boolean', required: false },
      defaultValue: true,
      description: 'Show/hide author data',
      table: {
        type: { summary: 'boolean' },
        defaultValue: { summary: true },
      },
    },
    useOneStarRating: {
      name: 'useOneStarRating',
      type: { name: 'boolean', required: false },
      defaultValue: true,
      description: 'Show/hide one star rating',
      table: {
        type: { summary: 'boolean' },
        defaultValue: { summary: true },
      },
    },
    template: {
      name: 'template',
      type: { name: 'string', required: false },
      defaultValue: 'operator_review',
      description: 'Page Template',
    },
    verifyIcon: {
      name: 'verifyIcon',
      type: { name: 'element', required: false },
      defaultValue: <VerifiedAuthor />,
      description: 'Show the correct author',
    },
  },
  parameters: {
    docs: {
      description: {
        component:
          'List of casinos typically displaying bonus information, unique selling points and a CTA. Depending on the data received from Hercules, the toplist will display as a multi-toplist with tabs, single toplist, and/or with a load more button. The toplist rows are customizable, reusable and can even be displayed in grid style rather than rows.',
      },
      page: () => (
        <>
          <Title />
          <Description />
          <Primary />
          <Stories />
          <ArgsTable story={PRIMARY_STORY} />
        </>
      ),
    },
  },
};

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

export const Default = Template.bind({});
Default.args = {};
