"use client" import { ColumnDef } from "@tanstack/react-table" import { Checkbox } from "@/components/ui/checkbox" import { statuses } from "@/app/data/data" import { DataTableColumnHeader } from "./data-table-column-header" import { DataTableRowActions } from "./data-table-row-actions" import { VideoTask } from "@/app/types" export const columns: ColumnDef[] = [ { id: "select", header: ({ table }) => ( table.toggleAllPageRowsSelected(!!value)} aria-label="Select all" className="translate-y-[2px]" /> ), cell: ({ row }) => ( row.toggleSelected(!!value)} aria-label="Select video" className="translate-y-[2px]" /> ), enableSorting: false, enableHiding: false, }, { accessorKey: "id", header: ({ column }) => ( ), cell: ({ row }) =>
{`${row.getValue("id") || ''}`.split("-")[0]}..
, enableSorting: false, enableHiding: false, }, { accessorKey: "videoPrompt", header: ({ column }) => ( ), cell: ({ row }) => { return (
{row.getValue("videoPrompt")}
) }, }, { accessorKey: "status", header: ({ column }) => ( ), cell: ({ row }) => { const status = statuses.find( (status) => status.value === row.getValue("status") ) if (!status) { return null } return (
{status.icon && ( )} {status.label}
) }, filterFn: (row, id, value) => { return value.includes(row.getValue(id)) }, }, { accessorKey: "preview", header: ({ column }) => ( null // no header ), cell: ({ row }) => , enableSorting: false, enableHiding: false, }, { accessorKey: "fileName", header: ({ column }) => ( null // no header ), cell: ({ row }) => , enableSorting: false, enableHiding: false, }, /* action menu (currently disabled) { id: "actions", cell: ({ row }) => , }, */ ]