@burdenoff/microfe-movethewheels 2026.925.2 → 2026.929.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/dist/components/StatusBadge.js +34 -31
  2. package/dist/constants/index.js +12 -5
  3. package/dist/hooks/useCustomers.js +0 -3
  4. package/dist/hooks/useFleet.js +148 -135
  5. package/dist/hooks/useInventory.js +146 -146
  6. package/dist/hooks/useRoutes.js +5 -14
  7. package/dist/movethewheels/components/StatusBadge.d.ts +3 -1
  8. package/dist/movethewheels/constants/index.d.ts +1 -0
  9. package/dist/movethewheels/hooks/useFleet.d.ts +17 -4
  10. package/dist/movethewheels/hooks/useInventory.d.ts +11 -0
  11. package/dist/movethewheels/types/index.d.ts +19 -75
  12. package/dist/pages/CustomerDetailsPage.js +666 -344
  13. package/dist/pages/CustomersPage.js +71 -80
  14. package/dist/pages/DriverDetailsPage.js +2 -2
  15. package/dist/pages/DriversPage.js +2 -2
  16. package/dist/pages/FleetPage.js +1 -3
  17. package/dist/pages/InventoryPage.js +5 -5
  18. package/dist/pages/RouteDetailsPage.js +273 -248
  19. package/dist/pages/RoutesPage.js +130 -67
  20. package/dist/pages/VehicleDetailsPage.js +527 -389
  21. package/dist/pages/VehiclesPage.js +120 -71
  22. package/dist/pages/WarehouseDetailsPage.js +411 -368
  23. package/dist/pages/WarehousesPage.js +132 -83
  24. package/package.json +1 -1
  25. package/src/movethewheels/components/StatusBadge.tsx +15 -7
  26. package/src/movethewheels/constants/index.ts +9 -0
  27. package/src/movethewheels/hooks/useCustomers.ts +0 -3
  28. package/src/movethewheels/hooks/useFleet.ts +89 -25
  29. package/src/movethewheels/hooks/useInventory.ts +77 -33
  30. package/src/movethewheels/hooks/useRoutes.ts +17 -12
  31. package/src/movethewheels/pages/CustomerDetailsPage.tsx +376 -109
  32. package/src/movethewheels/pages/CustomersPage.tsx +6 -15
  33. package/src/movethewheels/pages/DriverDetailsPage.tsx +3 -1
  34. package/src/movethewheels/pages/DriversPage.tsx +5 -1
  35. package/src/movethewheels/pages/FleetPage.tsx +2 -1
  36. package/src/movethewheels/pages/InventoryPage.tsx +18 -6
  37. package/src/movethewheels/pages/RouteDetailsPage.tsx +74 -34
  38. package/src/movethewheels/pages/RoutesPage.tsx +66 -2
  39. package/src/movethewheels/pages/VehicleDetailsPage.tsx +185 -23
  40. package/src/movethewheels/pages/VehiclesPage.tsx +72 -5
  41. package/src/movethewheels/pages/WarehouseDetailsPage.tsx +217 -138
  42. package/src/movethewheels/pages/WarehousesPage.tsx +81 -17
  43. package/src/movethewheels/types/index.ts +28 -75
@@ -5,27 +5,29 @@ import { MapPin as r } from "../node_modules/lucide-react/dist/esm/icons/map-pin
5
5
  import { Phone as i } from "../node_modules/lucide-react/dist/esm/icons/phone.js";
6
6
  import { Save as a } from "../node_modules/lucide-react/dist/esm/icons/save.js";
7
7
  import { SquarePen as o } from "../node_modules/lucide-react/dist/esm/icons/square-pen.js";
8
- import { Truck as s } from "../node_modules/lucide-react/dist/esm/icons/truck.js";
9
- import { UserRound as c } from "../node_modules/lucide-react/dist/esm/icons/user-round.js";
10
- import { joinPath as l } from "../utils/navigation.js";
11
- import { useMoveTheWheels as u } from "../providers/MoveTheWheelsProvider.js";
12
- import { toApiVehicleStatus as d, useFleet as f, useVehicle as p, useVehicleDrivers as m } from "../hooks/useFleet.js";
13
- import { Avatar as h, AvatarFallback as g, Button as _, Card as v, CardContent as y, CardHeader as b, CardTitle as x, Input as S, Label as C, Progress as w, Select as T, SelectContent as E, SelectItem as D, SelectTrigger as O, SelectValue as k } from "../components/ui.js";
14
- import { ErrorState as A, LoadingState as j, PageLayout as M } from "../components/PageLayout.js";
15
- import { StatusBadge as N, VehicleTypeBadge as P } from "../components/StatusBadge.js";
16
- import { FormError as F } from "../components/FormError.js";
17
- import { Notice as I, useNotice as L } from "../components/Notice.js";
18
- import { formatDate as R, getInitials as z } from "../utils/formatters.js";
19
- import { DocumentsCard as B } from "../components/DocumentsCard.js";
20
- import { useRecordVehicleService as V } from "../hooks/useFleetIntelligence.js";
21
- import { VehicleServiceCard as ee } from "../components/VehicleServiceCard.js";
22
- import { useEffect as H, useState as U } from "react";
23
- import { useLocation as te, useParams as ne } from "react-router";
24
- import { jsx as W, jsxs as G } from "react/jsx-runtime";
25
- import { useI18n as re } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
26
- import { EmphasisPanel as K, NextSteps as ie, PagePurpose as q } from "@burdenoff/fe-libs/ui";
8
+ import { Trash2 as s } from "../node_modules/lucide-react/dist/esm/icons/trash-2.js";
9
+ import { Truck as c } from "../node_modules/lucide-react/dist/esm/icons/truck.js";
10
+ import { UserRound as l } from "../node_modules/lucide-react/dist/esm/icons/user-round.js";
11
+ import { joinPath as u } from "../utils/navigation.js";
12
+ import { useMoveTheWheels as d } from "../providers/MoveTheWheelsProvider.js";
13
+ import { toApiVehicleStatus as f, useFleet as p, useVehicle as m, useVehicleDrivers as h } from "../hooks/useFleet.js";
14
+ import { Avatar as g, AvatarFallback as _, Button as v, Card as y, CardContent as b, CardHeader as x, CardTitle as S, Input as C, Label as w, Progress as T, Select as E, SelectContent as D, SelectItem as O, SelectTrigger as k, SelectValue as A } from "../components/ui.js";
15
+ import { ErrorState as j, LoadingState as M, PageLayout as N } from "../components/PageLayout.js";
16
+ import { VEHICLE_STATUS_LABELS as P } from "../constants/index.js";
17
+ import { StatusBadge as F, VehicleTypeBadge as I } from "../components/StatusBadge.js";
18
+ import { FormError as L } from "../components/FormError.js";
19
+ import { Notice as R, useNotice as z } from "../components/Notice.js";
20
+ import { formatDate as B, getInitials as V } from "../utils/formatters.js";
21
+ import { DocumentsCard as H } from "../components/DocumentsCard.js";
22
+ import { useRecordVehicleService as U } from "../hooks/useFleetIntelligence.js";
23
+ import { VehicleServiceCard as W } from "../components/VehicleServiceCard.js";
24
+ import { useEffect as G, useState as K } from "react";
25
+ import { useLocation as ee, useParams as te } from "react-router";
26
+ import { jsx as q, jsxs as J } from "react/jsx-runtime";
27
+ import { useI18n as ne } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
28
+ import { EmphasisPanel as Y, NextSteps as re, PagePurpose as X, ResponsiveDialog as Z, ResponsiveDialogContent as Q, ResponsiveDialogDescription as $, ResponsiveDialogFooter as ie, ResponsiveDialogHeader as ae, ResponsiveDialogTitle as oe } from "@burdenoff/fe-libs/ui";
27
29
  //#region src/movethewheels/pages/VehicleDetailsPage.tsx
28
- var J = [
30
+ var se = [
29
31
  {
30
32
  value: "TRUCK",
31
33
  label: "Truck"
@@ -58,24 +60,31 @@ var J = [
58
60
  value: "DRONE",
59
61
  label: "Drone"
60
62
  }
61
- ], Y = [
63
+ ], ce = Object.entries(P).map(([e, t]) => ({
64
+ value: e,
65
+ label: t
66
+ })), le = [
62
67
  {
63
- value: "available",
64
- label: "Available"
68
+ value: "DIESEL",
69
+ label: "Diesel"
65
70
  },
66
71
  {
67
- value: "assigned",
68
- label: "In Transit"
72
+ value: "PETROL",
73
+ label: "Petrol"
69
74
  },
70
75
  {
71
- value: "maintenance",
72
- label: "Maintenance"
76
+ value: "CNG",
77
+ label: "CNG"
73
78
  },
74
79
  {
75
- value: "out_of_service",
76
- label: "Out of Service"
80
+ value: "ELECTRIC",
81
+ label: "Electric"
82
+ },
83
+ {
84
+ value: "HYBRID",
85
+ label: "Hybrid"
77
86
  }
78
- ], X = [
87
+ ], ue = [
79
88
  {
80
89
  value: "owned",
81
90
  label: "Owned"
@@ -89,8 +98,8 @@ var J = [
89
98
  label: "Rented"
90
99
  }
91
100
  ];
92
- function Z({ editId: t }) {
93
- let { basePath: n, navigate: r } = u(), { createVehicle: i, updateVehicle: o } = f(), { vehicle: c } = p(t), m = !!t, [h, g] = U({
101
+ function de({ editId: t }) {
102
+ let { basePath: n, navigate: r } = d(), { createVehicle: i, updateVehicle: o, deleteVehicle: l } = p(), { vehicle: h } = m(t), g = !!t, [_, T] = K({
94
103
  vehicleNumber: "",
95
104
  type: "VAN",
96
105
  make: "",
@@ -100,498 +109,627 @@ function Z({ editId: t }) {
100
109
  year: "",
101
110
  status: "available",
102
111
  fuelType: "",
103
- fuelEfficiencyLPer100Km: ""
104
- }), [v, y] = U(!1), [b, x] = U(null);
105
- H(() => {
106
- t && c && g({
107
- vehicleNumber: c.vehicleNumber ?? "",
108
- type: c.type ? c.type.toUpperCase() : "VAN",
109
- make: c.make ?? "",
110
- model: c.model ?? "",
111
- licensePlate: c.licensePlate ?? "",
112
- ownershipType: c.ownershipType ?? "",
113
- year: c.year ? String(c.year) : "",
114
- status: c.status,
115
- fuelType: c.fuelType ?? "",
116
- fuelEfficiencyLPer100Km: c.fuelEfficiencyLPer100Km === void 0 ? "" : String(c.fuelEfficiencyLPer100Km)
112
+ fuelEfficiencyLPer100Km: "",
113
+ capacityWeight: "",
114
+ capacityVolume: "",
115
+ capacityPallets: ""
116
+ }), [j, M] = K(!1), [P, F] = K(null), [I, R] = K(!1), [z, B] = K(!1), [V, H] = K(null);
117
+ G(() => {
118
+ t && h && T({
119
+ vehicleNumber: h.vehicleNumber ?? "",
120
+ type: h.type ? h.type.toUpperCase() : "VAN",
121
+ make: h.make ?? "",
122
+ model: h.model ?? "",
123
+ licensePlate: h.licensePlate ?? "",
124
+ ownershipType: h.ownershipType ?? "",
125
+ year: h.year ? String(h.year) : "",
126
+ status: h.status,
127
+ fuelType: h.fuelType ?? "",
128
+ fuelEfficiencyLPer100Km: h.fuelEfficiencyLPer100Km === void 0 ? "" : String(h.fuelEfficiencyLPer100Km),
129
+ capacityWeight: h.capacity.weight ? String(h.capacity.weight) : "",
130
+ capacityVolume: h.capacity.volume ? String(h.capacity.volume) : "",
131
+ capacityPallets: h.capacity.pallets ? String(h.capacity.pallets) : ""
117
132
  });
118
- }, [t, c]);
119
- let w = () => r?.(l(n, "fleet/vehicles")), A = async (e) => {
120
- if (e.preventDefault(), !h.vehicleNumber.trim()) {
121
- x("Vehicle number is required.");
133
+ }, [t, h]);
134
+ let U = () => r?.(u(n, "fleet/vehicles")), W = async (e) => {
135
+ if (e.preventDefault(), !_.vehicleNumber.trim()) {
136
+ F("Vehicle number is required.");
122
137
  return;
123
138
  }
124
- y(!0), x(null);
139
+ M(!0), F(null);
125
140
  try {
126
141
  let e = {
127
- vehicleNumber: h.vehicleNumber.trim(),
128
- type: h.type,
129
- make: h.make.trim() || void 0,
130
- model: h.model.trim() || void 0,
131
- licensePlate: h.licensePlate.trim() || void 0,
132
- ownershipType: h.ownershipType || void 0,
133
- year: h.year ? Number(h.year) : void 0,
134
- status: d(h.status),
135
- fuelType: h.fuelType || void 0,
136
- fuelEfficiencyLPer100Km: h.fuelEfficiencyLPer100Km ? Number(h.fuelEfficiencyLPer100Km) : void 0
142
+ vehicleNumber: _.vehicleNumber.trim(),
143
+ type: _.type,
144
+ make: _.make.trim() || void 0,
145
+ model: _.model.trim() || void 0,
146
+ licensePlate: _.licensePlate.trim() || void 0,
147
+ ownershipType: _.ownershipType || void 0,
148
+ year: _.year ? Number(_.year) : void 0,
149
+ status: f(_.status),
150
+ fuelType: _.fuelType || void 0,
151
+ fuelEfficiencyLPer100Km: _.fuelEfficiencyLPer100Km ? Number(_.fuelEfficiencyLPer100Km) : void 0,
152
+ capacity: _.capacityWeight || _.capacityVolume || _.capacityPallets ? {
153
+ weight: _.capacityWeight ? Number(_.capacityWeight) : void 0,
154
+ volume: _.capacityVolume ? Number(_.capacityVolume) : void 0,
155
+ pallets: _.capacityPallets ? Number(_.capacityPallets) : void 0
156
+ } : void 0
137
157
  };
138
158
  if (t) {
139
159
  let i = await o(t, e);
140
- r?.(l(n, `fleet/vehicles/${i.id}`));
160
+ r?.(u(n, `fleet/vehicles/${i.id}`));
141
161
  } else {
142
162
  let t = await i(e);
143
- r?.(l(n, `fleet/vehicles/${t.id}`));
163
+ r?.(u(n, `fleet/vehicles/${t.id}`));
144
164
  }
145
165
  } catch (e) {
146
- console.error("Failed to create vehicle:", e), x(e instanceof Error ? e.message : "Failed to create vehicle. Please try again."), y(!1);
166
+ console.error("Failed to create vehicle:", e), F(e instanceof Error ? e.message : "Failed to create vehicle. Please try again."), M(!1);
147
167
  }
148
168
  };
149
- return /* @__PURE__ */ G(M, {
150
- title: m ? "Edit Vehicle" : "Add Vehicle",
169
+ return /* @__PURE__ */ J(N, {
170
+ title: g ? "Edit Vehicle" : "Add Vehicle",
151
171
  subtitle: "Register a new vehicle in your fleet",
152
- icon: /* @__PURE__ */ W(s, { size: 24 }),
153
- headerActions: /* @__PURE__ */ G("div", {
172
+ icon: /* @__PURE__ */ q(c, { size: 24 }),
173
+ headerActions: /* @__PURE__ */ J("div", {
154
174
  className: "flex gap-2",
155
- children: [/* @__PURE__ */ G(_, {
175
+ children: [/* @__PURE__ */ J(v, {
156
176
  variant: "outline",
157
- onClick: w,
158
- disabled: v,
159
- children: [/* @__PURE__ */ W(e, { size: 16 }), " Cancel"]
160
- }), /* @__PURE__ */ G(_, {
161
- onClick: A,
162
- disabled: v,
177
+ onClick: U,
178
+ disabled: j,
179
+ children: [/* @__PURE__ */ q(e, { size: 16 }), " Cancel"]
180
+ }), /* @__PURE__ */ J(v, {
181
+ onClick: W,
182
+ disabled: j,
163
183
  children: [
164
- /* @__PURE__ */ W(a, { size: 16 }),
184
+ /* @__PURE__ */ q(a, { size: 16 }),
165
185
  " ",
166
- m ? v ? "Saving..." : "Save Changes" : v ? "Saving..." : "Add Vehicle"
186
+ g ? j ? "Saving..." : "Save Changes" : j ? "Saving..." : "Add Vehicle"
167
187
  ]
168
188
  })]
169
189
  }),
170
- children: [/* @__PURE__ */ W(q, {
171
- icon: /* @__PURE__ */ W(s, { size: 18 }),
172
- children: "Add a vehicle so it can be assigned to deliveries and routes. Give it a fleet number and type to start — make, model and plate help identify it on the road."
173
- }), /* @__PURE__ */ G("form", {
174
- onSubmit: A,
175
- className: "max-w-2xl space-y-6",
176
- children: [/* @__PURE__ */ W(F, { message: b }), /* @__PURE__ */ G(K, { children: [/* @__PURE__ */ W("h2", {
177
- className: "text-base font-semibold text-text-primary mb-4",
178
- children: "Vehicle Details"
179
- }), /* @__PURE__ */ G("div", {
180
- className: "space-y-4",
190
+ children: [
191
+ /* @__PURE__ */ q(X, {
192
+ icon: /* @__PURE__ */ q(c, { size: 18 }),
193
+ children: "Add a vehicle so it can be assigned to deliveries and routes. Give it a fleet number and type to start — make, model and plate help identify it on the road."
194
+ }),
195
+ /* @__PURE__ */ J("form", {
196
+ onSubmit: W,
197
+ className: "max-w-2xl space-y-6",
181
198
  children: [
182
- /* @__PURE__ */ G("div", {
183
- className: "grid grid-cols-1 md:grid-cols-2 gap-4",
184
- children: [/* @__PURE__ */ G("div", {
185
- className: "space-y-2",
186
- children: [/* @__PURE__ */ G(C, {
187
- htmlFor: "vehicleNumber",
188
- children: ["Vehicle Number ", /* @__PURE__ */ W("span", {
189
- className: "text-status-error-text",
190
- children: "*"
191
- })]
192
- }), /* @__PURE__ */ W(S, {
193
- id: "vehicleNumber",
194
- value: h.vehicleNumber,
195
- onChange: (e) => g((t) => ({
196
- ...t,
197
- vehicleNumber: e.target.value
198
- })),
199
- placeholder: "MTW-001",
200
- required: !0
201
- })]
202
- }), /* @__PURE__ */ G("div", {
203
- className: "space-y-2",
204
- children: [/* @__PURE__ */ G(C, {
205
- htmlFor: "type",
206
- children: ["Type ", /* @__PURE__ */ W("span", {
207
- className: "text-status-error-text",
208
- children: "*"
209
- })]
210
- }), /* @__PURE__ */ G(T, {
211
- value: h.type,
212
- onValueChange: (e) => g((t) => ({
213
- ...t,
214
- type: e
215
- })),
216
- children: [/* @__PURE__ */ W(O, {
217
- id: "type",
218
- children: /* @__PURE__ */ W(k, {})
219
- }), /* @__PURE__ */ W(E, { children: J.map((e) => /* @__PURE__ */ W(D, {
220
- value: e.value,
221
- children: e.label
222
- }, e.value)) })]
223
- })]
224
- })]
225
- }),
226
- /* @__PURE__ */ G("div", {
227
- className: "grid grid-cols-1 md:grid-cols-3 gap-4",
199
+ /* @__PURE__ */ q(L, { message: P }),
200
+ /* @__PURE__ */ J(Y, { children: [/* @__PURE__ */ q("h2", {
201
+ className: "text-base font-semibold text-text-primary mb-4",
202
+ children: "Vehicle Details"
203
+ }), /* @__PURE__ */ J("div", {
204
+ className: "space-y-4",
228
205
  children: [
229
- /* @__PURE__ */ G("div", {
230
- className: "space-y-2",
231
- children: [/* @__PURE__ */ W(C, {
232
- htmlFor: "make",
233
- children: "Make"
234
- }), /* @__PURE__ */ W(S, {
235
- id: "make",
236
- value: h.make,
237
- onChange: (e) => g((t) => ({
238
- ...t,
239
- make: e.target.value
240
- })),
241
- placeholder: "Ford"
206
+ /* @__PURE__ */ J("div", {
207
+ className: "grid grid-cols-1 md:grid-cols-2 gap-4",
208
+ children: [/* @__PURE__ */ J("div", {
209
+ className: "space-y-2",
210
+ children: [/* @__PURE__ */ J(w, {
211
+ htmlFor: "vehicleNumber",
212
+ children: ["Vehicle Number ", /* @__PURE__ */ q("span", {
213
+ className: "text-status-error-text",
214
+ children: "*"
215
+ })]
216
+ }), /* @__PURE__ */ q(C, {
217
+ id: "vehicleNumber",
218
+ value: _.vehicleNumber,
219
+ onChange: (e) => T((t) => ({
220
+ ...t,
221
+ vehicleNumber: e.target.value
222
+ })),
223
+ placeholder: "MTW-001",
224
+ required: !0
225
+ })]
226
+ }), /* @__PURE__ */ J("div", {
227
+ className: "space-y-2",
228
+ children: [/* @__PURE__ */ J(w, {
229
+ htmlFor: "type",
230
+ children: ["Type ", /* @__PURE__ */ q("span", {
231
+ className: "text-status-error-text",
232
+ children: "*"
233
+ })]
234
+ }), /* @__PURE__ */ J(E, {
235
+ value: _.type,
236
+ onValueChange: (e) => T((t) => ({
237
+ ...t,
238
+ type: e
239
+ })),
240
+ children: [/* @__PURE__ */ q(k, {
241
+ id: "type",
242
+ children: /* @__PURE__ */ q(A, {})
243
+ }), /* @__PURE__ */ q(D, { children: se.map((e) => /* @__PURE__ */ q(O, {
244
+ value: e.value,
245
+ children: e.label
246
+ }, e.value)) })]
247
+ })]
242
248
  })]
243
249
  }),
244
- /* @__PURE__ */ G("div", {
245
- className: "space-y-2",
246
- children: [/* @__PURE__ */ W(C, {
247
- htmlFor: "model",
248
- children: "Model"
249
- }), /* @__PURE__ */ W(S, {
250
- id: "model",
251
- value: h.model,
252
- onChange: (e) => g((t) => ({
253
- ...t,
254
- model: e.target.value
255
- })),
256
- placeholder: "Transit"
257
- })]
250
+ /* @__PURE__ */ J("div", {
251
+ className: "grid grid-cols-1 md:grid-cols-3 gap-4",
252
+ children: [
253
+ /* @__PURE__ */ J("div", {
254
+ className: "space-y-2",
255
+ children: [/* @__PURE__ */ q(w, {
256
+ htmlFor: "make",
257
+ children: "Make"
258
+ }), /* @__PURE__ */ q(C, {
259
+ id: "make",
260
+ value: _.make,
261
+ onChange: (e) => T((t) => ({
262
+ ...t,
263
+ make: e.target.value
264
+ })),
265
+ placeholder: "Ford"
266
+ })]
267
+ }),
268
+ /* @__PURE__ */ J("div", {
269
+ className: "space-y-2",
270
+ children: [/* @__PURE__ */ q(w, {
271
+ htmlFor: "model",
272
+ children: "Model"
273
+ }), /* @__PURE__ */ q(C, {
274
+ id: "model",
275
+ value: _.model,
276
+ onChange: (e) => T((t) => ({
277
+ ...t,
278
+ model: e.target.value
279
+ })),
280
+ placeholder: "Transit"
281
+ })]
282
+ }),
283
+ /* @__PURE__ */ J("div", {
284
+ className: "space-y-2",
285
+ children: [/* @__PURE__ */ q(w, {
286
+ htmlFor: "licensePlate",
287
+ children: "License Plate"
288
+ }), /* @__PURE__ */ q(C, {
289
+ id: "licensePlate",
290
+ value: _.licensePlate,
291
+ onChange: (e) => T((t) => ({
292
+ ...t,
293
+ licensePlate: e.target.value
294
+ })),
295
+ placeholder: "ABC-1234"
296
+ })]
297
+ })
298
+ ]
258
299
  }),
259
- /* @__PURE__ */ G("div", {
260
- className: "space-y-2",
261
- children: [/* @__PURE__ */ W(C, {
262
- htmlFor: "licensePlate",
263
- children: "License Plate"
264
- }), /* @__PURE__ */ W(S, {
265
- id: "licensePlate",
266
- value: h.licensePlate,
267
- onChange: (e) => g((t) => ({
268
- ...t,
269
- licensePlate: e.target.value
270
- })),
271
- placeholder: "ABC-1234"
272
- })]
273
- })
274
- ]
275
- }),
276
- /* @__PURE__ */ G("div", {
277
- className: "grid grid-cols-1 md:grid-cols-3 gap-4",
278
- children: [
279
- /* @__PURE__ */ G("div", {
280
- className: "space-y-2",
281
- children: [/* @__PURE__ */ W(C, {
282
- htmlFor: "ownershipType",
283
- children: "Ownership"
284
- }), /* @__PURE__ */ G(T, {
285
- value: h.ownershipType || void 0,
286
- onValueChange: (e) => g((t) => ({
287
- ...t,
288
- ownershipType: e
289
- })),
290
- children: [/* @__PURE__ */ W(O, {
291
- id: "ownershipType",
292
- children: /* @__PURE__ */ W(k, { placeholder: "Select ownership" })
293
- }), /* @__PURE__ */ W(E, { children: X.map((e) => /* @__PURE__ */ W(D, {
294
- value: e.value,
295
- children: e.label
296
- }, e.value)) })]
297
- })]
300
+ /* @__PURE__ */ J("div", {
301
+ className: "grid grid-cols-1 md:grid-cols-3 gap-4",
302
+ children: [
303
+ /* @__PURE__ */ J("div", {
304
+ className: "space-y-2",
305
+ children: [/* @__PURE__ */ q(w, {
306
+ htmlFor: "ownershipType",
307
+ children: "Ownership"
308
+ }), /* @__PURE__ */ J(E, {
309
+ value: _.ownershipType || void 0,
310
+ onValueChange: (e) => T((t) => ({
311
+ ...t,
312
+ ownershipType: e
313
+ })),
314
+ children: [/* @__PURE__ */ q(k, {
315
+ id: "ownershipType",
316
+ children: /* @__PURE__ */ q(A, { placeholder: "Select ownership" })
317
+ }), /* @__PURE__ */ q(D, { children: ue.map((e) => /* @__PURE__ */ q(O, {
318
+ value: e.value,
319
+ children: e.label
320
+ }, e.value)) })]
321
+ })]
322
+ }),
323
+ /* @__PURE__ */ J("div", {
324
+ className: "space-y-2",
325
+ children: [/* @__PURE__ */ q(w, {
326
+ htmlFor: "year",
327
+ children: "Year"
328
+ }), /* @__PURE__ */ q(C, {
329
+ id: "year",
330
+ type: "number",
331
+ min: 1980,
332
+ max: (/* @__PURE__ */ new Date()).getFullYear() + 1,
333
+ value: _.year,
334
+ onChange: (e) => T((t) => ({
335
+ ...t,
336
+ year: e.target.value
337
+ })),
338
+ placeholder: String((/* @__PURE__ */ new Date()).getFullYear())
339
+ })]
340
+ }),
341
+ /* @__PURE__ */ J("div", {
342
+ className: "space-y-2",
343
+ children: [/* @__PURE__ */ q(w, {
344
+ htmlFor: "vehicleStatus",
345
+ children: "Status"
346
+ }), /* @__PURE__ */ J(E, {
347
+ value: _.status,
348
+ onValueChange: (e) => T((t) => ({
349
+ ...t,
350
+ status: e
351
+ })),
352
+ children: [/* @__PURE__ */ q(k, {
353
+ id: "vehicleStatus",
354
+ children: /* @__PURE__ */ q(A, {})
355
+ }), /* @__PURE__ */ q(D, { children: ce.map((e) => /* @__PURE__ */ q(O, {
356
+ value: e.value,
357
+ children: e.label
358
+ }, e.value)) })]
359
+ })]
360
+ })
361
+ ]
298
362
  }),
299
- /* @__PURE__ */ G("div", {
300
- className: "space-y-2",
301
- children: [/* @__PURE__ */ W(C, {
302
- htmlFor: "year",
303
- children: "Year"
304
- }), /* @__PURE__ */ W(S, {
305
- id: "year",
306
- type: "number",
307
- min: 1980,
308
- max: (/* @__PURE__ */ new Date()).getFullYear() + 1,
309
- value: h.year,
310
- onChange: (e) => g((t) => ({
311
- ...t,
312
- year: e.target.value
313
- })),
314
- placeholder: String((/* @__PURE__ */ new Date()).getFullYear())
363
+ /* @__PURE__ */ J("div", {
364
+ className: "grid grid-cols-1 md:grid-cols-2 gap-4",
365
+ children: [/* @__PURE__ */ J("div", {
366
+ className: "space-y-2",
367
+ children: [/* @__PURE__ */ q(w, {
368
+ htmlFor: "fuelType",
369
+ children: "Fuel Type"
370
+ }), /* @__PURE__ */ J(E, {
371
+ value: _.fuelType || void 0,
372
+ onValueChange: (e) => {
373
+ let t = le.find((t) => t.value === e)?.value;
374
+ T((e) => ({
375
+ ...e,
376
+ fuelType: t ?? ""
377
+ }));
378
+ },
379
+ children: [/* @__PURE__ */ q(k, {
380
+ id: "fuelType",
381
+ children: /* @__PURE__ */ q(A, { placeholder: "Select fuel type" })
382
+ }), /* @__PURE__ */ q(D, { children: le.map((e) => /* @__PURE__ */ q(O, {
383
+ value: e.value,
384
+ children: e.label
385
+ }, e.value)) })]
386
+ })]
387
+ }), /* @__PURE__ */ J("div", {
388
+ className: "space-y-2",
389
+ children: [/* @__PURE__ */ q(w, {
390
+ htmlFor: "fuelEfficiency",
391
+ children: "Fuel Efficiency (L/100km)"
392
+ }), /* @__PURE__ */ q(C, {
393
+ id: "fuelEfficiency",
394
+ type: "number",
395
+ min: 0,
396
+ step: .1,
397
+ value: _.fuelEfficiencyLPer100Km,
398
+ onChange: (e) => T((t) => ({
399
+ ...t,
400
+ fuelEfficiencyLPer100Km: e.target.value
401
+ })),
402
+ placeholder: "12.5"
403
+ })]
315
404
  })]
316
405
  }),
317
- /* @__PURE__ */ G("div", {
318
- className: "space-y-2",
319
- children: [/* @__PURE__ */ W(C, {
320
- htmlFor: "vehicleStatus",
321
- children: "Status"
322
- }), /* @__PURE__ */ G(T, {
323
- value: h.status,
324
- onValueChange: (e) => g((t) => ({
325
- ...t,
326
- status: e
327
- })),
328
- children: [/* @__PURE__ */ W(O, {
329
- id: "vehicleStatus",
330
- children: /* @__PURE__ */ W(k, {})
331
- }), /* @__PURE__ */ W(E, { children: Y.map((e) => /* @__PURE__ */ W(D, {
332
- value: e.value,
333
- children: e.label
334
- }, e.value)) })]
335
- })]
406
+ /* @__PURE__ */ J("div", {
407
+ className: "grid grid-cols-1 md:grid-cols-3 gap-4",
408
+ children: [
409
+ /* @__PURE__ */ J("div", {
410
+ className: "space-y-2",
411
+ children: [/* @__PURE__ */ q(w, {
412
+ htmlFor: "capacityWeight",
413
+ children: "Capacity — Weight (kg)"
414
+ }), /* @__PURE__ */ q(C, {
415
+ id: "capacityWeight",
416
+ type: "number",
417
+ min: 0,
418
+ value: _.capacityWeight,
419
+ onChange: (e) => T((t) => ({
420
+ ...t,
421
+ capacityWeight: e.target.value
422
+ })),
423
+ placeholder: "5000"
424
+ })]
425
+ }),
426
+ /* @__PURE__ */ J("div", {
427
+ className: "space-y-2",
428
+ children: [/* @__PURE__ */ q(w, {
429
+ htmlFor: "capacityVolume",
430
+ children: "Capacity — Volume (m³)"
431
+ }), /* @__PURE__ */ q(C, {
432
+ id: "capacityVolume",
433
+ type: "number",
434
+ min: 0,
435
+ step: .1,
436
+ value: _.capacityVolume,
437
+ onChange: (e) => T((t) => ({
438
+ ...t,
439
+ capacityVolume: e.target.value
440
+ })),
441
+ placeholder: "18"
442
+ })]
443
+ }),
444
+ /* @__PURE__ */ J("div", {
445
+ className: "space-y-2",
446
+ children: [/* @__PURE__ */ q(w, {
447
+ htmlFor: "capacityPallets",
448
+ children: "Capacity — Pallets"
449
+ }), /* @__PURE__ */ q(C, {
450
+ id: "capacityPallets",
451
+ type: "number",
452
+ min: 0,
453
+ value: _.capacityPallets,
454
+ onChange: (e) => T((t) => ({
455
+ ...t,
456
+ capacityPallets: e.target.value
457
+ })),
458
+ placeholder: "12"
459
+ })]
460
+ })
461
+ ]
336
462
  })
337
463
  ]
338
- }),
339
- /* @__PURE__ */ G("div", {
340
- className: "grid grid-cols-1 md:grid-cols-2 gap-4",
341
- children: [/* @__PURE__ */ G("div", {
342
- className: "space-y-2",
343
- children: [/* @__PURE__ */ W(C, {
344
- htmlFor: "fuelType",
345
- children: "Fuel Type"
346
- }), /* @__PURE__ */ W(S, {
347
- id: "fuelType",
348
- value: h.fuelType,
349
- onChange: (e) => g((t) => ({
350
- ...t,
351
- fuelType: e.target.value
352
- })),
353
- placeholder: "Diesel"
354
- })]
355
- }), /* @__PURE__ */ G("div", {
356
- className: "space-y-2",
357
- children: [/* @__PURE__ */ W(C, {
358
- htmlFor: "fuelEfficiency",
359
- children: "Fuel Efficiency (L/100km)"
360
- }), /* @__PURE__ */ W(S, {
361
- id: "fuelEfficiency",
362
- type: "number",
363
- min: 0,
364
- step: .1,
365
- value: h.fuelEfficiencyLPer100Km,
366
- onChange: (e) => g((t) => ({
367
- ...t,
368
- fuelEfficiencyLPer100Km: e.target.value
369
- })),
370
- placeholder: "12.5"
371
- })]
372
- })]
464
+ })] }),
465
+ g && /* @__PURE__ */ J(y, {
466
+ className: "border-status-error-border",
467
+ children: [/* @__PURE__ */ q(x, { children: /* @__PURE__ */ J(S, {
468
+ className: "flex items-center gap-2 text-status-error-text",
469
+ children: [/* @__PURE__ */ q(s, { size: 18 }), " Delete Vehicle"]
470
+ }) }), /* @__PURE__ */ J(b, { children: [/* @__PURE__ */ q("p", {
471
+ className: "mb-3 text-sm text-text-secondary",
472
+ children: "Removes this vehicle from the active fleet. It can no longer be assigned to drivers, orders, or routes. This cannot be undone from here."
473
+ }), /* @__PURE__ */ J(v, {
474
+ type: "button",
475
+ variant: "outline",
476
+ className: "border-status-error-border text-status-error-text hover:bg-status-error-bg-subtle",
477
+ onClick: () => R(!0),
478
+ children: [/* @__PURE__ */ q(s, { size: 16 }), " Delete this vehicle"]
479
+ })] })]
373
480
  })
374
481
  ]
375
- })] })]
376
- })]
482
+ }),
483
+ /* @__PURE__ */ q(Z, {
484
+ open: I,
485
+ onOpenChange: R,
486
+ children: /* @__PURE__ */ J(Q, { children: [
487
+ /* @__PURE__ */ J(ae, { children: [/* @__PURE__ */ q(oe, { children: "Delete this vehicle?" }), /* @__PURE__ */ J($, { children: [
488
+ "This removes ",
489
+ _.vehicleNumber || "this vehicle",
490
+ " from the active fleet. It cannot be undone from here."
491
+ ] })] }),
492
+ /* @__PURE__ */ q("div", {
493
+ className: "px-1",
494
+ children: /* @__PURE__ */ q(L, { message: V })
495
+ }),
496
+ /* @__PURE__ */ J(ie, { children: [/* @__PURE__ */ q(v, {
497
+ variant: "outline",
498
+ onClick: () => R(!1),
499
+ disabled: z,
500
+ children: "Cancel"
501
+ }), /* @__PURE__ */ q(v, {
502
+ className: "bg-status-error-text text-text-inverse hover:opacity-90",
503
+ onClick: async () => {
504
+ if (t) {
505
+ B(!0), H(null);
506
+ try {
507
+ await l(t), R(!1), r?.(u(n, "fleet/vehicles"));
508
+ } catch (e) {
509
+ H(e instanceof Error ? e.message : "Failed to delete vehicle.");
510
+ } finally {
511
+ B(!1);
512
+ }
513
+ }
514
+ },
515
+ disabled: z,
516
+ children: z ? "Deleting..." : "Delete vehicle"
517
+ })] })
518
+ ] })
519
+ })
520
+ ]
377
521
  });
378
522
  }
379
- function Q() {
380
- let { vehicleId: a } = ne(), { basePath: d, navigate: f } = u(), { vehicle: S, isLoading: C, error: T, refetch: E } = p(a), D = V(), { message: O, notify: k } = L(), { t: F } = re(), H = (e, t) => {
381
- let n = F(e);
523
+ function fe() {
524
+ let { vehicleId: a } = te(), { basePath: s, navigate: f } = d(), { vehicle: p, isLoading: C, error: w, refetch: E } = m(a), D = U(), { message: O, notify: k } = z(), { t: A } = ne(), P = (e, t) => {
525
+ let n = A(e);
382
526
  return n === e ? t : n;
383
- }, U = te().pathname.endsWith("/edit"), { drivers: J, isLoading: Y, error: X } = m(U ? void 0 : a), Q = () => f?.(l(d, "fleet/vehicles")), $ = (e) => f?.(l(d, e));
384
- return a ? U ? /* @__PURE__ */ W(Z, { editId: a }) : C ? /* @__PURE__ */ W(j, { message: "Loading vehicle details..." }) : T || !S ? /* @__PURE__ */ W(A, {
527
+ }, L = ee().pathname.endsWith("/edit"), { drivers: G, isLoading: K, error: Z } = h(L ? void 0 : a), Q = () => f?.(u(s, "fleet/vehicles")), $ = (e) => f?.(u(s, e));
528
+ return a ? L ? /* @__PURE__ */ q(de, { editId: a }) : C ? /* @__PURE__ */ q(M, { message: "Loading vehicle details..." }) : w || !p ? /* @__PURE__ */ q(j, {
385
529
  title: "Vehicle not found",
386
530
  onRetry: E
387
- }) : /* @__PURE__ */ G(M, {
388
- title: S.vehicleNumber,
389
- subtitle: `${S.make} ${S.model} (${S.year})`,
390
- icon: /* @__PURE__ */ W(s, { size: 24 }),
391
- headerActions: /* @__PURE__ */ G("div", {
531
+ }) : /* @__PURE__ */ J(N, {
532
+ title: p.vehicleNumber,
533
+ subtitle: `${p.make} ${p.model}${p.year ? ` (${p.year})` : ""}`,
534
+ icon: /* @__PURE__ */ q(c, { size: 24 }),
535
+ headerActions: /* @__PURE__ */ J("div", {
392
536
  className: "flex gap-2",
393
- children: [/* @__PURE__ */ G(_, {
537
+ children: [/* @__PURE__ */ J(v, {
394
538
  variant: "outline",
395
539
  onClick: Q,
396
- children: [/* @__PURE__ */ W(e, { size: 16 }), " Back"]
397
- }), /* @__PURE__ */ G(_, {
398
- onClick: () => f?.(l(d, "fleet/vehicles/" + a + "/edit")),
399
- children: [/* @__PURE__ */ W(o, { size: 16 }), " Edit"]
540
+ children: [/* @__PURE__ */ q(e, { size: 16 }), " Back"]
541
+ }), /* @__PURE__ */ J(v, {
542
+ onClick: () => f?.(u(s, "fleet/vehicles/" + a + "/edit")),
543
+ children: [/* @__PURE__ */ q(o, { size: 16 }), " Edit"]
400
544
  })]
401
545
  }),
402
- headerContent: /* @__PURE__ */ G("div", {
546
+ headerContent: /* @__PURE__ */ J("div", {
403
547
  className: "flex gap-2",
404
- children: [/* @__PURE__ */ W(N, {
405
- status: S.status,
548
+ children: [/* @__PURE__ */ q(F, {
549
+ status: p.status,
406
550
  type: "vehicle"
407
- }), /* @__PURE__ */ W(P, { type: S.type })]
551
+ }), /* @__PURE__ */ q(I, { type: p.type })]
408
552
  }),
409
553
  children: [
410
- /* @__PURE__ */ W(q, {
411
- icon: /* @__PURE__ */ W(s, { size: 18 }),
554
+ /* @__PURE__ */ q(X, {
555
+ icon: /* @__PURE__ */ q(c, { size: 18 }),
412
556
  children: "The full record for this vehicle — specs, capacity, fuel and mileage, who is driving it and where it is right now. Use it to confirm a vehicle is fuelled, crewed and the right size before dispatching it on a delivery."
413
557
  }),
414
- /* @__PURE__ */ W(ie, {
558
+ /* @__PURE__ */ q(re, {
415
559
  storageKey: "movethewheels-vehicle-details",
416
560
  steps: [{
417
561
  id: "assign",
418
562
  label: "Assign to a delivery",
419
563
  description: "Put this vehicle on an order that fits its capacity.",
420
- icon: /* @__PURE__ */ W(r, { size: 16 }),
564
+ icon: /* @__PURE__ */ q(r, { size: 16 }),
421
565
  onClick: () => $("orders")
422
566
  }, {
423
567
  id: "driver",
424
- label: J.length > 0 ? "Review the assigned driver" : "Assign a driver",
568
+ label: G.length > 0 ? "Review the assigned driver" : "Assign a driver",
425
569
  description: "A vehicle needs a driver before it can be dispatched.",
426
- icon: /* @__PURE__ */ W(c, { size: 16 }),
427
- done: J.length > 0,
428
- onClick: () => J[0] ? $(`fleet/drivers/${J[0].id}`) : $("fleet/drivers")
570
+ icon: /* @__PURE__ */ q(l, { size: 16 }),
571
+ done: G.length > 0,
572
+ onClick: () => G[0] ? $(`fleet/drivers/${G[0].id}`) : $("fleet/drivers")
429
573
  }]
430
574
  }),
431
- O && /* @__PURE__ */ W("div", {
575
+ O && /* @__PURE__ */ q("div", {
432
576
  className: "mb-2",
433
- children: /* @__PURE__ */ W(I, { message: O })
577
+ children: /* @__PURE__ */ q(R, { message: O })
434
578
  }),
435
- /* @__PURE__ */ G("div", {
579
+ /* @__PURE__ */ J("div", {
436
580
  className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
437
- children: [/* @__PURE__ */ G("div", {
581
+ children: [/* @__PURE__ */ J("div", {
438
582
  className: "lg:col-span-2 space-y-6",
439
583
  children: [
440
- /* @__PURE__ */ G(K, { children: [/* @__PURE__ */ W("h2", {
584
+ /* @__PURE__ */ J(Y, { children: [/* @__PURE__ */ q("h2", {
441
585
  className: "text-base font-semibold text-text-primary mb-4",
442
586
  children: "Vehicle Information"
443
- }), /* @__PURE__ */ G("div", {
587
+ }), /* @__PURE__ */ J("div", {
444
588
  className: "grid grid-cols-2 md:grid-cols-3 gap-6",
445
589
  children: [
446
- /* @__PURE__ */ G("div", { children: [/* @__PURE__ */ W("p", {
590
+ /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q("p", {
447
591
  className: "text-sm text-text-secondary",
448
592
  children: "Type"
449
- }), /* @__PURE__ */ W("p", {
593
+ }), /* @__PURE__ */ q("p", {
450
594
  className: "font-medium capitalize",
451
- children: S.type
595
+ children: p.type
452
596
  })] }),
453
- /* @__PURE__ */ G("div", { children: [/* @__PURE__ */ W("p", {
597
+ /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q("p", {
454
598
  className: "text-sm text-text-secondary",
455
599
  children: "Make"
456
- }), /* @__PURE__ */ W("p", {
600
+ }), /* @__PURE__ */ q("p", {
457
601
  className: "font-medium",
458
- children: S.make || "—"
602
+ children: p.make || "—"
459
603
  })] }),
460
- /* @__PURE__ */ G("div", { children: [/* @__PURE__ */ W("p", {
604
+ /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q("p", {
461
605
  className: "text-sm text-text-secondary",
462
606
  children: "Model"
463
- }), /* @__PURE__ */ W("p", {
607
+ }), /* @__PURE__ */ q("p", {
464
608
  className: "font-medium",
465
- children: S.model || "—"
609
+ children: p.model || "—"
466
610
  })] }),
467
- /* @__PURE__ */ G("div", { children: [/* @__PURE__ */ W("p", {
611
+ /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q("p", {
468
612
  className: "text-sm text-text-secondary",
469
613
  children: "Year"
470
- }), /* @__PURE__ */ W("p", {
614
+ }), /* @__PURE__ */ q("p", {
471
615
  className: "font-medium",
472
- children: S.year
616
+ children: p.year ?? "—"
473
617
  })] }),
474
- /* @__PURE__ */ G("div", { children: [/* @__PURE__ */ W("p", {
618
+ /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q("p", {
475
619
  className: "text-sm text-text-secondary",
476
620
  children: "License Plate"
477
- }), /* @__PURE__ */ W("p", {
621
+ }), /* @__PURE__ */ q("p", {
478
622
  className: "font-medium",
479
- children: S.licensePlate || "—"
623
+ children: p.licensePlate || "—"
480
624
  })] }),
481
- /* @__PURE__ */ G("div", { children: [/* @__PURE__ */ W("p", {
625
+ /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q("p", {
482
626
  className: "text-sm text-text-secondary",
483
627
  children: "Ownership"
484
- }), /* @__PURE__ */ W("p", {
628
+ }), /* @__PURE__ */ q("p", {
485
629
  className: "font-medium capitalize",
486
- children: S.ownershipType || "—"
630
+ children: p.ownershipType || "—"
487
631
  })] })
488
632
  ]
489
633
  })] }),
490
- /* @__PURE__ */ G(v, { children: [/* @__PURE__ */ W(b, { children: /* @__PURE__ */ W(x, { children: "Capacity" }) }), /* @__PURE__ */ W(y, { children: /* @__PURE__ */ G("div", {
634
+ /* @__PURE__ */ J(y, { children: [/* @__PURE__ */ q(x, { children: /* @__PURE__ */ q(S, { children: "Capacity" }) }), /* @__PURE__ */ q(b, { children: /* @__PURE__ */ J("div", {
491
635
  className: "grid grid-cols-1 sm:grid-cols-3 gap-6",
492
636
  children: [
493
- /* @__PURE__ */ G("div", { children: [/* @__PURE__ */ W("p", {
637
+ /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q("p", {
494
638
  className: "text-sm text-text-secondary",
495
639
  children: "Weight"
496
- }), /* @__PURE__ */ G("p", {
640
+ }), /* @__PURE__ */ q("p", {
497
641
  className: "text-2xl font-bold",
498
- children: [S.capacity.weight, /* @__PURE__ */ W("span", {
499
- className: "text-sm font-normal",
500
- children: " kg"
501
- })]
642
+ children: p.capacity.weight === void 0 ? "—" : `${p.capacity.weight} kg`
502
643
  })] }),
503
- /* @__PURE__ */ G("div", { children: [/* @__PURE__ */ W("p", {
644
+ /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q("p", {
504
645
  className: "text-sm text-text-secondary",
505
646
  children: "Volume"
506
- }), /* @__PURE__ */ G("p", {
647
+ }), /* @__PURE__ */ q("p", {
507
648
  className: "text-2xl font-bold",
508
- children: [S.capacity.volume, /* @__PURE__ */ W("span", {
509
- className: "text-sm font-normal",
510
- children: " m³"
511
- })]
649
+ children: p.capacity.volume === void 0 ? "—" : `${p.capacity.volume} m³`
512
650
  })] }),
513
- S.capacity.pallets && /* @__PURE__ */ G("div", { children: [/* @__PURE__ */ W("p", {
651
+ p.capacity.pallets && /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q("p", {
514
652
  className: "text-sm text-text-secondary",
515
653
  children: "Pallets"
516
- }), /* @__PURE__ */ W("p", {
654
+ }), /* @__PURE__ */ q("p", {
517
655
  className: "text-2xl font-bold",
518
- children: S.capacity.pallets
656
+ children: p.capacity.pallets
519
657
  })] })
520
658
  ]
521
659
  }) })] }),
522
- /* @__PURE__ */ W(B, {
660
+ /* @__PURE__ */ q(H, {
523
661
  entityType: "vehicle",
524
- entityId: S.id
662
+ entityId: p.id
525
663
  })
526
664
  ]
527
- }), /* @__PURE__ */ G("div", {
665
+ }), /* @__PURE__ */ J("div", {
528
666
  className: "space-y-6",
529
667
  children: [
530
- /* @__PURE__ */ G(v, { children: [/* @__PURE__ */ W(b, { children: /* @__PURE__ */ G(x, {
668
+ /* @__PURE__ */ J(y, { children: [/* @__PURE__ */ q(x, { children: /* @__PURE__ */ J(S, {
531
669
  className: "flex items-center gap-2",
532
- children: [/* @__PURE__ */ W(t, { size: 18 }), " Fuel & Mileage"]
533
- }) }), /* @__PURE__ */ G(y, {
670
+ children: [/* @__PURE__ */ q(t, { size: 18 }), " Fuel & Mileage"]
671
+ }) }), /* @__PURE__ */ J(b, {
534
672
  className: "space-y-4",
535
673
  children: [
536
- S.fuelLevel !== void 0 && /* @__PURE__ */ G("div", { children: [/* @__PURE__ */ G("div", {
674
+ p.fuelLevel !== void 0 && /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ J("div", {
537
675
  className: "flex justify-between text-sm mb-2",
538
- children: [/* @__PURE__ */ W("span", { children: "Fuel Level" }), /* @__PURE__ */ G("span", { children: [S.fuelLevel, "%"] })]
539
- }), /* @__PURE__ */ W(w, { value: S.fuelLevel })] }),
540
- S.mileage !== void 0 && /* @__PURE__ */ G("div", { children: [/* @__PURE__ */ W("p", {
676
+ children: [/* @__PURE__ */ q("span", { children: "Fuel Level" }), /* @__PURE__ */ J("span", { children: [p.fuelLevel, "%"] })]
677
+ }), /* @__PURE__ */ q(T, { value: p.fuelLevel })] }),
678
+ p.mileage !== void 0 && /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q("p", {
541
679
  className: "text-sm text-text-secondary",
542
680
  children: "Total Mileage"
543
- }), /* @__PURE__ */ G("p", {
681
+ }), /* @__PURE__ */ J("p", {
544
682
  className: "text-2xl font-bold",
545
683
  children: [
546
- S.mileage.toLocaleString(),
684
+ p.mileage.toLocaleString(),
547
685
  " ",
548
- /* @__PURE__ */ W("span", {
686
+ /* @__PURE__ */ q("span", {
549
687
  className: "text-sm font-normal",
550
688
  children: "miles"
551
689
  })
552
690
  ]
553
691
  })] }),
554
- (S.fuelType || S.fuelEfficiencyLPer100Km !== void 0) && /* @__PURE__ */ G("div", {
692
+ (p.fuelType || p.fuelEfficiencyLPer100Km !== void 0) && /* @__PURE__ */ J("div", {
555
693
  className: "grid grid-cols-2 gap-4",
556
- children: [S.fuelType && /* @__PURE__ */ G("div", { children: [/* @__PURE__ */ W("p", {
694
+ children: [p.fuelType && /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q("p", {
557
695
  className: "text-sm text-text-secondary",
558
696
  children: "Fuel Type"
559
- }), /* @__PURE__ */ W("p", {
697
+ }), /* @__PURE__ */ q("p", {
560
698
  className: "font-medium",
561
- children: S.fuelType
562
- })] }), S.fuelEfficiencyLPer100Km !== void 0 && /* @__PURE__ */ G("div", { children: [/* @__PURE__ */ W("p", {
699
+ children: p.fuelType
700
+ })] }), p.fuelEfficiencyLPer100Km !== void 0 && /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q("p", {
563
701
  className: "text-sm text-text-secondary",
564
702
  children: "Efficiency"
565
- }), /* @__PURE__ */ G("p", {
703
+ }), /* @__PURE__ */ J("p", {
566
704
  className: "font-medium",
567
- children: [S.fuelEfficiencyLPer100Km, " L/100km"]
705
+ children: [p.fuelEfficiencyLPer100Km, " L/100km"]
568
706
  })] })]
569
707
  })
570
708
  ]
571
709
  })] }),
572
- /* @__PURE__ */ G(v, { children: [/* @__PURE__ */ W(b, { children: /* @__PURE__ */ G(x, {
710
+ /* @__PURE__ */ J(y, { children: [/* @__PURE__ */ q(x, { children: /* @__PURE__ */ J(S, {
573
711
  className: "flex items-center gap-2",
574
- children: [/* @__PURE__ */ W(c, { size: 18 }), " Assigned Driver"]
575
- }) }), /* @__PURE__ */ W(y, {
712
+ children: [/* @__PURE__ */ q(l, { size: 18 }), " Assigned Driver"]
713
+ }) }), /* @__PURE__ */ q(b, {
576
714
  className: "space-y-4",
577
- children: Y ? /* @__PURE__ */ W("p", {
715
+ children: K ? /* @__PURE__ */ q("p", {
578
716
  className: "text-sm text-text-secondary",
579
717
  children: "Loading assignment…"
580
- }) : X ? /* @__PURE__ */ W("p", {
718
+ }) : Z ? /* @__PURE__ */ q("p", {
581
719
  className: "text-sm text-status-error-text",
582
- children: X.message
583
- }) : J.length === 0 ? /* @__PURE__ */ G("div", {
720
+ children: Z.message
721
+ }) : G.length === 0 ? /* @__PURE__ */ J("div", {
584
722
  className: "space-y-3",
585
- children: [/* @__PURE__ */ W("p", {
723
+ children: [/* @__PURE__ */ q("p", {
586
724
  className: "text-sm text-text-secondary",
587
725
  children: "No driver is assigned to this vehicle yet."
588
- }), /* @__PURE__ */ W(_, {
726
+ }), /* @__PURE__ */ q(v, {
589
727
  variant: "outline",
590
728
  size: "sm",
591
729
  onClick: () => $("fleet/drivers"),
592
730
  children: "Assign from the roster"
593
731
  })]
594
- }) : J.map((e) => /* @__PURE__ */ G("div", {
732
+ }) : G.map((e) => /* @__PURE__ */ J("div", {
595
733
  role: "button",
596
734
  tabIndex: 0,
597
735
  className: "flex w-full items-start gap-3 rounded-lg p-2 text-left hover:bg-bg-sunken/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-action-primary-bg",
@@ -599,34 +737,34 @@ function Q() {
599
737
  onKeyDown: (t) => {
600
738
  (t.key === "Enter" || t.key === " ") && (t.preventDefault(), $(`fleet/drivers/${e.id}`));
601
739
  },
602
- children: [/* @__PURE__ */ W(h, { children: /* @__PURE__ */ W(g, { children: z(e.fullName) }) }), /* @__PURE__ */ G("div", {
740
+ children: [/* @__PURE__ */ q(g, { children: /* @__PURE__ */ q(_, { children: V(e.fullName) }) }), /* @__PURE__ */ J("div", {
603
741
  className: "min-w-0 space-y-1",
604
742
  children: [
605
- /* @__PURE__ */ W("p", {
743
+ /* @__PURE__ */ q("p", {
606
744
  className: "font-medium",
607
745
  children: e.fullName
608
746
  }),
609
- /* @__PURE__ */ W("p", {
747
+ /* @__PURE__ */ q("p", {
610
748
  className: "text-xs text-text-secondary",
611
749
  children: e.employeeId
612
750
  }),
613
- /* @__PURE__ */ W(N, {
751
+ /* @__PURE__ */ q(F, {
614
752
  status: e.status,
615
753
  type: "driver",
616
754
  size: "sm"
617
755
  }),
618
- e.email && /* @__PURE__ */ G("p", {
756
+ e.email && /* @__PURE__ */ J("p", {
619
757
  className: "flex items-center gap-1.5 truncate text-sm text-text-secondary",
620
758
  children: [
621
- /* @__PURE__ */ W(n, { size: 13 }),
759
+ /* @__PURE__ */ q(n, { size: 13 }),
622
760
  " ",
623
761
  e.email
624
762
  ]
625
763
  }),
626
- e.phone && /* @__PURE__ */ G("p", {
764
+ e.phone && /* @__PURE__ */ J("p", {
627
765
  className: "flex items-center gap-1.5 text-sm text-text-secondary",
628
766
  children: [
629
- /* @__PURE__ */ W(i, { size: 13 }),
767
+ /* @__PURE__ */ q(i, { size: 13 }),
630
768
  " ",
631
769
  e.phone
632
770
  ]
@@ -635,28 +773,28 @@ function Q() {
635
773
  })]
636
774
  }, e.id))
637
775
  })] }),
638
- /* @__PURE__ */ W(ee, {
639
- vehicle: S,
640
- t: H,
776
+ /* @__PURE__ */ q(W, {
777
+ vehicle: p,
778
+ t: P,
641
779
  onRecord: async (e) => {
642
- await D(S.id, e), k(H("movethewheels.vehicles.service.saved", "Service recorded.")), E();
780
+ await D(p.id, e), k(P("movethewheels.vehicles.service.saved", "Service recorded.")), E();
643
781
  }
644
782
  }),
645
- S.currentLocation && /* @__PURE__ */ G(v, { children: [/* @__PURE__ */ W(b, { children: /* @__PURE__ */ G(x, {
783
+ p.currentLocation && /* @__PURE__ */ J(y, { children: [/* @__PURE__ */ q(x, { children: /* @__PURE__ */ J(S, {
646
784
  className: "flex items-center gap-2",
647
- children: [/* @__PURE__ */ W(r, { size: 18 }), " Current Location"]
648
- }) }), /* @__PURE__ */ G(y, { children: [/* @__PURE__ */ W("p", {
785
+ children: [/* @__PURE__ */ q(r, { size: 18 }), " Current Location"]
786
+ }) }), /* @__PURE__ */ J(b, { children: [/* @__PURE__ */ q("p", {
649
787
  className: "text-sm",
650
- children: S.currentLocation.address || "Location updating..."
651
- }), /* @__PURE__ */ G("p", {
788
+ children: p.currentLocation.address || "Location updating..."
789
+ }), /* @__PURE__ */ q("p", {
652
790
  className: "text-xs text-text-secondary mt-1",
653
- children: ["Updated ", R(S.currentLocation.timestamp || /* @__PURE__ */ new Date(), "relative")]
791
+ children: p.currentLocation.timestamp ? `Updated ${B(p.currentLocation.timestamp, "relative")}` : "Update time not recorded"
654
792
  })] })] })
655
793
  ]
656
794
  })]
657
795
  })
658
796
  ]
659
- }) : /* @__PURE__ */ W(Z, {});
797
+ }) : /* @__PURE__ */ q(de, {});
660
798
  }
661
799
  //#endregion
662
- export { Q as default };
800
+ export { fe as default };