/* 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 AuthorBox from '.';

export default {
  title: 'Theme/Layout/Author Box/Template One',
  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.',
    },
  },
  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: {
      width: '320',
      height: '480',
      url: 'https://assets-srv.s3.eu-west-1.amazonaws.com/1705928254/91c7c517ddd6e6e65b665c20ae521db2.jpg',
      title: '91c7c517ddd6e6e65b665c20ae521db2',
      alt: null,
      filename: '1705928254/91c7c517ddd6e6e65b665c20ae521db2.jpg',
    },
    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',
  },
  date: '2024-01-17 13:12',
  readingTime: 7,
};
