import type { CompletionBlocker } from "@/lib/work-orders/status"; /** Result of a work order server action (client-safe; rendered by components/work-orders/action-form.tsx). */ export type ActionState = | { status: "idle" } | { status: "ok"; at: number } | { status: "error"; /** ServiceError code: not_found | forbidden | invalid | conflict | blocked | internal */ code: string; /** message key below `errors.` (falls back to the code) */ message: string; blockers?: CompletionBlocker[]; at: number; }; export const IDLE_STATE: ActionState = { status: "idle" };