|
| 1 | +import { Cell, Row, Table, TableBody, TableHead } from '@solved-ac/ui-react' |
| 2 | +import { ComponentMeta, ComponentStory } from '@storybook/react' |
| 3 | +import React from 'react' |
| 4 | + |
| 5 | +export default { |
| 6 | + title: 'Components/Table/Table', |
| 7 | + component: Table, |
| 8 | + argTypes: { |
| 9 | + children: { |
| 10 | + control: 'none', |
| 11 | + description: 'The content to display inside the table', |
| 12 | + }, |
| 13 | + padding: { |
| 14 | + control: { |
| 15 | + type: 'select', |
| 16 | + options: ['none', 'dense', 'normal', 'wide'], |
| 17 | + }, |
| 18 | + description: 'The padding of the cell', |
| 19 | + }, |
| 20 | + fullWidth: { |
| 21 | + control: { |
| 22 | + type: 'boolean', |
| 23 | + }, |
| 24 | + description: |
| 25 | + 'Whether the table should take up the full width of the container', |
| 26 | + }, |
| 27 | + }, |
| 28 | +} as ComponentMeta<typeof Table> |
| 29 | + |
| 30 | +const Template: ComponentStory<typeof Table> = (args) => <Table {...args} /> |
| 31 | + |
| 32 | +export const Default = Template.bind({}) |
| 33 | +Default.args = { |
| 34 | + children: ( |
| 35 | + <> |
| 36 | + <TableHead> |
| 37 | + <Row> |
| 38 | + <Cell>#</Cell> |
| 39 | + <Cell>Title</Cell> |
| 40 | + <Cell>Solved</Cell> |
| 41 | + <Cell>Tries</Cell> |
| 42 | + </Row> |
| 43 | + </TableHead> |
| 44 | + <TableBody> |
| 45 | + <Row> |
| 46 | + <Cell>1000</Cell> |
| 47 | + <Cell>A+B</Cell> |
| 48 | + <Cell numeric>179,871</Cell> |
| 49 | + <Cell numeric>2.37</Cell> |
| 50 | + </Row> |
| 51 | + <Row> |
| 52 | + <Cell>1001</Cell> |
| 53 | + <Cell>A-B</Cell> |
| 54 | + <Cell numeric>150,867</Cell> |
| 55 | + <Cell numeric>1.40</Cell> |
| 56 | + </Row> |
| 57 | + <Row> |
| 58 | + <Cell>1002</Cell> |
| 59 | + <Cell>Turrets</Cell> |
| 60 | + <Cell numeric>26,390</Cell> |
| 61 | + <Cell numeric>4.59</Cell> |
| 62 | + </Row> |
| 63 | + <Row> |
| 64 | + <Cell>1003</Cell> |
| 65 | + <Cell>Fibonacci Function</Cell> |
| 66 | + <Cell numeric>35,585</Cell> |
| 67 | + <Cell numeric>3.18</Cell> |
| 68 | + </Row> |
| 69 | + <Row> |
| 70 | + <Cell>1004</Cell> |
| 71 | + <Cell>Le Petit Prince</Cell> |
| 72 | + <Cell numeric>8,769</Cell> |
| 73 | + <Cell numeric>2.34</Cell> |
| 74 | + </Row> |
| 75 | + <Row> |
| 76 | + <Cell>1005</Cell> |
| 77 | + <Cell>ACM Craft</Cell> |
| 78 | + <Cell numeric>8,364</Cell> |
| 79 | + <Cell numeric>3.92</Cell> |
| 80 | + </Row> |
| 81 | + </TableBody> |
| 82 | + </> |
| 83 | + ), |
| 84 | +} |
0 commit comments