"use client" import { use } from "react" import { ResourcePage } from "@/shared/data-view/resource-page" import { ColumnHeader } from "@/shared/data-view/table-view" import { TASK_ROUTES } from "@garage/api" import type { TasksClient } from "@garage/api" import { Badge } from "@/shared/components/ui/badge" export default function JobCardTasksPage({ params, }: { params: Promise<{ id: string }> }) { const { id: jobCardId } = use(params) return ( pageTitle="Tasks" routeKey={TASK_ROUTES.TASKS} getClient={(api) => api.tasks} extraParams={{ job_card_id: jobCardId }} header={null} columns={() => [ { accessorKey: "title", header: ({ column }) => , cell: ({ row }) => (row.original as any).title || "—", }, { accessorKey: "task_type_name", header: ({ column }) => , cell: ({ row }) => (row.original as any).task_type_name || "—", }, { accessorKey: "section_name", header: ({ column }) => , cell: ({ row }) => (row.original as any).section_name || "—", }, { accessorKey: "due_date", header: ({ column }) => , cell: ({ row }) => { const val = (row.original as any).due_date return val ? new Date(val).toLocaleDateString() : "—" }, }, { accessorKey: "priority", header: ({ column }) => , cell: ({ row }) => { const value = (row.original as any).priority return value ? {value} : "—" }, }, { accessorKey: "status", header: ({ column }) => , cell: ({ row }) => { const value = (row.original as any).status return value ? {value} : "—" }, }, ]} /> ) }