import { ReactNode } from 'react' import { DEFAULT_CONFIG_DATA } from '~/data/fixtures' import { renderCell } from './TableCell' import { firstTableCell, secondTableCell, table, tableHeadCell, thirdTableCell, } from './TablesConfig.css' import clsx from 'clsx' export type CellData = string | null | { label: string; content: ReactNode } interface TablesConfigurationProps { data?: CellData[][] } export const TablesConfiguration = ({ data = DEFAULT_CONFIG_DATA, }: TablesConfigurationProps) => ( {data.map((row, index) => ( {row.map(renderCell())} ))}
Prop Type Default
) interface TableGenericProps extends TablesConfigurationProps { headData: string[] } export const TableGeneric = ({ data = [], headData = [], }: TableGenericProps) => ( {headData.map(head => head ? ( ) : null )} {data.map((row, index) => ( {row.map(renderCell('generic'))} ))}
{head}
)