Skip to content

Commit

Permalink
surely no one needed this table
Browse files Browse the repository at this point in the history
  • Loading branch information
98ZhaoJeffrey committed Nov 5, 2024
1 parent d0cdc74 commit 5af4c50
Showing 1 changed file with 31 additions and 33 deletions.
64 changes: 31 additions & 33 deletions frontend/src/components/crud/DisplayTableContainer.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint react/jsx-props-no-spreading: 0 */ // --> OFF
import React, { useState, useEffect } from "react";
import BTable from "react-bootstrap/Table";
import { Table, TableContainer } from "@mui/material";
import { HeaderGroup, useTable, Column } from "react-table";

import { downloadFile } from "../../utils/FileUtils";
Expand Down Expand Up @@ -97,41 +97,39 @@ const DisplayTable = ({ data, downloadEntityFile }: TableProps) => {
});

return (
<BTable
striped
bordered
hover
size="sm"
{...getTableProps()}
style={{ marginTop: "20px" }}
>
<thead>
{headerGroups.map((headerGroup: HeaderGroup<EntityData>) => (
// Key is specified in the prop getter functions
// eslint-disable-next-line react/jsx-key
<tr {...headerGroup.getHeaderGroupProps()}>
{headerGroup.headers.map((column) => (
// eslint-disable-next-line react/jsx-key
<th {...column.getHeaderProps()}>{column.render("Header")}</th>
))}
</tr>
))}
</thead>
<tbody>
{rows.map((row) => {
prepareRow(row);
return (
<TableContainer>
<Table {...getTableProps()} style={{ marginTop: "20px" }}>
<thead>
{headerGroups.map((headerGroup: HeaderGroup<EntityData>) => (
// Key is specified in the prop getter functions
// eslint-disable-next-line react/jsx-key
<tr {...row.getRowProps()}>
{row.cells.map((cell) => {
<tr {...headerGroup.getHeaderGroupProps()}>
{headerGroup.headers.map((column) => (
// eslint-disable-next-line react/jsx-key
return <td {...cell.getCellProps()}>{cell.render("Cell")}</td>;
})}
<th {...column.getHeaderProps()}>{column.render("Header")}</th>
))}
</tr>
);
})}
</tbody>
</BTable>
))}
</thead>
<tbody>
{rows.map((row) => {
prepareRow(row);
return (
// eslint-disable-next-line react/jsx-key
<tr {...row.getRowProps()}>
{row.cells.map((cell) => {
// eslint-disable-next-line react/jsx-key
return (
// eslint-disable-next-line react/jsx-key
<td {...cell.getCellProps()}>{cell.render("Cell")}</td>
);
})}
</tr>
);
})}
</tbody>
</Table>
</TableContainer>
);
};

Expand Down

0 comments on commit 5af4c50

Please sign in to comment.