'use client'; 'use no memo'; // fixes rerendering with react compiler, v9 of tanstack table will fix this import { Button } from '@/components/ui/button'; import { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, } from '@/components/ui/dropdown-menu'; import type { Table } from '@tanstack/react-table'; import { Settings2 } from 'lucide-react'; interface DataTableViewOptionsProps { table: Table; } export function DataTableViewOptions({ table }: DataTableViewOptionsProps) { return ( Toggle columns {table .getAllColumns() .filter((column) => typeof column.accessorFn !== 'undefined' && column.getCanHide()) .map((column) => { return ( column.toggleVisibility(!!value)} > {column.id} ); })} ); }