Skip to main content
Glama
data-table-column-header.tsx2.08 kB
import { Button } from "@repo/ui/components/ui/button" import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger, } from "@repo/ui/components/ui/dropdown-menu" import { cn } from "@repo/ui/lib/utils" import type { Column } from "@tanstack/react-table" import { ArrowDown, ArrowUp, ChevronsUpDown, EyeOff } from "lucide-react" interface DataTableColumnHeaderProps<TData, TValue> extends React.HTMLAttributes<HTMLDivElement> { column: Column<TData, TValue> title: string } export function DataTableColumnHeader<TData, TValue>({ column, title, className, }: DataTableColumnHeaderProps<TData, TValue>) { if (!column.getCanSort()) { return <div className={cn(className)}>{title}</div> } return ( <div className={cn("flex items-center space-x-2", className)}> <DropdownMenu> <DropdownMenuTrigger asChild> <Button variant="ghost" size="sm" className="-ml-3 h-8 data-[state=open]:bg-accent" > <span>{title}</span> {column.getIsSorted() === "desc" ? ( <ArrowDown /> ) : column.getIsSorted() === "asc" ? ( <ArrowUp /> ) : ( <ChevronsUpDown /> )} </Button> </DropdownMenuTrigger> <DropdownMenuContent align="start"> <DropdownMenuItem onClick={() => column.toggleSorting(false)}> <ArrowUp className="h-3.5 w-3.5 text-muted-foreground/70" /> Asc </DropdownMenuItem> <DropdownMenuItem onClick={() => column.toggleSorting(true)}> <ArrowDown className="h-3.5 w-3.5 text-muted-foreground/70" /> Desc </DropdownMenuItem> <DropdownMenuSeparator /> <DropdownMenuItem onClick={() => column.toggleVisibility(false)}> <EyeOff className="h-3.5 w-3.5 text-muted-foreground/70" /> Hide </DropdownMenuItem> </DropdownMenuContent> </DropdownMenu> </div> ) }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/metacode0602/open-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server