"use client"; "use no memo"; import type { Table } from "@tanstack/react-table"; import { Check, Settings2 } from "lucide-react"; import * as React from "react"; import { Button } from "@/components/ui/button"; import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, } from "@/components/ui/command"; import { Popover, PopoverContent, PopoverTrigger, } from "@/components/ui/popover"; import { cn } from "@/lib/utils"; interface DataTableViewOptionsProps extends React.ComponentProps { table: Table; disabled?: boolean; } export function DataTableViewOptions({ table, disabled, ...props }: DataTableViewOptionsProps) { const columns = table .getAllColumns() .filter( (column) => typeof column.accessorFn !== "undefined" && column.getCanHide(), ); return ( No columns found. {columns.map((column) => ( column.toggleVisibility(!column.getIsVisible()) } > {column.columnDef.meta?.label ?? column.id} ))} ); }