import { Box } from '@mui/material'; import type { Meta, StoryObj } from '@storybook/react'; import { ColumnType } from '../../Listing/models'; import { DataTable } from './index'; import '../../ThemeProvider/tailwindcss.css'; const meta: Meta = { component: DataTable }; export default meta; type Story = StoryObj; export const Default: Story = { args: { children: ( <> {[...Array(5)].map((_, i) => ( ))} ) } }; export const AsEmptyState: Story = { args: { children: ( ), isEmpty: true } }; export const AsEmptyStateWithDescription: Story = { args: { children: ( ), isEmpty: true } }; export const withFixedHeightContainer: Story = { args: { ...Default.args }, render: (args) => (
) }; const ListingTemplate = (args): JSX.Element => ( ); export const listing: Story = { args: { children: ( row.title, id: 'title', label: 'Title', type: ColumnType.string }, { getFormattedString: (row) => row.description, id: 'description', label: 'Description', type: ColumnType.string } ]} rows={[...Array(5)].map((_, i) => ({ description: `Item description ${i}`, id: i, title: `Item ${i}` }))} /> ), variant: 'listing' }, render: ListingTemplate };