mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-19 02:56:23 +08:00
feat(component): add storybook (#5079)
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
import type { Meta, StoryFn } from '@storybook/react';
|
||||
|
||||
import {
|
||||
Table,
|
||||
TableBody,
|
||||
TableBodyRow,
|
||||
TableCell,
|
||||
TableHead,
|
||||
TableHeadRow,
|
||||
} from '.';
|
||||
|
||||
export default {
|
||||
title: 'UI/Table',
|
||||
component: Table,
|
||||
} satisfies Meta<typeof Table>;
|
||||
|
||||
const Template: StoryFn = args => (
|
||||
<Table {...args}>
|
||||
<TableHead>
|
||||
<TableHeadRow>
|
||||
<TableCell>Title 1</TableCell>
|
||||
<TableCell>Title 2</TableCell>
|
||||
<TableCell>Title 3</TableCell>
|
||||
<TableCell>Title 4</TableCell>
|
||||
</TableHeadRow>
|
||||
</TableHead>
|
||||
|
||||
<TableBody>
|
||||
{Array.from({ length: 10 }).map((_, rowNum) => {
|
||||
return (
|
||||
<TableBodyRow key={`${rowNum}`}>
|
||||
{Array.from({ length: 4 }).map((_, colNum) => {
|
||||
return (
|
||||
<TableCell key={`${rowNum}-${colNum}`}>
|
||||
Cell {rowNum}-{colNum}
|
||||
</TableCell>
|
||||
);
|
||||
})}
|
||||
</TableBodyRow>
|
||||
);
|
||||
})}
|
||||
</TableBody>
|
||||
</Table>
|
||||
);
|
||||
|
||||
export const Default: StoryFn = Template.bind(undefined);
|
||||
Reference in New Issue
Block a user