diff --git a/src/components/List.tsx b/src/components/List.tsx new file mode 100644 index 00000000..19781bf4 --- /dev/null +++ b/src/components/List.tsx @@ -0,0 +1,36 @@ +import {Column, flexRender, getCoreRowModel, useReactTable} from "@tanstack/react-table"; + +export default function List({data, columns}: {data: T[]; columns: any[]}) { + const table = useReactTable({ + data, + columns: columns, + getCoreRowModel: getCoreRowModel(), + }); + + return ( + + + {table.getHeaderGroups().map((headerGroup) => ( + + {headerGroup.headers.map((header) => ( + + ))} + + ))} + + + {table.getRowModel().rows.map((row) => ( + + {row.getVisibleCells().map((cell) => ( + + ))} + + ))} + +
+ {header.isPlaceholder ? null : flexRender(header.column.columnDef.header, header.getContext())} +
+ {flexRender(cell.column.columnDef.cell, cell.getContext())} +
+ ); +} diff --git a/src/components/Sidebar.tsx b/src/components/Sidebar.tsx index 6119e11f..cf1bdeee 100644 --- a/src/components/Sidebar.tsx +++ b/src/components/Sidebar.tsx @@ -150,25 +150,25 @@ export default function Sidebar({path, navDisabled = false, focusMode = false, u badge={totalAssignedTickets} /> )} - {checkAccess(user, ["developer", "admin"]) && ( - <> -