import React from "react"; export default function DataTable({ columns, rows, maxHeight }) { if (!columns || columns.length === 0) { return
No data columns.
; } const isNumeric = (val) => { return typeof val === "number" && !isNaN(val); }; return (
{columns.map((col, idx) => ( ))} {rows && rows.length > 0 ? ( rows.map((row, rowIdx) => ( {row.map((cell, cellIdx) => { const numeric = isNumeric(cell); return ( ); })} )) ) : ( )}
{col}
{cell === null || cell === undefined ? ( NULL ) : typeof cell === "boolean" ? ( cell.toString().toUpperCase() ) : ( cell )}
No records returned.
); }