diff --git a/client/src/components/ui/table.tsx b/client/src/components/ui/table.tsx index c8aeb781..9f1f8aca 100644 --- a/client/src/components/ui/table.tsx +++ b/client/src/components/ui/table.tsx @@ -2,6 +2,8 @@ import * as React from "react"; import { cn } from "@/lib/utils"; +import { ScrollArea } from "@/components/ui/scroll-area"; + const Table = React.forwardRef< HTMLTableElement, React.HTMLAttributes @@ -16,6 +18,22 @@ const Table = React.forwardRef< )); Table.displayName = "Table"; +const ScrollableTable = React.forwardRef< + HTMLTableElement, + React.HTMLAttributes +>(({ className, ...props }, ref) => ( + +
+ + + +)); +ScrollableTable.displayName = "ScrollableTable"; + const TableHeader = React.forwardRef< HTMLTableSectionElement, React.HTMLAttributes @@ -110,6 +128,7 @@ TableCaption.displayName = "TableCaption"; export { Table, + ScrollableTable, TableHeader, TableBody, TableFooter, diff --git a/client/src/containers/overview/table/view/overview/index.tsx b/client/src/containers/overview/table/view/overview/index.tsx index fd009c77..3542f45f 100644 --- a/client/src/containers/overview/table/view/overview/index.tsx +++ b/client/src/containers/overview/table/view/overview/index.tsx @@ -31,7 +31,7 @@ import { import { columns } from "@/containers/overview/table/view/overview/columns"; import { - Table, + ScrollableTable, TableBody, TableCell, TableHead, @@ -111,7 +111,7 @@ export function OverviewTable() { return ( <> -
+ {table.getHeaderGroups().map((headerGroup) => ( @@ -183,7 +183,7 @@ export function OverviewTable() { )} -
+ { return (
- -
- - - {table.getHeaderGroups().map((headerGroup) => ( - - {headerGroup.headers.map((header) => { - return ( - - {flexRender( - header.column.columnDef.header, - header.getContext(), - )} - - ); - })} - - ))} - - - {table.getRowModel().rows?.length ? ( - table.getRowModel().rows.map((row) => ( - - {row.getVisibleCells().map((cell, index) => ( - 0 - ? { - minWidth: cell.column.columnDef.size, - maxWidth: cell.column.columnDef.size, - } - : undefined - } - > - {flexRender( - cell.column.columnDef.cell, - cell.getContext(), - )} - - ))} - - )) - ) : ( - + + + {table.getHeaderGroups().map((headerGroup) => ( + + {headerGroup.headers.map((header) => { + return ( + + {flexRender( + header.column.columnDef.header, + header.getContext(), + )} + + ); + })} + + ))} + + + {table.getRowModel().rows?.length ? ( + table.getRowModel().rows.map((row) => ( + + {row.getVisibleCells().map((cell, index) => ( 0 + ? { + minWidth: cell.column.columnDef.size, + maxWidth: cell.column.columnDef.size, + } + : undefined + } > - No results. + {flexRender(cell.column.columnDef.cell, cell.getContext())} - - )} - -
-
-
+ ))} + + )) + ) : ( + + + No results. + + + )} + +