fix: scroll area

This commit is contained in:
BennyKok 2024-01-12 17:37:51 +08:00
parent a8d428d3ad
commit 38c0a915fd
2 changed files with 7 additions and 4 deletions

View File

@ -30,6 +30,7 @@ import {
DropdownMenuTrigger, DropdownMenuTrigger,
} from "@/components/ui/dropdown-menu"; } from "@/components/ui/dropdown-menu";
import { Input } from "@/components/ui/input"; import { Input } from "@/components/ui/input";
import { ScrollArea } from "@/components/ui/scroll-area";
import { import {
Table, Table,
TableBody, TableBody,
@ -245,7 +246,7 @@ export function APIKeyList({ data }: { data: APIKey[] }) {
</DropdownMenu> */} </DropdownMenu> */}
</div> </div>
</div> </div>
<div className="rounded-md border overflow-x-auto w-full"> <ScrollArea className="rounded-md border overflow-x-auto w-full">
<Table> <Table>
<TableHeader> <TableHeader>
{table.getHeaderGroups().map((headerGroup) => ( {table.getHeaderGroups().map((headerGroup) => (
@ -294,7 +295,7 @@ export function APIKeyList({ data }: { data: APIKey[] }) {
)} )}
</TableBody> </TableBody>
</Table> </Table>
</div> </ScrollArea>
<div className="flex items-center justify-end space-x-2 py-4"> <div className="flex items-center justify-end space-x-2 py-4">
<div className="flex-1 text-sm text-muted-foreground"> <div className="flex-1 text-sm text-muted-foreground">
{table.getFilteredSelectedRowModel().rows.length} of{" "} {table.getFilteredSelectedRowModel().rows.length} of{" "}

View File

@ -14,6 +14,7 @@ import {
DropdownMenuTrigger, DropdownMenuTrigger,
} from "@/components/ui/dropdown-menu"; } from "@/components/ui/dropdown-menu";
import { Input } from "@/components/ui/input"; import { Input } from "@/components/ui/input";
import { ScrollArea } from "@/components/ui/scroll-area";
import { import {
Table, Table,
TableBody, TableBody,
@ -363,7 +364,7 @@ export function MachineList({
/> />
</div> </div>
</div> </div>
<div className="rounded-md border overflow-x-auto w-full"> <ScrollArea className="rounded-md border w-full">
<Table> <Table>
<TableHeader> <TableHeader>
{table.getHeaderGroups().map((headerGroup) => ( {table.getHeaderGroups().map((headerGroup) => (
@ -412,7 +413,8 @@ export function MachineList({
)} )}
</TableBody> </TableBody>
</Table> </Table>
</div> </ScrollArea>
<div className="flex items-center justify-end space-x-2 py-4"> <div className="flex items-center justify-end space-x-2 py-4">
<div className="flex-1 text-sm text-muted-foreground"> <div className="flex-1 text-sm text-muted-foreground">
{table.getFilteredSelectedRowModel().rows.length} of{" "} {table.getFilteredSelectedRowModel().rows.length} of{" "}