import React from 'react'; import classNames from 'classnames'; import styles from './Table.module.css'; import { FormattedMessage } from 'react-intl'; export default function Table({ 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]}
))}
))}
); }