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

import OperatorInfoBlock from '.';

export default {
  title: 'Theme/Atoms/Operator Info Block',
  component: OperatorInfoBlock,
  argTypes: {
    page: {
      name: 'page',
      type: { name: 'object', required: false },
      defaultValue: '',
      description: 'The page data object',
      table: {
        type: { summary: 'object' },
        defaultValue: { summary: '' },
      },
      control: {
        type: 'object',
      },
    },
  },
  parameters: {
    docs: {
      description: {
        component: 'Generates the operator data from page object in a grid view.',
      },
      page: () => (
        <>
          <Title />
          <Description />
          <Primary />
          <ArgsTable story={PRIMARY_STORY} />
        </>
      ),
    },
  },
};

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

export const Default = Template.bind({});
Default.args = {
  page: {
    relation: {
      url: 'http://google.com',
      owner: 'Alphabet',
      founded: '1999',
      support_types: ' hello live chat world',
      types: ['live', 'poker', 'foo', 'bar'],
      games_amount: '+1000',
      status: 'active',
    },
  },
};
