import React from 'react'; import classNames from 'classnames'; import NoData from 'components/common/NoData'; import styles from './Table.module.css'; export default function Table({ className, columns, rows, empty }) { if (empty && rows.length === 0) { return empty; } return (
{columns.map(({ key, label, className, style, header }) => (
{label}
))}
{rows.length === 0 && } {rows.map((row, rowIndex) => (
{columns.map(({ key, render, className, style, cell }) => (
{render ? render(row) : row[key]}
))}
))}
); }