import React from 'react';
import { Table } from './Table';
import { TableHeader } from './TableHeader';
import { Column } from './Column';
import { Row } from './Row';
import { Cell, TableBody } from 'react-aria-components';

import type { Meta, StoryObj } from '@storybook/react-vite';

const meta: Meta<typeof Table> = {
  title: 'Basic/Table',
  component: Table,
  parameters: {
    layout: 'centered',
  },
  tags: ['autodocs'],
} satisfies Meta<typeof Table>;

export default meta;
type Story = StoryObj<typeof meta>;

export const Default: Story = {
  render: (args: any) => (
    <Table aria-label="Files" {...args}>
      <TableHeader>
        <Column isRowHeader>Name</Column>
        <Column>Type</Column>
        <Column>Date Modified</Column>
      </TableHeader>
      <TableBody>
        <Row>
          <Cell>Games</Cell>
          <Cell>File folder</Cell>
          <Cell>6/7/2020</Cell>
        </Row>
        <Row>
          <Cell>Program Files</Cell>
          <Cell>File folder</Cell>
          <Cell>4/7/2021</Cell>
        </Row>
        <Row>
          <Cell>bootmgr</Cell>
          <Cell>System file</Cell>
          <Cell>11/20/2010</Cell>
        </Row>
      </TableBody>
    </Table>
  ),
  args: {
    onRowAction: undefined,
    // selectionMode: "multiple",
  },
};
