"use client" import { ResourcePage } from "@/shared/data-view/resource-page" import { ColumnHeader } from "@/shared/data-view/table-view" import FormDialog from "@/shared/components/form-dialog" import { InspectionForm } from "@/modules/inspections/inspection-form" import { INSPECTION_ROUTES } from "@garage/api" import type { InspectionsClient } from "@garage/api" import { useRouter } from "next/navigation" export default function InspectionsPage() { const router = useRouter() return ( pageTitle="Inspections" routeKey={INSPECTION_ROUTES.INDEX} getClient={(api) => api.inspections} onRowClick={(row) => router.push(`/sales/inspections/${(row as any).id}`)} headerProps={({ selectedItem, invalidateQuery }) => ({ actions: ( {(resourceId) => ( )} ), })} columns={({ actionsColumn }) => [ { accessorKey: "title", header: ({ column }) => , }, { accessorKey: "customer", header: ({ column }) => , cell: ({ row }) => { const c = (row.original as any).customer return c ? `${c.first_name ?? ""} ${c.last_name ?? ""}`.trim() : "—" }, }, { accessorKey: "vehicle", header: ({ column }) => , cell: ({ row }) => { const v = (row.original as any).vehicle return v ? `${v.make ?? ""} ${v.model ?? ""}`.trim() : "—" }, }, { accessorKey: "inspection_category", header: ({ column }) => , cell: ({ row }) => (row.original as any).inspection_category?.name ?? "—", }, { accessorKey: "status", header: ({ column }) => , cell: ({ row }) => { const status = (row.original as any).status return ( {status ?? "—"} ) }, }, actionsColumn(), ]} /> ) }