import { ArrowDownIcon, ArrowUpIcon, CaretSortIcon, EyeNoneIcon, } from "@radix-ui/react-icons" import { Column } from "@tanstack/react-table" import { cn } from "@/lib/utils" import { Button } from "@/components/ui/button" import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger, } from "@/components/ui/dropdown-menu" interface DataTableColumnHeaderProps extends React.HTMLAttributes { column: Column title: string } export function DataTableColumnHeader({ column, title, className, }: DataTableColumnHeaderProps) { if (!column.getCanSort()) { return
{title}
} return (
column.toggleSorting(false)}> Asc column.toggleSorting(true)}> Desc column.toggleVisibility(false)}> Hide
) }