mirror of
https://github.com/kremalicious/umami.git
synced 2024-09-27 11:48:48 +02:00
26 lines
584 B
JavaScript
26 lines
584 B
JavaScript
import React from 'react';
|
|
import styles from './Table.module.css';
|
|
|
|
export default function Table({ columns, rows }) {
|
|
return (
|
|
<table className={styles.table}>
|
|
<thead>
|
|
<tr>
|
|
{columns.map(({ key, label }) => (
|
|
<th key={key}>{label}</th>
|
|
))}
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{rows.map((row, rowIndex) => (
|
|
<tr key={rowIndex}>
|
|
{columns.map(({ key }) => (
|
|
<td key={`${rowIndex}${key}`}>{row[key]}</td>
|
|
))}
|
|
</tr>
|
|
))}
|
|
</tbody>
|
|
</table>
|
|
);
|
|
}
|