"use client"; import { ColumnDef } from "@tanstack/react-table"; import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; import { Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle, SheetTrigger, } from "@/components/ui/sheet"; import { Checkbox } from "@/components/ui/checkbox"; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from "@/components/ui/tooltip"; import { // labels, priorities, statuses, } from "@/components/task-table/data"; import { Task } from "@/components/task-table/schema"; import { DataTableColumnHeader } from "./data-table-column-header"; import { DataTableRowActions } from "./data-table-row-actions"; import Chat from "@/components/chat"; 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 row" className="translate-y-[2px]" /> ), enableSorting: false, enableHiding: false, }, { accessorKey: "id", header: ({ column }) => ( ), cell: ({ row }) => (
TASK-{row.getValue("id")}
), enableSorting: false, enableHiding: false, }, { accessorKey: "name", header: ({ column }) => ( ), cell: ({ row }) => { const { project, feature, ...rest } = row.original; return (
{row.original.feature_name && ( FEAT-{row.original.feature_id} )} {row.getValue("name")}

{row.original.description}

{row.getValue("name")}

{row.original.description}

); }, }, { 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: "priority", header: ({ column }) => ( ), cell: ({ row }) => { const priority = priorities.find( (priority) => priority.value === row.getValue("priority") ); if (!priority) { return (
); } return (
{priority.icon && ( )} {priority.label}
); }, filterFn: (row, id, value) => { return value.includes(row.getValue(id)); }, }, { id: "actions", cell: ({ row }) => , }, ];