import { DrawingPinIcon, TrashIcon } from "@radix-ui/react-icons"; import type { ColumnDef, RowData } from "@tanstack/react-table"; import { FileIcon, MoreIcon } from "~/components/icons"; import { Checkbox } from "~/components/ui/checkbox"; import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger } from "~/components/ui/dropdown-menu"; import { cn } from "~/utils"; import {FileItem} from "~/data/file-provider.js"; import {format} from "date-fns/fp"; declare module '@tanstack/table-core' { interface TableMeta { hoveredRowId: string, } } export const columns: ColumnDef[] = [ { id: "select", size: 20, header: ({ table }) => ( table.toggleAllPageRowsSelected(!!value)} aria-label="Select all" /> ), cell: ({ row }) => ( row.toggleSelected(!!value)} aria-label="Select row" /> ), enableSorting: false, enableHiding: false, }, { accessorKey: "name", header: "Name", cell: ({ row }) => (
{row.getValue("name")}
) }, { accessorKey: "cid", header: "CID", }, { accessorKey: "size", header: "Size", }, { accessorKey: "pinnedOn", size: 200, header: "Pinned On", cell: ({ row }) => (
{format(row.getValue("pinned")) as unknown as string} Ping CID Delete
) } ];