mirror of
https://github.com/umami-software/umami.git
synced 2026-02-06 13:47:15 +01:00
Rename website column. Table component.
This commit is contained in:
parent
a09867f28c
commit
000f84df96
8 changed files with 66 additions and 9 deletions
25
components/Table.js
Normal file
25
components/Table.js
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
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>
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue