import type { Meta, StoryObj } from "@storybook/react";
import type { TableProps } from ".";
import { Table } from ".";

type StoryType = StoryObj<typeof Table>;

const meta: Meta<typeof Table> = {
  title: "Components/Table",
  component: Table,
};

export const Default: StoryType = {
  render: (args: TableProps) => (
    <Table {...args}>
      <Table.Head>
        <Table.Row>
          <Table.HeaderCell>Insurance cover</Table.HeaderCell>
          <Table.HeaderCell>Lowest excess</Table.HeaderCell>
          <Table.HeaderCell>Highest excess</Table.HeaderCell>
        </Table.Row>
      </Table.Head>
      <Table.Body>
        <Table.Row>
          <Table.Cell>Public liability</Table.Cell>
          <Table.Cell>£250</Table.Cell>
          <Table.Cell>£2,500</Table.Cell>
        </Table.Row>
        <Table.Row>
          <Table.Cell>Employers&lsquo; liability</Table.Cell>
          <Table.Cell>£250</Table.Cell>
          <Table.Cell>£500</Table.Cell>
        </Table.Row>
        <Table.Row>
          <Table.Cell>Tools</Table.Cell>
          <Table.Cell>£100</Table.Cell>
          <Table.Cell>£500</Table.Cell>
        </Table.Row>
        <Table.Row>
          <Table.Cell>Stock</Table.Cell>
          <Table.Cell>£250</Table.Cell>
          <Table.Cell>£500</Table.Cell>
        </Table.Row>
        <Table.Row>
          <Table.Cell>Business and office equipment</Table.Cell>
          <Table.Cell>£50</Table.Cell>
          <Table.Cell>£500</Table.Cell>
        </Table.Row>
      </Table.Body>
    </Table>
  ),
};

export const Extended: StoryType = {
  render: (args: TableProps) => (
    <Table {...args}>
      <Table.Head>
        <Table.Row>
          <Table.HeaderCell>Column one</Table.HeaderCell>
          <Table.HeaderCell>Column two</Table.HeaderCell>
          <Table.HeaderCell>Column three</Table.HeaderCell>
          <Table.HeaderCell>Column four</Table.HeaderCell>
          <Table.HeaderCell>Column five</Table.HeaderCell>
          <Table.HeaderCell>Column six</Table.HeaderCell>
          <Table.HeaderCell>Column seven</Table.HeaderCell>
        </Table.Row>
      </Table.Head>
      <Table.Body>
        <Table.Row>
          <Table.Cell>Lorem</Table.Cell>
          <Table.Cell>Ipsum</Table.Cell>
          <Table.Cell>
            Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi
            pulvinar tincidunt lorem vel vulputate. Quisque vulputate sed tortor
            a aliquet. Curabitur egestas sodales nunc, bibendum cursus mi
            ultrices vitae.
          </Table.Cell>
          <Table.Cell>
            Vestibulum nec dolor urna. In ullamcorper auctor dignissim. Quisque
            faucibus, nisi in faucibus cursus, turpis mi ullamcorper arcu, id
            tempor enim ipsum eu elit. Mauris gravida libero nisl, in consequat
            justo accumsan quis. Phasellus finibus ultrices blandit. Donec
            vehicula leo odio, in dapibus massa scelerisque ac. Aliquam nec dui
            erat. Duis auctor mauris in dolor accumsan elementum. Donec vehicula
            commodo urna quis pretium. Nullam a dui sit amet nisi porta
            sollicitudin.
          </Table.Cell>
          <Table.Cell>
            Vestibulum nec dolor urna. In ullamcorper auctor dignissim. Quisque
            faucibus, nisi in faucibus cursus, turpis mi ullamcorper arcu, id
            tempor enim ipsum eu elit. Mauris gravida libero nisl, in consequat
            justo accumsan quis.
          </Table.Cell>
          <Table.Cell>
            Phasellus finibus ultrices blandit. Donec vehicula leo odio, in
            dapibus massa scelerisque ac. Aliquam nec dui erat. Duis auctor
            mauris in dolor accumsan elementum. Donec vehicula commodo urna quis
            pretium. Nullam a dui sit amet nisi porta sollicitudin.
          </Table.Cell>
          <Table.Cell>
            Nullam a dui sit amet nisi porta sollicitudin.
          </Table.Cell>
        </Table.Row>
        <Table.Row>
          <Table.Cell>Lorem</Table.Cell>
          <Table.Cell>Ipsum</Table.Cell>
          <Table.Cell>
            Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi
            pulvinar tincidunt lorem vel vulputate. Quisque vulputate sed tortor
            a aliquet. Curabitur egestas sodales nunc, bibendum cursus mi
            ultrices vitae.
          </Table.Cell>
          <Table.Cell>
            Vestibulum nec dolor urna. In ullamcorper auctor dignissim. Quisque
            faucibus, nisi in faucibus cursus, turpis mi ullamcorper arcu, id
            tempor enim ipsum eu elit. Mauris gravida libero nisl, in consequat
            justo accumsan quis. Phasellus finibus ultrices blandit. Donec
            vehicula leo odio, in dapibus massa scelerisque ac. Aliquam nec dui
            erat. Duis auctor mauris in dolor accumsan elementum. Donec vehicula
            commodo urna quis pretium. Nullam a dui sit amet nisi porta
            sollicitudin.
          </Table.Cell>
          <Table.Cell>
            Vestibulum nec dolor urna. In ullamcorper auctor dignissim. Quisque
            faucibus, nisi in faucibus cursus, turpis mi ullamcorper arcu, id
            tempor enim ipsum eu elit. Mauris gravida libero nisl, in consequat
            justo accumsan quis.
          </Table.Cell>
          <Table.Cell>
            Phasellus finibus ultrices blandit. Donec vehicula leo odio, in
            dapibus massa scelerisque ac. Aliquam nec dui erat. Duis auctor
            mauris in dolor accumsan elementum. Donec vehicula commodo urna quis
            pretium. Nullam a dui sit amet nisi porta sollicitudin.
          </Table.Cell>
          <Table.Cell>
            Nullam a dui sit amet nisi porta sollicitudin.
          </Table.Cell>
        </Table.Row>
        <Table.Row>
          <Table.Cell>Public liability</Table.Cell>
          <Table.Cell>£250</Table.Cell>
          <Table.Cell>£2,500</Table.Cell>
          <Table.Cell>£2,500</Table.Cell>
          <Table.Cell>£2,500</Table.Cell>
          <Table.Cell>£2,500</Table.Cell>
          <Table.Cell>£2,500</Table.Cell>
        </Table.Row>
      </Table.Body>
    </Table>
  ),
};

export default meta;
