import React from 'react'; import { ColumnDefinitionType } from './Table'; type TableRowsProps = { data: Array; columns: Array>; striped: boolean; range: number[]; }; const styles = { core: `whitespace-nowrap px-3 py-4 text-sm text-cu-black-600`, tbody: `divide-y divide-gray-200 bg-white`, }; const TableRows = ({ data, columns, striped, range, }: TableRowsProps) => { const stripedStyles = striped ? 'odd:bg-white even:bg-gray-50' : 'hover:bg-blue-50'; const rows = data.slice(range[0] - 1, range[1]).map((row, index) => { return ( td]:border-b [&>td]:border-cu-gray-100 [&>td]:last:border-0`} key={`row-${index}`} > {columns.map((column, index2) => { return ( <>{row[column.key]} ); })} ); }); return {rows}; }; export default TableRows;