import type { ColumnDef } from "@tanstack/react-table" import { Check, Copy } from "lucide-react" import type { ItemPublic } from "@/client" import { Button } from "@/components/ui/button" import { useCopyToClipboard } from "@/hooks/useCopyToClipboard" import { cn } from "@/lib/utils" import { ItemActionsMenu } from "./ItemActionsMenu" function CopyId({ id }: { id: string }) { const [copiedText, copy] = useCopyToClipboard() const isCopied = copiedText === id return (
{id}
) } export const columns: ColumnDef[] = [ { accessorKey: "id", header: "ID", cell: ({ row }) => , }, { accessorKey: "title", header: "Title", cell: ({ row }) => ( {row.original.title} ), }, { accessorKey: "description", header: "Description", cell: ({ row }) => { const description = row.original.description return ( {description || "No description"} ) }, }, { id: "actions", header: () => Actions, cell: ({ row }) => (
), }, ]