"use client"; import { ColumnDef } from "@tanstack/react-table"; import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; import { Checkbox } from "@/components/ui/checkbox"; import Link from "next/link"; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from "@/components/ui/tooltip"; import Chat from "@/components/chat"; 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 TaskInfo from "../task-info"; export const columns: ColumnDef[] = [ { accessorKey: "id", header: ({ column }) => ( ), cell: ({ row }) => ( TASK-{row.getValue("id")} ), enableSorting: false, enableHiding: false, }, { accessorKey: "name", header: ({ column }) => ( ), cell: ({ row }) => { const projectInfo = { project_id: row.original.project_id, name: row.original.project_name, description: row.original.project_description, stack: row.original.project_stack, }; const taskInfo = { task_id: row.original.id, name: row.original.name, description: row.original.description, }; const featureInfo = { feature_id: row.original.feature_id, name: row.original.feature_name, description: row.original.feature_description, }; return ( ); }, }, { 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 }) => , }, ];