import React from 'react'; import { pick } from 'lodash'; import Html from '../helper/Html'; import { TD } from '../../primitives/Table'; import TableContainer from '../../primitives/TableContainer'; import { RenderWithData } from '../../index'; type CellProps = Pick, "colSpan" | "rowSpan"> & { simple?: boolean 'data-inactive': boolean children?: any } function TableCell(props: CellProps) { return ; } function TableHeader({ simple, ...props }: CellProps) { return ; } /* eslint-disable react/no-array-index-key */ export default function Table({ cells, debug, simple }: RenderWithData<'Table'>) { return ( {cells.map((row, rowKey) => ( {row.map((cell, cellKey) => { const cellProps = { ...pick(cell, ['colSpan', 'rowSpan']), 'data-inactive': Boolean(cell.inactive), }; const Cell = cell.type === 'Heading' ? TableHeader : TableCell; return ( ); })} ))}
); }