mirror of
https://github.com/umami-software/umami.git
synced 2026-02-19 12:05:41 +01:00
[WebsiteList] add preloader, move to components
This commit is contained in:
parent
2d591a7906
commit
6cb85959b5
7 changed files with 210 additions and 95 deletions
41
components/common/TableNew.js
Normal file
41
components/common/TableNew.js
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
import React from 'react';
|
||||
|
||||
export default function TableNew({
|
||||
getTableProps,
|
||||
getTableBodyProps,
|
||||
headerGroups,
|
||||
prepareRow,
|
||||
page,
|
||||
}) {
|
||||
return (
|
||||
<table {...getTableProps()}>
|
||||
<thead>
|
||||
{headerGroups.map(headerGroup => (
|
||||
<tr key={headerGroup} {...headerGroup.getHeaderGroupProps()}>
|
||||
{headerGroup.headers.map(column => (
|
||||
<th key={column} {...column.getHeaderProps()}>
|
||||
{column.render('Header')}
|
||||
</th>
|
||||
))}
|
||||
</tr>
|
||||
))}
|
||||
</thead>
|
||||
<tbody {...getTableBodyProps()}>
|
||||
{page.map(row => {
|
||||
prepareRow(row);
|
||||
return (
|
||||
<tr key={row} {...row.getRowProps()}>
|
||||
{row.cells.map(cell => {
|
||||
return (
|
||||
<td key={cell} {...cell.getCellProps()}>
|
||||
{cell.render('Cell', { ...row.original })}
|
||||
</td>
|
||||
);
|
||||
})}
|
||||
</tr>
|
||||
);
|
||||
})}
|
||||
</tbody>
|
||||
</table>
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue