/* eslint-disable import/no-extraneous-dependencies */
import React from 'react';
// eslint-disable-next-line import/no-extraneous-dependencies
import {
  Title,
  Description,
  Primary,
  PRIMARY_STORY,
  ArgsTable,
} from '@storybook/addon-docs/blocks';
import email from '../../../../../storybook-images/email.svg';
import check from '../../../../../storybook-images/check.svg';
import checkCircle from '../../../../../storybook-images/checkCircle.svg';

import AuthorBox from '.';

export default {
  title: 'Theme/Atoms/Author Box',
  component: AuthorBox,
  argTypes: {
    author: {
      name: 'author',
      type: { name: 'object', required: false },
      defaultValue: null,
      description: 'The author object.',
    },
    translations: {
      name: 'translations',
      type: { name: 'object', required: false },
      defaultValue: 180,
      description: 'The translations object',
    },
    width: {
      name: 'width',
      type: { name: 'number', required: false },
      defaultValue: 180,
      description: 'width of author image.',
    },
    height: {
      name: 'height',
      type: { name: 'number', required: false },
      defaultValue: 180,
      description: 'height of author image.',
    },
    date: {
      name: 'date',
      type: { name: 'string', required: false },
      defaultValue: null,
      description: 'date',
    },
    dateFormat: {
      name: 'dateFormat',
      type: { name: 'string', required: false },
      defaultValue: 'DD.MM.YYYY',
      description: 'date format',
    },
    dateSeparator: {
      name: 'dateSeparator',
      type: { name: 'string', required: false },
      defaultValue: '/',
      description: 'date separator. / or . or -',
    },
    readingTime: {
      name: 'readingTime',
      type: { name: 'string', required: false },
      defaultValue: null,
      description: 'reading time',
    },
    reviewer: {
      name: 'reviewer',
      type: { name: 'object', required: false },
      defaultValue: null,
      description: 'The reviewer object.',
    },
    email: {
      name: 'email',
      type: { name: 'string', required: false },
      defaultValue: email,
      description: 'author email icon',
    },
    checkCircle: {
      name: 'checkCircle',
      type: { name: 'string', required: false },
      defaultValue: checkCircle,
      description: 'check circle icon',
    },
    check: {
      name: 'check',
      type: { name: 'string', required: false },
      defaultValue: check,
      description: 'check icon',
    },
    showReadMore: {
      name: 'showReadMore',
      type: { name: 'boolean', required: false },
      defaultValue: true,
      description: 'show/hide read more',
    },
  },
  parameters: {
    docs: {
      description: {
        component: 'Author box component',
      },
      page: () => (
        <>
          <Title />
          <Description />
          <Primary />
          <ArgsTable story={PRIMARY_STORY} />
        </>
      ),
    },
  },
};

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

export const Default = Template.bind({});
Default.args = {
  author: {
    image_object: {
      url: 'https://assets-srv.s3.eu-west-1.amazonaws.com/2020-09-25-15-01-46-imagesjpeg-191264.png',
      width: '150',
      height: '150',
    },
    name: 'Ida Moen Olsen',
    author_title: 'Online Casino Specialist',
    email_address: 'ida@gig.com',
    personal_website: 'https://www.irishluck.ie',
    additional_url: 'https://www.irishluck.ie',
    facebook_profile: 'https://www.irishluck.ie',
    instagram_profile: 'https://www.irishluck.ie',
    linkedin_profile: 'https://www.irishluck.ie',
    biography:
      "The author's biography goes here. This author is cool and she likes writing articles. Something else about Irishluck and how this author has experience.",
    profile_page_path: '/',
  },
  translations: {
    read_more: 'Les mer',
  },
  reviewer: {
    profile_page_path: '/',
    name: 'Moen Olsen',
  },
};
