import type { ColumnDef } from "@tanstack/react-table"; import { FileIcon, MoreIcon } from "~/components/icons"; import { Checkbox } from "~/components/ui/checkbox"; // This type is used to define the shape of our data. // You can use a Zod schema here if you want. export type File = { name: string; cid: string; size: string; createdOn: string; }; export const columns: ColumnDef[] = [ { id: "select", 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: "createdOn", header: "Created On", cell: ({ row }) => (
{row.getValue("createdOn")} {row.getIsSelected() && }
) } ];