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 { authors } from 'gatsby-core-theme/tests/factories/modules/contact-us-authors.factory';
import AuthorCard from '.';

const authorsKeys = Object.keys(authors);

export default {
  title: 'Theme/Atoms/Author Card',
  component: AuthorCard,
  argTypes: {
    author: {
      name: 'author',
      type: { name: 'object', required: true },
      defaultValue: '',
      description: 'author object data',
    },
  },
  parameters: {
    docs: {
      description: {
        component: 'A component that displays authors cards',
      },
      page: () => (
        <>
          <Title />
          <Description />
          <Primary />
          <ArgsTable story={PRIMARY_STORY} />
        </>
      ),
    },
  },
};

const Template = (args) => <AuthorCard {...args} />;
export const Default = Template.bind({});
Default.args = {
  author: authors[authorsKeys[0]],
};
