From 9cabe879404f1ec05dbf4e65d55162b5573aeced Mon Sep 17 00:00:00 2001 From: joonhoekim <26rote@gmail.com> Date: Fri, 28 Nov 2025 20:30:23 +0900 Subject: (김준회) dynamic table - init MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../client-table/client-table-view-options.tsx | 60 ++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 components/client-table/client-table-view-options.tsx (limited to 'components/client-table/client-table-view-options.tsx') diff --git a/components/client-table/client-table-view-options.tsx b/components/client-table/client-table-view-options.tsx new file mode 100644 index 00000000..b65049b4 --- /dev/null +++ b/components/client-table/client-table-view-options.tsx @@ -0,0 +1,60 @@ +"use client" + +import { DropdownMenuTrigger } from "@radix-ui/react-dropdown-menu" +import { MixerHorizontalIcon } from "@radix-ui/react-icons" +import { Table } from "@tanstack/react-table" + +import { Button } from "@/components/ui/button" +import { + DropdownMenu, + DropdownMenuCheckboxItem, + DropdownMenuContent, + DropdownMenuLabel, + DropdownMenuSeparator, +} from "@/components/ui/dropdown-menu" + +interface ClientTableViewOptionsProps { + table: Table +} + +export function ClientTableViewOptions({ + table, +}: ClientTableViewOptionsProps) { + return ( + + + + + + Toggle columns + + {table + .getAllLeafColumns() + .filter( + (column) => + typeof column.accessorFn !== "undefined" && column.getCanHide() + ) + .map((column) => { + return ( + column.toggleVisibility(!!value)} + > + {column.id} + + ) + })} + + + ) +} + -- cgit v1.2.3