59 lines
1.2 KiB
TypeScript
Raw Normal View History

2024-08-22 17:07:05 +02:00
import type { Meta, StoryObj } from "@storybook/react";
import { Table } from "../src/components/Table/Table";
import "./Table.stories.css";
import { Row } from "../src/components/Table/Row";
import { Cell } from "../src";
2024-08-22 17:07:05 +02:00
const meta = {
title: "Components/Table",
component: Table,
parameters: {
layout: "centered",
},
tags: ["autodocs"],
argTypes: {},
} satisfies Meta<typeof Table>;
export default meta;
type Story = StoryObj<typeof meta>;
export const Default: Story = {
args: {
rows: [
<Row
cells={[
<Cell>Ox45678FDGHJKLBSA21</Cell>,
<Cell>My file</Cell>,
<Cell>Some data</Cell>,
<Cell>Some data</Cell>,
]}
></Row>,
2024-08-22 17:07:05 +02:00
],
headers: ["id", "title", "other"],
2024-08-22 17:07:05 +02:00
},
};
export const Scroll: Story = {
args: {
className: "tableSmall",
rows: [
<Row
cells={[
<Cell>Ox45678FDGHJKLBSA21</Cell>,
<Cell>My file</Cell>,
<Cell>Some data</Cell>,
<Cell>Some data</Cell>,
]}
></Row>,
2024-08-22 17:07:05 +02:00
],
headers: ["id", "title", "other", "actions"],
},
};
export const Empty: Story = {
args: {
rows: [],
headers: ["id", "title", "state", "actions"],
},
};