import { useState } from 'react' import { Story, Meta } from '@storybook/react' import { Light, Eth } from '@lidofinance/icons' import Table from './Table' import Thead from './Thead' import Tbody from './Tbody' import Tr from './Tr' import Td from './Td' import Th from './Th' import { TdProps, TableTextColor, TableAlign, ThSortDirs, TrHighlight, } from './types' const getOptions = (enumObject: Record) => Object.values(enumObject).filter((value) => typeof value === 'string') export default { component: Table, title: 'Table/Table', parameters: { layout: 'centered', }, args: { textColor: 'default', align: 'left', stickyHeader: true, showHighlight: false, }, argTypes: { textColor: { options: getOptions(TableTextColor), control: 'inline-radio', }, align: { options: getOptions(TableAlign), control: 'inline-radio', }, }, } as Meta export const Base: Story = (props, options) => { const [sortDir, setSortDir] = useState('ASC') const isShowTrHighlights = options.args.showHighlight return (
{Array(5) .fill(null) .map((item, index) => ( ))}
setSortDir(sortDir === 'ASC' ? 'DESC' : 'ASC')} sortDir={sortDir} > Date | Type Change Balance APR
void 0}> 01-13-2021
Stake
+ 0.000007452
+ $0.02
10.00038581
$18,912.80
2.4%
) }