@burdenoff/microfe-movethewheels 2026.1117.1 → 2026.1123.2
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.
- package/dist/MoveTheWheelsRoot.js +149 -133
- package/dist/MoveTheWheelsRoutes.js +157 -139
- package/dist/components/EntityConversationsCard.js +145 -0
- package/dist/components/maps/MapCanvas.js +4 -3
- package/dist/events/rybbit.js +87 -0
- package/dist/generated/tracking-quality-operations.d.ts +342 -0
- package/dist/hooks/useEntityComments.js +111 -0
- package/dist/hooks/useFleet.js +394 -311
- package/dist/hooks/useInventory.js +378 -313
- package/dist/hooks/useMultiModalShipments.js +58 -53
- package/dist/hooks/useOrders.js +178 -158
- package/dist/hooks/useRoutes.js +146 -130
- package/dist/index.js +35 -34
- package/dist/movethewheels/components/EntityConversationsCard.d.ts +8 -0
- package/dist/movethewheels/events/rybbit.d.ts +27 -0
- package/dist/movethewheels/hooks/useEntityComments.d.ts +26 -0
- package/dist/movethewheels/hooks/useFleet.d.ts +73 -1
- package/dist/movethewheels/hooks/useInventory.d.ts +19 -0
- package/dist/movethewheels/index.d.ts +1 -0
- package/dist/movethewheels/pages/DocumentsLibraryPage.d.ts +1 -0
- package/dist/movethewheels/pages/NotificationsCenterPage.d.ts +1 -0
- package/dist/movethewheels/types/index.d.ts +95 -2
- package/dist/node_modules/lucide-react/dist/esm/icons/check-check.js +10 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/layers.js +17 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/message-square.js +7 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/send.js +10 -0
- package/dist/pages/DocumentsLibraryPage.js +235 -0
- package/dist/pages/DriverDetailsPage.js +625 -351
- package/dist/pages/NotificationsCenterPage.js +310 -0
- package/dist/pages/OrderDetailsPage.js +48 -42
- package/dist/pages/RouteDetailsPage.js +257 -251
- package/dist/pages/TrackingPage.js +202 -196
- package/dist/pages/VehicleDetailsPage.js +616 -314
- package/dist/pages/WarehouseDetailsPage.js +539 -253
- package/dist/stories/ControlTowerWidgets.stories.d.ts +10 -0
- package/dist/stories/DataTable.stories.d.ts +15 -0
- package/dist/stories/FleetCards.stories.d.ts +9 -0
- package/dist/stories/OrderForms.stories.d.ts +8 -0
- package/dist/stories/RouteMap.stories.d.ts +7 -0
- package/dist/stories/ShipmentTimeline.stories.d.ts +6 -0
- package/package.json +1 -1
- package/src/generated/tracking-quality-operations.ts +407 -0
- package/src/movethewheels/MoveTheWheelsRoot.tsx +16 -0
- package/src/movethewheels/MoveTheWheelsRoutes.tsx +17 -2
- package/src/movethewheels/components/EntityConversationsCard.tsx +143 -0
- package/src/movethewheels/components/maps/MapCanvas.tsx +3 -3
- package/src/movethewheels/events/__tests__/rybbit.test.ts +98 -0
- package/src/movethewheels/events/rybbit.ts +191 -0
- package/src/movethewheels/hooks/useEntityComments.ts +258 -0
- package/src/movethewheels/hooks/useFleet.ts +300 -5
- package/src/movethewheels/hooks/useInventory.ts +231 -3
- package/src/movethewheels/hooks/useMultiModalShipments.ts +8 -1
- package/src/movethewheels/hooks/useOrders.ts +19 -3
- package/src/movethewheels/hooks/useRoutes.ts +14 -2
- package/src/movethewheels/index.ts +1 -0
- package/src/movethewheels/pages/DocumentsLibraryPage.tsx +229 -0
- package/src/movethewheels/pages/DriverDetailsPage.tsx +250 -1
- package/src/movethewheels/pages/NotificationsCenterPage.tsx +331 -0
- package/src/movethewheels/pages/OrderDetailsPage.tsx +8 -0
- package/src/movethewheels/pages/RouteDetailsPage.tsx +6 -0
- package/src/movethewheels/pages/TrackingPage.tsx +8 -0
- package/src/movethewheels/pages/VehicleDetailsPage.tsx +255 -1
- package/src/movethewheels/pages/WarehouseDetailsPage.tsx +266 -2
- package/src/movethewheels/types/index.ts +103 -2
- package/src/stories/ControlTowerWidgets.stories.tsx +150 -0
- package/src/stories/DataTable.stories.tsx +94 -0
- package/src/stories/FleetCards.stories.tsx +77 -0
- package/src/stories/OrderForms.stories.tsx +84 -0
- package/src/stories/RouteMap.stories.tsx +43 -0
- package/src/stories/ShipmentTimeline.stories.tsx +128 -0
|
@@ -3,32 +3,35 @@ import t from "../node_modules/lucide-react/dist/esm/icons/arrow-left.js";
|
|
|
3
3
|
import n from "../node_modules/lucide-react/dist/esm/icons/map-pin.js";
|
|
4
4
|
import r from "../node_modules/lucide-react/dist/esm/icons/fuel.js";
|
|
5
5
|
import i from "../node_modules/lucide-react/dist/esm/icons/user-round.js";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
6
|
+
import ee from "../node_modules/lucide-react/dist/esm/icons/square-pen.js";
|
|
7
|
+
import a from "../node_modules/lucide-react/dist/esm/icons/save.js";
|
|
8
|
+
import o from "../node_modules/lucide-react/dist/esm/icons/mail.js";
|
|
9
|
+
import te from "../node_modules/lucide-react/dist/esm/icons/phone.js";
|
|
10
|
+
import s from "../node_modules/lucide-react/dist/esm/icons/trash-2.js";
|
|
11
|
+
import c from "../node_modules/lucide-react/dist/esm/icons/wrench.js";
|
|
12
|
+
import l from "../node_modules/lucide-react/dist/esm/icons/activity.js";
|
|
13
|
+
import u from "../node_modules/lucide-react/dist/esm/icons/plus.js";
|
|
14
|
+
import { ErrorState as d, LoadingState as f, PageLayout as ne } from "../components/PageLayout.js";
|
|
12
15
|
import { StatusBadge as p, VehicleTypeBadge as m } from "../components/StatusBadge.js";
|
|
13
|
-
import { Avatar as h, AvatarFallback as
|
|
14
|
-
import { toApiVehicleStatus as
|
|
15
|
-
import { VEHICLE_STATUS_LABELS as
|
|
16
|
-
import { useRecordVehicleService as
|
|
17
|
-
import { useRefetchOnLeaveEdit as
|
|
18
|
-
import { VehicleServiceCard as
|
|
19
|
-
import { useMoveTheWheels as
|
|
20
|
-
import { formatDate as
|
|
21
|
-
import { joinPath as
|
|
22
|
-
import { FormError as
|
|
23
|
-
import { Notice as
|
|
24
|
-
import { DocumentsCard as
|
|
25
|
-
import { useEffect as
|
|
26
|
-
import { useLocation as
|
|
27
|
-
import { jsx as
|
|
28
|
-
import { useI18n as
|
|
29
|
-
import { EmphasisPanel as
|
|
16
|
+
import { Avatar as h, AvatarFallback as re, Button as g, Card as _, CardContent as v, CardHeader as y, CardTitle as b, Input as x, Label as S, Progress as C, Select as w, SelectContent as T, SelectItem as E, SelectTrigger as D, SelectValue as O } from "../components/ui.js";
|
|
17
|
+
import { toApiVehicleStatus as k, useFleet as A, useVehicle as j, useVehicleDrivers as M } from "../hooks/useFleet.js";
|
|
18
|
+
import { VEHICLE_STATUS_LABELS as N } from "../constants/index.js";
|
|
19
|
+
import { useRecordVehicleService as ie } from "../hooks/useFleetIntelligence.js";
|
|
20
|
+
import { useRefetchOnLeaveEdit as P } from "../hooks/useRefetchOnLeaveEdit.js";
|
|
21
|
+
import { VehicleServiceCard as ae } from "../components/VehicleServiceCard.js";
|
|
22
|
+
import { useMoveTheWheels as oe } from "../providers/MoveTheWheelsProvider.js";
|
|
23
|
+
import { formatDate as F, formatWeight as se, getInitials as ce } from "../utils/formatters.js";
|
|
24
|
+
import { joinPath as I } from "../utils/navigation.js";
|
|
25
|
+
import { FormError as L } from "../components/FormError.js";
|
|
26
|
+
import { Notice as le, useNotice as ue } from "../components/Notice.js";
|
|
27
|
+
import { DocumentsCard as de } from "../components/DocumentsCard.js";
|
|
28
|
+
import { useEffect as R, useState as z } from "react";
|
|
29
|
+
import { useLocation as fe, useParams as pe } from "react-router";
|
|
30
|
+
import { jsx as B, jsxs as V } from "react/jsx-runtime";
|
|
31
|
+
import { useI18n as me } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
32
|
+
import { EmphasisPanel as he, NextSteps as ge, PagePurpose as _e, ResponsiveDialog as H, ResponsiveDialogContent as ve, ResponsiveDialogDescription as ye, ResponsiveDialogFooter as be, ResponsiveDialogHeader as U, ResponsiveDialogTitle as W } from "@burdenoff/fe-libs/ui";
|
|
30
33
|
// src/movethewheels/pages/VehicleDetailsPage.tsx
|
|
31
|
-
var
|
|
34
|
+
var G = [
|
|
32
35
|
{
|
|
33
36
|
value: "TRUCK",
|
|
34
37
|
label: "Truck"
|
|
@@ -61,10 +64,10 @@ var le = [
|
|
|
61
64
|
value: "DRONE",
|
|
62
65
|
label: "Drone"
|
|
63
66
|
}
|
|
64
|
-
],
|
|
67
|
+
], K = Object.entries(N).map(([e, t]) => ({
|
|
65
68
|
value: e,
|
|
66
69
|
label: t
|
|
67
|
-
})),
|
|
70
|
+
})), q = [
|
|
68
71
|
{
|
|
69
72
|
value: "DIESEL",
|
|
70
73
|
label: "Diesel"
|
|
@@ -85,7 +88,7 @@ var le = [
|
|
|
85
88
|
value: "HYBRID",
|
|
86
89
|
label: "Hybrid"
|
|
87
90
|
}
|
|
88
|
-
],
|
|
91
|
+
], J = [
|
|
89
92
|
{
|
|
90
93
|
value: "owned",
|
|
91
94
|
label: "Owned"
|
|
@@ -99,8 +102,8 @@ var le = [
|
|
|
99
102
|
label: "Rented"
|
|
100
103
|
}
|
|
101
104
|
];
|
|
102
|
-
function
|
|
103
|
-
let { basePath: r, navigate: i } =
|
|
105
|
+
function Y({ editId: n }) {
|
|
106
|
+
let { basePath: r, navigate: i } = oe(), { createVehicle: ee, updateVehicle: o, deleteVehicle: te } = A(), { vehicle: c } = j(n), l = !!n, [u, d] = z({
|
|
104
107
|
vehicleNumber: "",
|
|
105
108
|
type: "VAN",
|
|
106
109
|
make: "",
|
|
@@ -114,181 +117,181 @@ function pe({ editId: n }) {
|
|
|
114
117
|
capacityWeight: "",
|
|
115
118
|
capacityVolume: "",
|
|
116
119
|
capacityPallets: ""
|
|
117
|
-
}), [
|
|
118
|
-
|
|
119
|
-
n &&
|
|
120
|
-
vehicleNumber:
|
|
121
|
-
type:
|
|
122
|
-
make:
|
|
123
|
-
model:
|
|
124
|
-
licensePlate:
|
|
125
|
-
ownershipType:
|
|
126
|
-
year:
|
|
127
|
-
status:
|
|
128
|
-
fuelType:
|
|
129
|
-
fuelEfficiencyLPer100Km:
|
|
130
|
-
capacityWeight:
|
|
131
|
-
capacityVolume:
|
|
132
|
-
capacityPallets:
|
|
120
|
+
}), [f, p] = z(!1), [m, h] = z(null), [re, C] = z(!1), [M, N] = z(!1), [ie, P] = z(null);
|
|
121
|
+
R(() => {
|
|
122
|
+
n && c && d({
|
|
123
|
+
vehicleNumber: c.vehicleNumber ?? "",
|
|
124
|
+
type: c.type ? c.type.toUpperCase() : "VAN",
|
|
125
|
+
make: c.make ?? "",
|
|
126
|
+
model: c.model ?? "",
|
|
127
|
+
licensePlate: c.licensePlate ?? "",
|
|
128
|
+
ownershipType: c.ownershipType ?? "",
|
|
129
|
+
year: c.year ? String(c.year) : "",
|
|
130
|
+
status: c.status,
|
|
131
|
+
fuelType: c.fuelType ?? "",
|
|
132
|
+
fuelEfficiencyLPer100Km: c.fuelEfficiencyLPer100Km === void 0 ? "" : String(c.fuelEfficiencyLPer100Km),
|
|
133
|
+
capacityWeight: c.capacity.weight ? String(c.capacity.weight) : "",
|
|
134
|
+
capacityVolume: c.capacity.volume ? String(c.capacity.volume) : "",
|
|
135
|
+
capacityPallets: c.capacity.pallets ? String(c.capacity.pallets) : ""
|
|
133
136
|
});
|
|
134
|
-
}, [n,
|
|
135
|
-
let
|
|
136
|
-
if (e.preventDefault(), !
|
|
137
|
+
}, [n, c]);
|
|
138
|
+
let ae = () => i?.(I(r, "fleet/vehicles")), F = async (e) => {
|
|
139
|
+
if (e.preventDefault(), !u.vehicleNumber.trim()) h("Vehicle number is required.");
|
|
137
140
|
else {
|
|
138
|
-
|
|
141
|
+
p(!0), h(null);
|
|
139
142
|
try {
|
|
140
143
|
let e = {
|
|
141
|
-
vehicleNumber:
|
|
142
|
-
type:
|
|
143
|
-
make:
|
|
144
|
-
model:
|
|
145
|
-
licensePlate:
|
|
146
|
-
ownershipType:
|
|
147
|
-
year:
|
|
148
|
-
status:
|
|
149
|
-
fuelType:
|
|
150
|
-
fuelEfficiencyLPer100Km:
|
|
151
|
-
capacity:
|
|
152
|
-
weight:
|
|
153
|
-
volume:
|
|
154
|
-
pallets:
|
|
144
|
+
vehicleNumber: u.vehicleNumber.trim(),
|
|
145
|
+
type: u.type,
|
|
146
|
+
make: u.make.trim() || void 0,
|
|
147
|
+
model: u.model.trim() || void 0,
|
|
148
|
+
licensePlate: u.licensePlate.trim() || void 0,
|
|
149
|
+
ownershipType: u.ownershipType || void 0,
|
|
150
|
+
year: u.year ? Number(u.year) : void 0,
|
|
151
|
+
status: k(u.status),
|
|
152
|
+
fuelType: u.fuelType || void 0,
|
|
153
|
+
fuelEfficiencyLPer100Km: u.fuelEfficiencyLPer100Km ? Number(u.fuelEfficiencyLPer100Km) : void 0,
|
|
154
|
+
capacity: u.capacityWeight || u.capacityVolume || u.capacityPallets ? {
|
|
155
|
+
weight: u.capacityWeight ? Number(u.capacityWeight) : void 0,
|
|
156
|
+
volume: u.capacityVolume ? Number(u.capacityVolume) : void 0,
|
|
157
|
+
pallets: u.capacityPallets ? Number(u.capacityPallets) : void 0
|
|
155
158
|
} : void 0
|
|
156
159
|
};
|
|
157
160
|
if (n) {
|
|
158
|
-
let t = await
|
|
159
|
-
i?.(
|
|
161
|
+
let t = await o(n, e);
|
|
162
|
+
i?.(I(r, `fleet/vehicles/${t.id}`));
|
|
160
163
|
} else {
|
|
161
|
-
let t = await
|
|
162
|
-
i?.(
|
|
164
|
+
let t = await ee(e);
|
|
165
|
+
i?.(I(r, `fleet/vehicles/${t.id}`));
|
|
163
166
|
}
|
|
164
167
|
} catch (e) {
|
|
165
|
-
console.error("Failed to create vehicle:", e),
|
|
168
|
+
console.error("Failed to create vehicle:", e), h(e instanceof Error ? e.message : "Failed to create vehicle. Please try again."), p(!1);
|
|
166
169
|
}
|
|
167
170
|
}
|
|
168
171
|
};
|
|
169
|
-
return /* @__PURE__ */
|
|
170
|
-
title:
|
|
172
|
+
return /* @__PURE__ */ V(ne, {
|
|
173
|
+
title: l ? "Edit Vehicle" : "Add Vehicle",
|
|
171
174
|
subtitle: "Register a new vehicle in your fleet",
|
|
172
|
-
icon: /* @__PURE__ */
|
|
173
|
-
headerActions: /* @__PURE__ */
|
|
175
|
+
icon: /* @__PURE__ */ B(e, { size: 24 }),
|
|
176
|
+
headerActions: /* @__PURE__ */ V("div", {
|
|
174
177
|
className: "flex gap-2",
|
|
175
|
-
children: [/* @__PURE__ */
|
|
178
|
+
children: [/* @__PURE__ */ V(g, {
|
|
176
179
|
variant: "outline",
|
|
177
|
-
onClick:
|
|
178
|
-
disabled:
|
|
179
|
-
children: [/* @__PURE__ */
|
|
180
|
-
}), /* @__PURE__ */
|
|
181
|
-
onClick:
|
|
182
|
-
disabled:
|
|
180
|
+
onClick: ae,
|
|
181
|
+
disabled: f,
|
|
182
|
+
children: [/* @__PURE__ */ B(t, { size: 16 }), " Cancel"]
|
|
183
|
+
}), /* @__PURE__ */ V(g, {
|
|
184
|
+
onClick: F,
|
|
185
|
+
disabled: f,
|
|
183
186
|
children: [
|
|
184
|
-
/* @__PURE__ */
|
|
187
|
+
/* @__PURE__ */ B(a, { size: 16 }),
|
|
185
188
|
" ",
|
|
186
|
-
|
|
189
|
+
l ? f ? "Saving..." : "Save Changes" : f ? "Saving..." : "Add Vehicle"
|
|
187
190
|
]
|
|
188
191
|
})]
|
|
189
192
|
}),
|
|
190
193
|
children: [
|
|
191
|
-
/* @__PURE__ */
|
|
192
|
-
icon: /* @__PURE__ */
|
|
194
|
+
/* @__PURE__ */ B(_e, {
|
|
195
|
+
icon: /* @__PURE__ */ B(e, { size: 18 }),
|
|
193
196
|
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
197
|
}),
|
|
195
|
-
/* @__PURE__ */
|
|
196
|
-
onSubmit:
|
|
198
|
+
/* @__PURE__ */ V("form", {
|
|
199
|
+
onSubmit: F,
|
|
197
200
|
className: "max-w-2xl space-y-6",
|
|
198
201
|
children: [
|
|
199
|
-
/* @__PURE__ */
|
|
200
|
-
/* @__PURE__ */
|
|
202
|
+
/* @__PURE__ */ B(L, { message: m }),
|
|
203
|
+
/* @__PURE__ */ V(he, { children: [/* @__PURE__ */ B("h2", {
|
|
201
204
|
className: "text-base font-semibold text-text-primary mb-4",
|
|
202
205
|
children: "Vehicle Details"
|
|
203
|
-
}), /* @__PURE__ */
|
|
206
|
+
}), /* @__PURE__ */ V("div", {
|
|
204
207
|
className: "space-y-4",
|
|
205
208
|
children: [
|
|
206
|
-
/* @__PURE__ */
|
|
209
|
+
/* @__PURE__ */ V("div", {
|
|
207
210
|
className: "grid grid-cols-1 md:grid-cols-2 gap-4",
|
|
208
|
-
children: [/* @__PURE__ */
|
|
211
|
+
children: [/* @__PURE__ */ V("div", {
|
|
209
212
|
className: "space-y-2",
|
|
210
|
-
children: [/* @__PURE__ */
|
|
213
|
+
children: [/* @__PURE__ */ V(S, {
|
|
211
214
|
htmlFor: "vehicleNumber",
|
|
212
|
-
children: ["Vehicle Number ", /* @__PURE__ */
|
|
215
|
+
children: ["Vehicle Number ", /* @__PURE__ */ B("span", {
|
|
213
216
|
className: "text-status-error-text",
|
|
214
217
|
children: "*"
|
|
215
218
|
})]
|
|
216
|
-
}), /* @__PURE__ */
|
|
219
|
+
}), /* @__PURE__ */ B(x, {
|
|
217
220
|
id: "vehicleNumber",
|
|
218
|
-
value:
|
|
219
|
-
onChange: (e) =>
|
|
221
|
+
value: u.vehicleNumber,
|
|
222
|
+
onChange: (e) => d((t) => ({
|
|
220
223
|
...t,
|
|
221
224
|
vehicleNumber: e.target.value
|
|
222
225
|
})),
|
|
223
226
|
placeholder: "MTW-001",
|
|
224
227
|
required: !0
|
|
225
228
|
})]
|
|
226
|
-
}), /* @__PURE__ */
|
|
229
|
+
}), /* @__PURE__ */ V("div", {
|
|
227
230
|
className: "space-y-2",
|
|
228
|
-
children: [/* @__PURE__ */
|
|
231
|
+
children: [/* @__PURE__ */ V(S, {
|
|
229
232
|
htmlFor: "type",
|
|
230
|
-
children: ["Type ", /* @__PURE__ */
|
|
233
|
+
children: ["Type ", /* @__PURE__ */ B("span", {
|
|
231
234
|
className: "text-status-error-text",
|
|
232
235
|
children: "*"
|
|
233
236
|
})]
|
|
234
|
-
}), /* @__PURE__ */
|
|
235
|
-
value:
|
|
236
|
-
onValueChange: (e) =>
|
|
237
|
+
}), /* @__PURE__ */ V(w, {
|
|
238
|
+
value: u.type,
|
|
239
|
+
onValueChange: (e) => d((t) => ({
|
|
237
240
|
...t,
|
|
238
241
|
type: e
|
|
239
242
|
})),
|
|
240
|
-
children: [/* @__PURE__ */
|
|
243
|
+
children: [/* @__PURE__ */ B(D, {
|
|
241
244
|
id: "type",
|
|
242
|
-
children: /* @__PURE__ */
|
|
243
|
-
}), /* @__PURE__ */
|
|
245
|
+
children: /* @__PURE__ */ B(O, {})
|
|
246
|
+
}), /* @__PURE__ */ B(T, { children: G.map((e) => /* @__PURE__ */ B(E, {
|
|
244
247
|
value: e.value,
|
|
245
248
|
children: e.label
|
|
246
249
|
}, e.value)) })]
|
|
247
250
|
})]
|
|
248
251
|
})]
|
|
249
252
|
}),
|
|
250
|
-
/* @__PURE__ */
|
|
253
|
+
/* @__PURE__ */ V("div", {
|
|
251
254
|
className: "grid grid-cols-1 md:grid-cols-3 gap-4",
|
|
252
255
|
children: [
|
|
253
|
-
/* @__PURE__ */
|
|
256
|
+
/* @__PURE__ */ V("div", {
|
|
254
257
|
className: "space-y-2",
|
|
255
|
-
children: [/* @__PURE__ */
|
|
258
|
+
children: [/* @__PURE__ */ B(S, {
|
|
256
259
|
htmlFor: "make",
|
|
257
260
|
children: "Make"
|
|
258
|
-
}), /* @__PURE__ */
|
|
261
|
+
}), /* @__PURE__ */ B(x, {
|
|
259
262
|
id: "make",
|
|
260
|
-
value:
|
|
261
|
-
onChange: (e) =>
|
|
263
|
+
value: u.make,
|
|
264
|
+
onChange: (e) => d((t) => ({
|
|
262
265
|
...t,
|
|
263
266
|
make: e.target.value
|
|
264
267
|
})),
|
|
265
268
|
placeholder: "Ford"
|
|
266
269
|
})]
|
|
267
270
|
}),
|
|
268
|
-
/* @__PURE__ */
|
|
271
|
+
/* @__PURE__ */ V("div", {
|
|
269
272
|
className: "space-y-2",
|
|
270
|
-
children: [/* @__PURE__ */
|
|
273
|
+
children: [/* @__PURE__ */ B(S, {
|
|
271
274
|
htmlFor: "model",
|
|
272
275
|
children: "Model"
|
|
273
|
-
}), /* @__PURE__ */
|
|
276
|
+
}), /* @__PURE__ */ B(x, {
|
|
274
277
|
id: "model",
|
|
275
|
-
value:
|
|
276
|
-
onChange: (e) =>
|
|
278
|
+
value: u.model,
|
|
279
|
+
onChange: (e) => d((t) => ({
|
|
277
280
|
...t,
|
|
278
281
|
model: e.target.value
|
|
279
282
|
})),
|
|
280
283
|
placeholder: "Transit"
|
|
281
284
|
})]
|
|
282
285
|
}),
|
|
283
|
-
/* @__PURE__ */
|
|
286
|
+
/* @__PURE__ */ V("div", {
|
|
284
287
|
className: "space-y-2",
|
|
285
|
-
children: [/* @__PURE__ */
|
|
288
|
+
children: [/* @__PURE__ */ B(S, {
|
|
286
289
|
htmlFor: "licensePlate",
|
|
287
290
|
children: "License Plate"
|
|
288
|
-
}), /* @__PURE__ */
|
|
291
|
+
}), /* @__PURE__ */ B(x, {
|
|
289
292
|
id: "licensePlate",
|
|
290
|
-
value:
|
|
291
|
-
onChange: (e) =>
|
|
293
|
+
value: u.licensePlate,
|
|
294
|
+
onChange: (e) => d((t) => ({
|
|
292
295
|
...t,
|
|
293
296
|
licensePlate: e.target.value
|
|
294
297
|
})),
|
|
@@ -297,62 +300,62 @@ function pe({ editId: n }) {
|
|
|
297
300
|
})
|
|
298
301
|
]
|
|
299
302
|
}),
|
|
300
|
-
/* @__PURE__ */
|
|
303
|
+
/* @__PURE__ */ V("div", {
|
|
301
304
|
className: "grid grid-cols-1 md:grid-cols-3 gap-4",
|
|
302
305
|
children: [
|
|
303
|
-
/* @__PURE__ */
|
|
306
|
+
/* @__PURE__ */ V("div", {
|
|
304
307
|
className: "space-y-2",
|
|
305
|
-
children: [/* @__PURE__ */
|
|
308
|
+
children: [/* @__PURE__ */ B(S, {
|
|
306
309
|
htmlFor: "ownershipType",
|
|
307
310
|
children: "Ownership"
|
|
308
|
-
}), /* @__PURE__ */
|
|
309
|
-
value:
|
|
310
|
-
onValueChange: (e) =>
|
|
311
|
+
}), /* @__PURE__ */ V(w, {
|
|
312
|
+
value: u.ownershipType || void 0,
|
|
313
|
+
onValueChange: (e) => d((t) => ({
|
|
311
314
|
...t,
|
|
312
315
|
ownershipType: e
|
|
313
316
|
})),
|
|
314
|
-
children: [/* @__PURE__ */
|
|
317
|
+
children: [/* @__PURE__ */ B(D, {
|
|
315
318
|
id: "ownershipType",
|
|
316
|
-
children: /* @__PURE__ */
|
|
317
|
-
}), /* @__PURE__ */
|
|
319
|
+
children: /* @__PURE__ */ B(O, { placeholder: "Select ownership" })
|
|
320
|
+
}), /* @__PURE__ */ B(T, { children: J.map((e) => /* @__PURE__ */ B(E, {
|
|
318
321
|
value: e.value,
|
|
319
322
|
children: e.label
|
|
320
323
|
}, e.value)) })]
|
|
321
324
|
})]
|
|
322
325
|
}),
|
|
323
|
-
/* @__PURE__ */
|
|
326
|
+
/* @__PURE__ */ V("div", {
|
|
324
327
|
className: "space-y-2",
|
|
325
|
-
children: [/* @__PURE__ */
|
|
328
|
+
children: [/* @__PURE__ */ B(S, {
|
|
326
329
|
htmlFor: "year",
|
|
327
330
|
children: "Year"
|
|
328
|
-
}), /* @__PURE__ */
|
|
331
|
+
}), /* @__PURE__ */ B(x, {
|
|
329
332
|
id: "year",
|
|
330
333
|
type: "number",
|
|
331
334
|
min: 1980,
|
|
332
335
|
max: (/* @__PURE__ */ new Date()).getFullYear() + 1,
|
|
333
|
-
value:
|
|
334
|
-
onChange: (e) =>
|
|
336
|
+
value: u.year,
|
|
337
|
+
onChange: (e) => d((t) => ({
|
|
335
338
|
...t,
|
|
336
339
|
year: e.target.value
|
|
337
340
|
})),
|
|
338
341
|
placeholder: String((/* @__PURE__ */ new Date()).getFullYear())
|
|
339
342
|
})]
|
|
340
343
|
}),
|
|
341
|
-
/* @__PURE__ */
|
|
344
|
+
/* @__PURE__ */ V("div", {
|
|
342
345
|
className: "space-y-2",
|
|
343
|
-
children: [/* @__PURE__ */
|
|
346
|
+
children: [/* @__PURE__ */ B(S, {
|
|
344
347
|
htmlFor: "vehicleStatus",
|
|
345
348
|
children: "Status"
|
|
346
|
-
}), /* @__PURE__ */
|
|
347
|
-
value:
|
|
348
|
-
onValueChange: (e) =>
|
|
349
|
+
}), /* @__PURE__ */ V(w, {
|
|
350
|
+
value: u.status,
|
|
351
|
+
onValueChange: (e) => d((t) => ({
|
|
349
352
|
...t,
|
|
350
353
|
status: e
|
|
351
354
|
})),
|
|
352
|
-
children: [/* @__PURE__ */
|
|
355
|
+
children: [/* @__PURE__ */ B(D, {
|
|
353
356
|
id: "vehicleStatus",
|
|
354
|
-
children: /* @__PURE__ */
|
|
355
|
-
}), /* @__PURE__ */
|
|
357
|
+
children: /* @__PURE__ */ B(O, {})
|
|
358
|
+
}), /* @__PURE__ */ B(T, { children: K.map((e) => /* @__PURE__ */ B(E, {
|
|
356
359
|
value: e.value,
|
|
357
360
|
children: e.label
|
|
358
361
|
}, e.value)) })]
|
|
@@ -360,42 +363,42 @@ function pe({ editId: n }) {
|
|
|
360
363
|
})
|
|
361
364
|
]
|
|
362
365
|
}),
|
|
363
|
-
/* @__PURE__ */
|
|
366
|
+
/* @__PURE__ */ V("div", {
|
|
364
367
|
className: "grid grid-cols-1 md:grid-cols-2 gap-4",
|
|
365
|
-
children: [/* @__PURE__ */
|
|
368
|
+
children: [/* @__PURE__ */ V("div", {
|
|
366
369
|
className: "space-y-2",
|
|
367
|
-
children: [/* @__PURE__ */
|
|
370
|
+
children: [/* @__PURE__ */ B(S, {
|
|
368
371
|
htmlFor: "fuelType",
|
|
369
372
|
children: "Fuel Type"
|
|
370
|
-
}), /* @__PURE__ */
|
|
371
|
-
value:
|
|
373
|
+
}), /* @__PURE__ */ V(w, {
|
|
374
|
+
value: u.fuelType || void 0,
|
|
372
375
|
onValueChange: (e) => {
|
|
373
|
-
let t =
|
|
374
|
-
|
|
376
|
+
let t = q.find((t) => t.value === e)?.value;
|
|
377
|
+
d((e) => ({
|
|
375
378
|
...e,
|
|
376
379
|
fuelType: t ?? ""
|
|
377
380
|
}));
|
|
378
381
|
},
|
|
379
|
-
children: [/* @__PURE__ */
|
|
382
|
+
children: [/* @__PURE__ */ B(D, {
|
|
380
383
|
id: "fuelType",
|
|
381
|
-
children: /* @__PURE__ */
|
|
382
|
-
}), /* @__PURE__ */
|
|
384
|
+
children: /* @__PURE__ */ B(O, { placeholder: "Select fuel type" })
|
|
385
|
+
}), /* @__PURE__ */ B(T, { children: q.map((e) => /* @__PURE__ */ B(E, {
|
|
383
386
|
value: e.value,
|
|
384
387
|
children: e.label
|
|
385
388
|
}, e.value)) })]
|
|
386
389
|
})]
|
|
387
|
-
}), /* @__PURE__ */
|
|
390
|
+
}), /* @__PURE__ */ V("div", {
|
|
388
391
|
className: "space-y-2",
|
|
389
|
-
children: [/* @__PURE__ */
|
|
392
|
+
children: [/* @__PURE__ */ B(S, {
|
|
390
393
|
htmlFor: "fuelEfficiency",
|
|
391
394
|
children: "Fuel Efficiency (L/100km)"
|
|
392
|
-
}), /* @__PURE__ */
|
|
395
|
+
}), /* @__PURE__ */ B(x, {
|
|
393
396
|
id: "fuelEfficiency",
|
|
394
397
|
type: "number",
|
|
395
398
|
min: 0,
|
|
396
399
|
step: .1,
|
|
397
|
-
value:
|
|
398
|
-
onChange: (e) =>
|
|
400
|
+
value: u.fuelEfficiencyLPer100Km,
|
|
401
|
+
onChange: (e) => d((t) => ({
|
|
399
402
|
...t,
|
|
400
403
|
fuelEfficiencyLPer100Km: e.target.value
|
|
401
404
|
})),
|
|
@@ -403,55 +406,55 @@ function pe({ editId: n }) {
|
|
|
403
406
|
})]
|
|
404
407
|
})]
|
|
405
408
|
}),
|
|
406
|
-
/* @__PURE__ */
|
|
409
|
+
/* @__PURE__ */ V("div", {
|
|
407
410
|
className: "grid grid-cols-1 md:grid-cols-3 gap-4",
|
|
408
411
|
children: [
|
|
409
|
-
/* @__PURE__ */
|
|
412
|
+
/* @__PURE__ */ V("div", {
|
|
410
413
|
className: "space-y-2",
|
|
411
|
-
children: [/* @__PURE__ */
|
|
414
|
+
children: [/* @__PURE__ */ B(S, {
|
|
412
415
|
htmlFor: "capacityWeight",
|
|
413
416
|
children: "Capacity — Weight (kg)"
|
|
414
|
-
}), /* @__PURE__ */
|
|
417
|
+
}), /* @__PURE__ */ B(x, {
|
|
415
418
|
id: "capacityWeight",
|
|
416
419
|
type: "number",
|
|
417
420
|
min: 0,
|
|
418
|
-
value:
|
|
419
|
-
onChange: (e) =>
|
|
421
|
+
value: u.capacityWeight,
|
|
422
|
+
onChange: (e) => d((t) => ({
|
|
420
423
|
...t,
|
|
421
424
|
capacityWeight: e.target.value
|
|
422
425
|
})),
|
|
423
426
|
placeholder: "5000"
|
|
424
427
|
})]
|
|
425
428
|
}),
|
|
426
|
-
/* @__PURE__ */
|
|
429
|
+
/* @__PURE__ */ V("div", {
|
|
427
430
|
className: "space-y-2",
|
|
428
|
-
children: [/* @__PURE__ */
|
|
431
|
+
children: [/* @__PURE__ */ B(S, {
|
|
429
432
|
htmlFor: "capacityVolume",
|
|
430
433
|
children: "Capacity — Volume (m³)"
|
|
431
|
-
}), /* @__PURE__ */
|
|
434
|
+
}), /* @__PURE__ */ B(x, {
|
|
432
435
|
id: "capacityVolume",
|
|
433
436
|
type: "number",
|
|
434
437
|
min: 0,
|
|
435
438
|
step: .1,
|
|
436
|
-
value:
|
|
437
|
-
onChange: (e) =>
|
|
439
|
+
value: u.capacityVolume,
|
|
440
|
+
onChange: (e) => d((t) => ({
|
|
438
441
|
...t,
|
|
439
442
|
capacityVolume: e.target.value
|
|
440
443
|
})),
|
|
441
444
|
placeholder: "18"
|
|
442
445
|
})]
|
|
443
446
|
}),
|
|
444
|
-
/* @__PURE__ */
|
|
447
|
+
/* @__PURE__ */ V("div", {
|
|
445
448
|
className: "space-y-2",
|
|
446
|
-
children: [/* @__PURE__ */
|
|
449
|
+
children: [/* @__PURE__ */ B(S, {
|
|
447
450
|
htmlFor: "capacityPallets",
|
|
448
451
|
children: "Capacity — Pallets"
|
|
449
|
-
}), /* @__PURE__ */
|
|
452
|
+
}), /* @__PURE__ */ B(x, {
|
|
450
453
|
id: "capacityPallets",
|
|
451
454
|
type: "number",
|
|
452
455
|
min: 0,
|
|
453
|
-
value:
|
|
454
|
-
onChange: (e) =>
|
|
456
|
+
value: u.capacityPallets,
|
|
457
|
+
onChange: (e) => d((t) => ({
|
|
455
458
|
...t,
|
|
456
459
|
capacityPallets: e.target.value
|
|
457
460
|
})),
|
|
@@ -462,276 +465,575 @@ function pe({ editId: n }) {
|
|
|
462
465
|
})
|
|
463
466
|
]
|
|
464
467
|
})] }),
|
|
465
|
-
|
|
468
|
+
l && /* @__PURE__ */ V(_, {
|
|
466
469
|
className: "border-status-error-border",
|
|
467
|
-
children: [/* @__PURE__ */
|
|
470
|
+
children: [/* @__PURE__ */ B(y, { children: /* @__PURE__ */ V(b, {
|
|
468
471
|
className: "flex items-center gap-2 text-status-error-text",
|
|
469
|
-
children: [/* @__PURE__ */
|
|
470
|
-
}) }), /* @__PURE__ */
|
|
472
|
+
children: [/* @__PURE__ */ B(s, { size: 18 }), " Delete Vehicle"]
|
|
473
|
+
}) }), /* @__PURE__ */ V(v, { children: [/* @__PURE__ */ B("p", {
|
|
471
474
|
className: "mb-3 text-sm text-text-secondary",
|
|
472
475
|
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__ */
|
|
476
|
+
}), /* @__PURE__ */ V(g, {
|
|
474
477
|
type: "button",
|
|
475
478
|
variant: "outline",
|
|
476
479
|
className: "border-status-error-border text-status-error-text hover:bg-status-error-bg-subtle",
|
|
477
|
-
onClick: () =>
|
|
478
|
-
children: [/* @__PURE__ */
|
|
480
|
+
onClick: () => C(!0),
|
|
481
|
+
children: [/* @__PURE__ */ B(s, { size: 16 }), " Delete this vehicle"]
|
|
479
482
|
})] })]
|
|
480
483
|
})
|
|
481
484
|
]
|
|
482
485
|
}),
|
|
483
|
-
/* @__PURE__ */
|
|
484
|
-
open:
|
|
485
|
-
onOpenChange:
|
|
486
|
-
children: /* @__PURE__ */
|
|
487
|
-
/* @__PURE__ */
|
|
486
|
+
/* @__PURE__ */ B(H, {
|
|
487
|
+
open: re,
|
|
488
|
+
onOpenChange: C,
|
|
489
|
+
children: /* @__PURE__ */ V(ve, { children: [
|
|
490
|
+
/* @__PURE__ */ V(U, { children: [/* @__PURE__ */ B(W, { children: "Delete this vehicle?" }), /* @__PURE__ */ V(ye, { children: [
|
|
488
491
|
"This removes ",
|
|
489
|
-
|
|
492
|
+
u.vehicleNumber || "this vehicle",
|
|
490
493
|
" from the active fleet. It cannot be undone from here."
|
|
491
494
|
] })] }),
|
|
492
|
-
/* @__PURE__ */
|
|
495
|
+
/* @__PURE__ */ B("div", {
|
|
493
496
|
className: "px-1",
|
|
494
|
-
children: /* @__PURE__ */
|
|
497
|
+
children: /* @__PURE__ */ B(L, { message: ie })
|
|
495
498
|
}),
|
|
496
|
-
/* @__PURE__ */
|
|
499
|
+
/* @__PURE__ */ V(be, { children: [/* @__PURE__ */ B(g, {
|
|
497
500
|
variant: "outline",
|
|
498
|
-
onClick: () =>
|
|
499
|
-
disabled:
|
|
501
|
+
onClick: () => C(!1),
|
|
502
|
+
disabled: M,
|
|
500
503
|
children: "Cancel"
|
|
501
|
-
}), /* @__PURE__ */
|
|
504
|
+
}), /* @__PURE__ */ B(g, {
|
|
502
505
|
className: "bg-status-error-text text-text-inverse hover:opacity-90",
|
|
503
506
|
onClick: async () => {
|
|
504
507
|
if (n) {
|
|
505
|
-
|
|
508
|
+
N(!0), P(null);
|
|
506
509
|
try {
|
|
507
|
-
await
|
|
510
|
+
await te(n), C(!1), i?.(I(r, "fleet/vehicles"));
|
|
508
511
|
} catch (e) {
|
|
509
|
-
|
|
512
|
+
P(e instanceof Error ? e.message : "Failed to delete vehicle.");
|
|
510
513
|
} finally {
|
|
511
|
-
|
|
514
|
+
N(!1);
|
|
512
515
|
}
|
|
513
516
|
}
|
|
514
517
|
},
|
|
515
|
-
disabled:
|
|
516
|
-
children:
|
|
518
|
+
disabled: M,
|
|
519
|
+
children: M ? "Deleting..." : "Delete vehicle"
|
|
517
520
|
})] })
|
|
518
521
|
] })
|
|
519
522
|
})
|
|
520
523
|
]
|
|
521
524
|
});
|
|
522
525
|
}
|
|
523
|
-
function
|
|
524
|
-
let { vehicleId:
|
|
525
|
-
|
|
526
|
+
function X() {
|
|
527
|
+
let { vehicleId: a } = pe(), { basePath: k, navigate: A } = oe(), { vehicle: N, isLoading: L, error: R, refetch: H, addMaintenanceLog: ve, removeMaintenanceLog: ye } = j(a), be = ie(), { message: U, notify: W } = ue(), [G, K] = z(!1), [q, J] = z({
|
|
528
|
+
serviceDate: (/* @__PURE__ */ new Date()).toISOString().slice(0, 10),
|
|
529
|
+
serviceType: "PREVENTIVE",
|
|
530
|
+
description: "",
|
|
531
|
+
mileage: "",
|
|
532
|
+
cost: "",
|
|
533
|
+
vendor: ""
|
|
534
|
+
}), [X, xe] = z(!1), { t: Se } = me(), Ce = (e, t) => {
|
|
535
|
+
let n = Se(e);
|
|
526
536
|
return n === e ? t : n;
|
|
527
|
-
},
|
|
528
|
-
|
|
529
|
-
let { drivers:
|
|
530
|
-
return
|
|
537
|
+
}, Z = fe().pathname.endsWith("/edit");
|
|
538
|
+
P(Z, H);
|
|
539
|
+
let { drivers: Q, isLoading: we, error: Te } = M(Z ? void 0 : a), Ee = () => A?.(I(k, "fleet/vehicles")), $ = (e) => A?.(I(k, e));
|
|
540
|
+
return a ? Z ? /* @__PURE__ */ B(Y, { editId: a }) : L ? /* @__PURE__ */ B(f, { message: "Loading vehicle details..." }) : R || !N ? /* @__PURE__ */ B(d, {
|
|
531
541
|
title: "Vehicle not found",
|
|
532
|
-
onRetry:
|
|
533
|
-
}) : /* @__PURE__ */
|
|
534
|
-
title:
|
|
535
|
-
subtitle: `${
|
|
536
|
-
icon: /* @__PURE__ */
|
|
537
|
-
headerActions: /* @__PURE__ */
|
|
542
|
+
onRetry: H
|
|
543
|
+
}) : /* @__PURE__ */ V(ne, {
|
|
544
|
+
title: N.vehicleNumber,
|
|
545
|
+
subtitle: `${N.make} ${N.model}${N.year ? ` (${N.year})` : ""}`,
|
|
546
|
+
icon: /* @__PURE__ */ B(e, { size: 24 }),
|
|
547
|
+
headerActions: /* @__PURE__ */ V("div", {
|
|
538
548
|
className: "flex gap-2",
|
|
539
|
-
children: [/* @__PURE__ */
|
|
549
|
+
children: [/* @__PURE__ */ V(g, {
|
|
540
550
|
variant: "outline",
|
|
541
|
-
onClick:
|
|
542
|
-
children: [/* @__PURE__ */
|
|
543
|
-
}), /* @__PURE__ */
|
|
544
|
-
onClick: () =>
|
|
545
|
-
children: [/* @__PURE__ */
|
|
551
|
+
onClick: Ee,
|
|
552
|
+
children: [/* @__PURE__ */ B(t, { size: 16 }), " Back"]
|
|
553
|
+
}), /* @__PURE__ */ V(g, {
|
|
554
|
+
onClick: () => A?.(I(k, "fleet/vehicles/" + a + "/edit")),
|
|
555
|
+
children: [/* @__PURE__ */ B(ee, { size: 16 }), " Edit"]
|
|
546
556
|
})]
|
|
547
557
|
}),
|
|
548
|
-
headerContent: /* @__PURE__ */
|
|
558
|
+
headerContent: /* @__PURE__ */ V("div", {
|
|
549
559
|
className: "flex gap-2",
|
|
550
|
-
children: [/* @__PURE__ */
|
|
551
|
-
status:
|
|
560
|
+
children: [/* @__PURE__ */ B(p, {
|
|
561
|
+
status: N.status,
|
|
552
562
|
type: "vehicle"
|
|
553
|
-
}), /* @__PURE__ */
|
|
563
|
+
}), /* @__PURE__ */ B(m, { type: N.type })]
|
|
554
564
|
}),
|
|
555
565
|
children: [
|
|
556
|
-
/* @__PURE__ */
|
|
557
|
-
icon: /* @__PURE__ */
|
|
566
|
+
/* @__PURE__ */ B(_e, {
|
|
567
|
+
icon: /* @__PURE__ */ B(e, { size: 18 }),
|
|
558
568
|
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."
|
|
559
569
|
}),
|
|
560
|
-
/* @__PURE__ */
|
|
570
|
+
/* @__PURE__ */ B(ge, {
|
|
561
571
|
storageKey: "movethewheels-vehicle-details",
|
|
562
572
|
steps: [{
|
|
563
573
|
id: "assign",
|
|
564
574
|
label: "Assign to a delivery",
|
|
565
575
|
description: "Put this vehicle on an order that fits its capacity.",
|
|
566
|
-
icon: /* @__PURE__ */
|
|
576
|
+
icon: /* @__PURE__ */ B(n, { size: 16 }),
|
|
567
577
|
onClick: () => $("orders")
|
|
568
578
|
}, {
|
|
569
579
|
id: "driver",
|
|
570
|
-
label:
|
|
580
|
+
label: Q.length > 0 ? "Review the assigned driver" : "Assign a driver",
|
|
571
581
|
description: "A vehicle needs a driver before it can be dispatched.",
|
|
572
|
-
icon: /* @__PURE__ */
|
|
573
|
-
done:
|
|
574
|
-
onClick: () =>
|
|
582
|
+
icon: /* @__PURE__ */ B(i, { size: 16 }),
|
|
583
|
+
done: Q.length > 0,
|
|
584
|
+
onClick: () => Q[0] ? $(`fleet/drivers/${Q[0].id}`) : $("fleet/drivers")
|
|
575
585
|
}]
|
|
576
586
|
}),
|
|
577
|
-
|
|
587
|
+
U && /* @__PURE__ */ B("div", {
|
|
578
588
|
className: "mb-2",
|
|
579
|
-
children: /* @__PURE__ */
|
|
589
|
+
children: /* @__PURE__ */ B(le, { message: U })
|
|
580
590
|
}),
|
|
581
|
-
/* @__PURE__ */
|
|
591
|
+
/* @__PURE__ */ V("div", {
|
|
582
592
|
className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
|
|
583
|
-
children: [/* @__PURE__ */
|
|
593
|
+
children: [/* @__PURE__ */ V("div", {
|
|
584
594
|
className: "lg:col-span-2 space-y-6",
|
|
585
595
|
children: [
|
|
586
|
-
/* @__PURE__ */
|
|
596
|
+
/* @__PURE__ */ V(he, { children: [/* @__PURE__ */ B("h2", {
|
|
587
597
|
className: "text-base font-semibold text-text-primary mb-4",
|
|
588
598
|
children: "Vehicle Information"
|
|
589
|
-
}), /* @__PURE__ */
|
|
599
|
+
}), /* @__PURE__ */ V("div", {
|
|
590
600
|
className: "grid grid-cols-2 md:grid-cols-3 gap-6",
|
|
591
601
|
children: [
|
|
592
|
-
/* @__PURE__ */
|
|
602
|
+
/* @__PURE__ */ V("div", { children: [/* @__PURE__ */ B("p", {
|
|
593
603
|
className: "text-sm text-text-secondary",
|
|
594
604
|
children: "Type"
|
|
595
|
-
}), /* @__PURE__ */
|
|
605
|
+
}), /* @__PURE__ */ B("p", {
|
|
596
606
|
className: "font-medium capitalize",
|
|
597
|
-
children:
|
|
607
|
+
children: N.type
|
|
598
608
|
})] }),
|
|
599
|
-
/* @__PURE__ */
|
|
609
|
+
/* @__PURE__ */ V("div", { children: [/* @__PURE__ */ B("p", {
|
|
600
610
|
className: "text-sm text-text-secondary",
|
|
601
611
|
children: "Make"
|
|
602
|
-
}), /* @__PURE__ */
|
|
612
|
+
}), /* @__PURE__ */ B("p", {
|
|
603
613
|
className: "font-medium",
|
|
604
|
-
children:
|
|
614
|
+
children: N.make || "—"
|
|
605
615
|
})] }),
|
|
606
|
-
/* @__PURE__ */
|
|
616
|
+
/* @__PURE__ */ V("div", { children: [/* @__PURE__ */ B("p", {
|
|
607
617
|
className: "text-sm text-text-secondary",
|
|
608
618
|
children: "Model"
|
|
609
|
-
}), /* @__PURE__ */
|
|
619
|
+
}), /* @__PURE__ */ B("p", {
|
|
610
620
|
className: "font-medium",
|
|
611
|
-
children:
|
|
621
|
+
children: N.model || "—"
|
|
612
622
|
})] }),
|
|
613
|
-
/* @__PURE__ */
|
|
623
|
+
/* @__PURE__ */ V("div", { children: [/* @__PURE__ */ B("p", {
|
|
614
624
|
className: "text-sm text-text-secondary",
|
|
615
625
|
children: "Year"
|
|
616
|
-
}), /* @__PURE__ */
|
|
626
|
+
}), /* @__PURE__ */ B("p", {
|
|
617
627
|
className: "font-medium",
|
|
618
|
-
children:
|
|
628
|
+
children: N.year ?? "—"
|
|
619
629
|
})] }),
|
|
620
|
-
/* @__PURE__ */
|
|
630
|
+
/* @__PURE__ */ V("div", { children: [/* @__PURE__ */ B("p", {
|
|
621
631
|
className: "text-sm text-text-secondary",
|
|
622
632
|
children: "License Plate"
|
|
623
|
-
}), /* @__PURE__ */
|
|
633
|
+
}), /* @__PURE__ */ B("p", {
|
|
624
634
|
className: "font-medium",
|
|
625
|
-
children:
|
|
635
|
+
children: N.licensePlate || "—"
|
|
626
636
|
})] }),
|
|
627
|
-
/* @__PURE__ */
|
|
637
|
+
/* @__PURE__ */ V("div", { children: [/* @__PURE__ */ B("p", {
|
|
628
638
|
className: "text-sm text-text-secondary",
|
|
629
639
|
children: "Ownership"
|
|
630
|
-
}), /* @__PURE__ */
|
|
640
|
+
}), /* @__PURE__ */ B("p", {
|
|
631
641
|
className: "font-medium capitalize",
|
|
632
|
-
children:
|
|
642
|
+
children: N.ownershipType || "—"
|
|
633
643
|
})] })
|
|
634
644
|
]
|
|
635
645
|
})] }),
|
|
636
|
-
/* @__PURE__ */
|
|
646
|
+
/* @__PURE__ */ V(_, { children: [/* @__PURE__ */ B(y, { children: /* @__PURE__ */ B(b, { children: "Capacity" }) }), /* @__PURE__ */ B(v, { children: /* @__PURE__ */ V("div", {
|
|
637
647
|
className: "grid grid-cols-1 sm:grid-cols-3 gap-6",
|
|
638
648
|
children: [
|
|
639
|
-
/* @__PURE__ */
|
|
649
|
+
/* @__PURE__ */ V("div", { children: [/* @__PURE__ */ B("p", {
|
|
640
650
|
className: "text-sm text-text-secondary",
|
|
641
651
|
children: "Weight"
|
|
642
|
-
}), /* @__PURE__ */
|
|
652
|
+
}), /* @__PURE__ */ B("p", {
|
|
643
653
|
className: "text-2xl font-bold",
|
|
644
|
-
children:
|
|
654
|
+
children: N.capacity.weight === void 0 ? "—" : se(N.capacity.weight)
|
|
645
655
|
})] }),
|
|
646
|
-
/* @__PURE__ */
|
|
656
|
+
/* @__PURE__ */ V("div", { children: [/* @__PURE__ */ B("p", {
|
|
647
657
|
className: "text-sm text-text-secondary",
|
|
648
658
|
children: "Volume"
|
|
649
|
-
}), /* @__PURE__ */
|
|
659
|
+
}), /* @__PURE__ */ B("p", {
|
|
650
660
|
className: "text-2xl font-bold",
|
|
651
|
-
children:
|
|
661
|
+
children: N.capacity.volume === void 0 ? "—" : `${N.capacity.volume} m³`
|
|
652
662
|
})] }),
|
|
653
|
-
|
|
663
|
+
N.capacity.pallets && /* @__PURE__ */ V("div", { children: [/* @__PURE__ */ B("p", {
|
|
654
664
|
className: "text-sm text-text-secondary",
|
|
655
665
|
children: "Pallets"
|
|
656
|
-
}), /* @__PURE__ */
|
|
666
|
+
}), /* @__PURE__ */ B("p", {
|
|
657
667
|
className: "text-2xl font-bold",
|
|
658
|
-
children:
|
|
668
|
+
children: N.capacity.pallets
|
|
659
669
|
})] })
|
|
660
670
|
]
|
|
661
671
|
}) })] }),
|
|
662
|
-
/* @__PURE__ */
|
|
672
|
+
/* @__PURE__ */ B(de, {
|
|
663
673
|
entityType: "vehicle",
|
|
664
|
-
entityId:
|
|
665
|
-
})
|
|
674
|
+
entityId: N.id
|
|
675
|
+
}),
|
|
676
|
+
/* @__PURE__ */ V(_, { children: [/* @__PURE__ */ B(y, { children: /* @__PURE__ */ V(b, {
|
|
677
|
+
className: "flex items-center gap-2",
|
|
678
|
+
children: [/* @__PURE__ */ B(l, {
|
|
679
|
+
size: 18,
|
|
680
|
+
"aria-hidden": "true"
|
|
681
|
+
}), " Utilization & Diagnostics"]
|
|
682
|
+
}) }), /* @__PURE__ */ V(v, {
|
|
683
|
+
className: "space-y-4",
|
|
684
|
+
children: [N.utilizationSummary ? /* @__PURE__ */ V("div", {
|
|
685
|
+
className: "grid grid-cols-2 sm:grid-cols-4 gap-4",
|
|
686
|
+
children: [
|
|
687
|
+
/* @__PURE__ */ V("div", { children: [/* @__PURE__ */ B("p", {
|
|
688
|
+
className: "text-xs text-text-secondary",
|
|
689
|
+
children: "Routes"
|
|
690
|
+
}), /* @__PURE__ */ V("p", {
|
|
691
|
+
className: "text-lg font-semibold",
|
|
692
|
+
children: [
|
|
693
|
+
N.utilizationSummary.completedRoutes,
|
|
694
|
+
"/",
|
|
695
|
+
N.utilizationSummary.totalRoutes
|
|
696
|
+
]
|
|
697
|
+
})] }),
|
|
698
|
+
/* @__PURE__ */ V("div", { children: [/* @__PURE__ */ B("p", {
|
|
699
|
+
className: "text-xs text-text-secondary",
|
|
700
|
+
children: "Deliveries"
|
|
701
|
+
}), /* @__PURE__ */ V("p", {
|
|
702
|
+
className: "text-lg font-semibold",
|
|
703
|
+
children: [
|
|
704
|
+
N.utilizationSummary.completedDeliveryJobs,
|
|
705
|
+
"/",
|
|
706
|
+
N.utilizationSummary.totalDeliveryJobs
|
|
707
|
+
]
|
|
708
|
+
})] }),
|
|
709
|
+
/* @__PURE__ */ V("div", { children: [/* @__PURE__ */ B("p", {
|
|
710
|
+
className: "text-xs text-text-secondary",
|
|
711
|
+
children: "Total Distance"
|
|
712
|
+
}), /* @__PURE__ */ V("p", {
|
|
713
|
+
className: "text-lg font-semibold",
|
|
714
|
+
children: [N.utilizationSummary.totalDistanceKm.toLocaleString(), " km"]
|
|
715
|
+
})] }),
|
|
716
|
+
/* @__PURE__ */ V("div", { children: [/* @__PURE__ */ B("p", {
|
|
717
|
+
className: "text-xs text-text-secondary",
|
|
718
|
+
children: "Utilization"
|
|
719
|
+
}), /* @__PURE__ */ B("p", {
|
|
720
|
+
className: "text-lg font-semibold",
|
|
721
|
+
children: N.utilizationSummary.utilizationRate === void 0 ? "—" : `${N.utilizationSummary.utilizationRate}%`
|
|
722
|
+
})] })
|
|
723
|
+
]
|
|
724
|
+
}) : /* @__PURE__ */ B("p", {
|
|
725
|
+
className: "text-sm text-text-secondary",
|
|
726
|
+
children: "No route utilization recorded yet."
|
|
727
|
+
}), N.diagnostics ? /* @__PURE__ */ V("div", {
|
|
728
|
+
className: "border-t border-border-seam pt-3 grid grid-cols-2 sm:grid-cols-3 gap-3 text-sm",
|
|
729
|
+
children: [
|
|
730
|
+
/* @__PURE__ */ V("div", { children: [/* @__PURE__ */ B("p", {
|
|
731
|
+
className: "text-xs text-text-secondary",
|
|
732
|
+
children: "Engine Status"
|
|
733
|
+
}), /* @__PURE__ */ B("p", {
|
|
734
|
+
className: "font-medium",
|
|
735
|
+
children: N.diagnostics.engineStatus ?? "Not reported"
|
|
736
|
+
})] }),
|
|
737
|
+
/* @__PURE__ */ V("div", { children: [/* @__PURE__ */ B("p", {
|
|
738
|
+
className: "text-xs text-text-secondary",
|
|
739
|
+
children: "Battery Voltage"
|
|
740
|
+
}), /* @__PURE__ */ B("p", {
|
|
741
|
+
className: "font-medium",
|
|
742
|
+
children: N.diagnostics.batteryVoltage === void 0 ? "—" : `${N.diagnostics.batteryVoltage} V`
|
|
743
|
+
})] }),
|
|
744
|
+
/* @__PURE__ */ V("div", { children: [/* @__PURE__ */ B("p", {
|
|
745
|
+
className: "text-xs text-text-secondary",
|
|
746
|
+
children: "Fault Codes"
|
|
747
|
+
}), /* @__PURE__ */ B("p", {
|
|
748
|
+
className: "font-medium",
|
|
749
|
+
children: N.diagnostics.faultCodes && N.diagnostics.faultCodes.length > 0 ? N.diagnostics.faultCodes.join(", ") : "None"
|
|
750
|
+
})] })
|
|
751
|
+
]
|
|
752
|
+
}) : /* @__PURE__ */ B("p", {
|
|
753
|
+
className: "border-t border-border-seam pt-3 text-xs text-text-secondary",
|
|
754
|
+
children: "No engine diagnostics snapshot recorded for this vehicle yet."
|
|
755
|
+
})]
|
|
756
|
+
})] }),
|
|
757
|
+
/* @__PURE__ */ V(_, { children: [/* @__PURE__ */ V(y, {
|
|
758
|
+
className: "flex flex-row items-center justify-between gap-2",
|
|
759
|
+
children: [/* @__PURE__ */ V(b, {
|
|
760
|
+
className: "flex items-center gap-2",
|
|
761
|
+
children: [/* @__PURE__ */ B(c, {
|
|
762
|
+
size: 18,
|
|
763
|
+
"aria-hidden": "true"
|
|
764
|
+
}), " Maintenance History"]
|
|
765
|
+
}), /* @__PURE__ */ V(g, {
|
|
766
|
+
variant: "outline",
|
|
767
|
+
size: "sm",
|
|
768
|
+
onClick: () => K((e) => !e),
|
|
769
|
+
children: [
|
|
770
|
+
/* @__PURE__ */ B(u, {
|
|
771
|
+
size: 14,
|
|
772
|
+
"aria-hidden": "true"
|
|
773
|
+
}),
|
|
774
|
+
" ",
|
|
775
|
+
G ? "Close" : "Add record"
|
|
776
|
+
]
|
|
777
|
+
})]
|
|
778
|
+
}), /* @__PURE__ */ V(v, {
|
|
779
|
+
className: "space-y-4",
|
|
780
|
+
children: [G && /* @__PURE__ */ V("form", {
|
|
781
|
+
className: "space-y-3 rounded-lg border border-border-seam p-3",
|
|
782
|
+
onSubmit: async (e) => {
|
|
783
|
+
if (e.preventDefault(), q.description.trim()) {
|
|
784
|
+
xe(!0);
|
|
785
|
+
try {
|
|
786
|
+
await ve({
|
|
787
|
+
serviceDate: `${q.serviceDate}T12:00:00.000Z`,
|
|
788
|
+
serviceType: q.serviceType,
|
|
789
|
+
description: q.description.trim(),
|
|
790
|
+
mileage: q.mileage ? Number(q.mileage) : void 0,
|
|
791
|
+
cost: q.cost ? Number(q.cost) : void 0,
|
|
792
|
+
vendor: q.vendor.trim() || void 0
|
|
793
|
+
}), J({
|
|
794
|
+
serviceDate: (/* @__PURE__ */ new Date()).toISOString().slice(0, 10),
|
|
795
|
+
serviceType: "PREVENTIVE",
|
|
796
|
+
description: "",
|
|
797
|
+
mileage: "",
|
|
798
|
+
cost: "",
|
|
799
|
+
vendor: ""
|
|
800
|
+
}), K(!1), W("Maintenance log saved.");
|
|
801
|
+
} finally {
|
|
802
|
+
xe(!1);
|
|
803
|
+
}
|
|
804
|
+
}
|
|
805
|
+
},
|
|
806
|
+
children: [
|
|
807
|
+
/* @__PURE__ */ V("div", {
|
|
808
|
+
className: "grid grid-cols-1 sm:grid-cols-2 gap-3",
|
|
809
|
+
children: [/* @__PURE__ */ V("div", {
|
|
810
|
+
className: "space-y-1",
|
|
811
|
+
children: [/* @__PURE__ */ B(S, {
|
|
812
|
+
htmlFor: "maint-date",
|
|
813
|
+
children: "Date"
|
|
814
|
+
}), /* @__PURE__ */ B(x, {
|
|
815
|
+
id: "maint-date",
|
|
816
|
+
type: "date",
|
|
817
|
+
required: !0,
|
|
818
|
+
value: q.serviceDate,
|
|
819
|
+
onChange: (e) => J((t) => ({
|
|
820
|
+
...t,
|
|
821
|
+
serviceDate: e.target.value
|
|
822
|
+
}))
|
|
823
|
+
})]
|
|
824
|
+
}), /* @__PURE__ */ V("div", {
|
|
825
|
+
className: "space-y-1",
|
|
826
|
+
children: [/* @__PURE__ */ B(S, {
|
|
827
|
+
htmlFor: "maint-type",
|
|
828
|
+
children: "Type"
|
|
829
|
+
}), /* @__PURE__ */ V(w, {
|
|
830
|
+
value: q.serviceType,
|
|
831
|
+
onValueChange: (e) => J((t) => ({
|
|
832
|
+
...t,
|
|
833
|
+
serviceType: e
|
|
834
|
+
})),
|
|
835
|
+
children: [/* @__PURE__ */ B(D, {
|
|
836
|
+
id: "maint-type",
|
|
837
|
+
children: /* @__PURE__ */ B(O, {})
|
|
838
|
+
}), /* @__PURE__ */ B(T, { children: [
|
|
839
|
+
"PREVENTIVE",
|
|
840
|
+
"REPAIR",
|
|
841
|
+
"INSPECTION",
|
|
842
|
+
"TIRE",
|
|
843
|
+
"BRAKE",
|
|
844
|
+
"OIL_CHANGE",
|
|
845
|
+
"OTHER"
|
|
846
|
+
].map((e) => /* @__PURE__ */ B(E, {
|
|
847
|
+
value: e,
|
|
848
|
+
children: e.replace("_", " ")
|
|
849
|
+
}, e)) })]
|
|
850
|
+
})]
|
|
851
|
+
})]
|
|
852
|
+
}),
|
|
853
|
+
/* @__PURE__ */ V("div", {
|
|
854
|
+
className: "space-y-1",
|
|
855
|
+
children: [/* @__PURE__ */ B(S, {
|
|
856
|
+
htmlFor: "maint-desc",
|
|
857
|
+
children: "Description"
|
|
858
|
+
}), /* @__PURE__ */ B(x, {
|
|
859
|
+
id: "maint-desc",
|
|
860
|
+
required: !0,
|
|
861
|
+
placeholder: "Oil change and brake inspection",
|
|
862
|
+
value: q.description,
|
|
863
|
+
onChange: (e) => J((t) => ({
|
|
864
|
+
...t,
|
|
865
|
+
description: e.target.value
|
|
866
|
+
}))
|
|
867
|
+
})]
|
|
868
|
+
}),
|
|
869
|
+
/* @__PURE__ */ V("div", {
|
|
870
|
+
className: "grid grid-cols-1 sm:grid-cols-3 gap-3",
|
|
871
|
+
children: [
|
|
872
|
+
/* @__PURE__ */ V("div", {
|
|
873
|
+
className: "space-y-1",
|
|
874
|
+
children: [/* @__PURE__ */ B(S, {
|
|
875
|
+
htmlFor: "maint-mileage",
|
|
876
|
+
children: "Odometer"
|
|
877
|
+
}), /* @__PURE__ */ B(x, {
|
|
878
|
+
id: "maint-mileage",
|
|
879
|
+
type: "number",
|
|
880
|
+
min: 0,
|
|
881
|
+
value: q.mileage,
|
|
882
|
+
onChange: (e) => J((t) => ({
|
|
883
|
+
...t,
|
|
884
|
+
mileage: e.target.value
|
|
885
|
+
}))
|
|
886
|
+
})]
|
|
887
|
+
}),
|
|
888
|
+
/* @__PURE__ */ V("div", {
|
|
889
|
+
className: "space-y-1",
|
|
890
|
+
children: [/* @__PURE__ */ B(S, {
|
|
891
|
+
htmlFor: "maint-cost",
|
|
892
|
+
children: "Cost"
|
|
893
|
+
}), /* @__PURE__ */ B(x, {
|
|
894
|
+
id: "maint-cost",
|
|
895
|
+
type: "number",
|
|
896
|
+
min: 0,
|
|
897
|
+
step: "0.01",
|
|
898
|
+
value: q.cost,
|
|
899
|
+
onChange: (e) => J((t) => ({
|
|
900
|
+
...t,
|
|
901
|
+
cost: e.target.value
|
|
902
|
+
}))
|
|
903
|
+
})]
|
|
904
|
+
}),
|
|
905
|
+
/* @__PURE__ */ V("div", {
|
|
906
|
+
className: "space-y-1",
|
|
907
|
+
children: [/* @__PURE__ */ B(S, {
|
|
908
|
+
htmlFor: "maint-vendor",
|
|
909
|
+
children: "Vendor"
|
|
910
|
+
}), /* @__PURE__ */ B(x, {
|
|
911
|
+
id: "maint-vendor",
|
|
912
|
+
placeholder: "Workshop name",
|
|
913
|
+
value: q.vendor,
|
|
914
|
+
onChange: (e) => J((t) => ({
|
|
915
|
+
...t,
|
|
916
|
+
vendor: e.target.value
|
|
917
|
+
}))
|
|
918
|
+
})]
|
|
919
|
+
})
|
|
920
|
+
]
|
|
921
|
+
}),
|
|
922
|
+
/* @__PURE__ */ B(g, {
|
|
923
|
+
type: "submit",
|
|
924
|
+
size: "sm",
|
|
925
|
+
disabled: X,
|
|
926
|
+
children: X ? "Saving…" : "Save maintenance record"
|
|
927
|
+
})
|
|
928
|
+
]
|
|
929
|
+
}), N.maintenanceLogs && N.maintenanceLogs.length > 0 ? /* @__PURE__ */ B("ul", {
|
|
930
|
+
className: "divide-y divide-border-seam",
|
|
931
|
+
children: N.maintenanceLogs.map((e) => /* @__PURE__ */ V("li", {
|
|
932
|
+
className: "flex items-start justify-between gap-3 py-2.5 text-sm",
|
|
933
|
+
children: [/* @__PURE__ */ V("div", {
|
|
934
|
+
className: "space-y-0.5",
|
|
935
|
+
children: [/* @__PURE__ */ V("p", {
|
|
936
|
+
className: "font-medium",
|
|
937
|
+
children: [
|
|
938
|
+
e.serviceType.replace("_", " "),
|
|
939
|
+
" — ",
|
|
940
|
+
e.description
|
|
941
|
+
]
|
|
942
|
+
}), /* @__PURE__ */ V("p", {
|
|
943
|
+
className: "text-xs text-text-secondary",
|
|
944
|
+
children: [
|
|
945
|
+
F(e.serviceDate, "short"),
|
|
946
|
+
e.mileage === void 0 ? "" : ` · ${e.mileage.toLocaleString()} km`,
|
|
947
|
+
e.cost === void 0 ? "" : ` · ${e.cost} ${e.currency ?? "USD"}`,
|
|
948
|
+
e.vendor ? ` · ${e.vendor}` : ""
|
|
949
|
+
]
|
|
950
|
+
})]
|
|
951
|
+
}), /* @__PURE__ */ B(g, {
|
|
952
|
+
variant: "ghost",
|
|
953
|
+
size: "sm",
|
|
954
|
+
className: "text-status-error-text",
|
|
955
|
+
"aria-label": `Delete maintenance record ${e.description}`,
|
|
956
|
+
onClick: () => void ye(e.id),
|
|
957
|
+
children: /* @__PURE__ */ B(s, {
|
|
958
|
+
size: 14,
|
|
959
|
+
"aria-hidden": "true"
|
|
960
|
+
})
|
|
961
|
+
})]
|
|
962
|
+
}, e.id))
|
|
963
|
+
}) : /* @__PURE__ */ B("p", {
|
|
964
|
+
className: "text-sm text-text-secondary",
|
|
965
|
+
children: "No maintenance records logged yet."
|
|
966
|
+
})]
|
|
967
|
+
})] })
|
|
666
968
|
]
|
|
667
|
-
}), /* @__PURE__ */
|
|
969
|
+
}), /* @__PURE__ */ V("div", {
|
|
668
970
|
className: "space-y-6",
|
|
669
971
|
children: [
|
|
670
|
-
/* @__PURE__ */
|
|
972
|
+
/* @__PURE__ */ V(_, { children: [/* @__PURE__ */ B(y, { children: /* @__PURE__ */ V(b, {
|
|
671
973
|
className: "flex items-center gap-2",
|
|
672
|
-
children: [/* @__PURE__ */
|
|
673
|
-
}) }), /* @__PURE__ */
|
|
974
|
+
children: [/* @__PURE__ */ B(r, { size: 18 }), " Fuel & Mileage"]
|
|
975
|
+
}) }), /* @__PURE__ */ V(v, {
|
|
674
976
|
className: "space-y-4",
|
|
675
977
|
children: [
|
|
676
|
-
|
|
978
|
+
N.fuelLevel !== void 0 && /* @__PURE__ */ V("div", { children: [/* @__PURE__ */ V("div", {
|
|
677
979
|
className: "flex justify-between text-sm mb-2",
|
|
678
|
-
children: [/* @__PURE__ */
|
|
679
|
-
}), /* @__PURE__ */
|
|
680
|
-
|
|
980
|
+
children: [/* @__PURE__ */ B("span", { children: "Fuel Level" }), /* @__PURE__ */ V("span", { children: [N.fuelLevel, "%"] })]
|
|
981
|
+
}), /* @__PURE__ */ B(C, { value: N.fuelLevel })] }),
|
|
982
|
+
N.mileage !== void 0 && /* @__PURE__ */ V("div", { children: [/* @__PURE__ */ B("p", {
|
|
681
983
|
className: "text-sm text-text-secondary",
|
|
682
984
|
children: "Total Mileage"
|
|
683
|
-
}), /* @__PURE__ */
|
|
985
|
+
}), /* @__PURE__ */ V("p", {
|
|
684
986
|
className: "text-2xl font-bold",
|
|
685
987
|
children: [
|
|
686
|
-
|
|
988
|
+
N.mileage.toLocaleString(),
|
|
687
989
|
" ",
|
|
688
|
-
/* @__PURE__ */
|
|
990
|
+
/* @__PURE__ */ B("span", {
|
|
689
991
|
className: "text-sm font-normal",
|
|
690
992
|
children: "miles"
|
|
691
993
|
})
|
|
692
994
|
]
|
|
693
995
|
})] }),
|
|
694
|
-
(
|
|
996
|
+
(N.fuelType || N.fuelEfficiencyLPer100Km !== void 0) && /* @__PURE__ */ V("div", {
|
|
695
997
|
className: "grid grid-cols-2 gap-4",
|
|
696
|
-
children: [
|
|
998
|
+
children: [N.fuelType && /* @__PURE__ */ V("div", { children: [/* @__PURE__ */ B("p", {
|
|
697
999
|
className: "text-sm text-text-secondary",
|
|
698
1000
|
children: "Fuel Type"
|
|
699
|
-
}), /* @__PURE__ */
|
|
1001
|
+
}), /* @__PURE__ */ B("p", {
|
|
700
1002
|
className: "font-medium",
|
|
701
|
-
children:
|
|
702
|
-
})] }),
|
|
1003
|
+
children: N.fuelType
|
|
1004
|
+
})] }), N.fuelEfficiencyLPer100Km !== void 0 && /* @__PURE__ */ V("div", { children: [/* @__PURE__ */ B("p", {
|
|
703
1005
|
className: "text-sm text-text-secondary",
|
|
704
1006
|
children: "Efficiency"
|
|
705
|
-
}), /* @__PURE__ */
|
|
1007
|
+
}), /* @__PURE__ */ V("p", {
|
|
706
1008
|
className: "font-medium",
|
|
707
|
-
children: [
|
|
1009
|
+
children: [N.fuelEfficiencyLPer100Km, " L/100km"]
|
|
708
1010
|
})] })]
|
|
709
1011
|
})
|
|
710
1012
|
]
|
|
711
1013
|
})] }),
|
|
712
|
-
/* @__PURE__ */
|
|
1014
|
+
/* @__PURE__ */ V(_, { children: [/* @__PURE__ */ B(y, { children: /* @__PURE__ */ V(b, {
|
|
713
1015
|
className: "flex items-center gap-2",
|
|
714
|
-
children: [/* @__PURE__ */
|
|
715
|
-
}) }), /* @__PURE__ */
|
|
1016
|
+
children: [/* @__PURE__ */ B(i, { size: 18 }), " Assigned Driver"]
|
|
1017
|
+
}) }), /* @__PURE__ */ B(v, {
|
|
716
1018
|
className: "space-y-4",
|
|
717
|
-
children:
|
|
1019
|
+
children: we ? /* @__PURE__ */ B("p", {
|
|
718
1020
|
className: "text-sm text-text-secondary",
|
|
719
1021
|
children: "Loading assignment…"
|
|
720
|
-
}) :
|
|
1022
|
+
}) : Te ? /* @__PURE__ */ B("p", {
|
|
721
1023
|
className: "text-sm text-status-error-text",
|
|
722
|
-
children:
|
|
723
|
-
}) :
|
|
1024
|
+
children: Te.message
|
|
1025
|
+
}) : Q.length === 0 ? /* @__PURE__ */ V("div", {
|
|
724
1026
|
className: "space-y-3",
|
|
725
|
-
children: [/* @__PURE__ */
|
|
1027
|
+
children: [/* @__PURE__ */ B("p", {
|
|
726
1028
|
className: "text-sm text-text-secondary",
|
|
727
1029
|
children: "No driver is assigned to this vehicle yet."
|
|
728
|
-
}), /* @__PURE__ */
|
|
1030
|
+
}), /* @__PURE__ */ B(g, {
|
|
729
1031
|
variant: "outline",
|
|
730
1032
|
size: "sm",
|
|
731
1033
|
onClick: () => $("fleet/drivers"),
|
|
732
1034
|
children: "Assign from the roster"
|
|
733
1035
|
})]
|
|
734
|
-
}) :
|
|
1036
|
+
}) : Q.map((e) => /* @__PURE__ */ V("div", {
|
|
735
1037
|
role: "button",
|
|
736
1038
|
tabIndex: 0,
|
|
737
1039
|
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",
|
|
@@ -739,34 +1041,34 @@ function me() {
|
|
|
739
1041
|
onKeyDown: (t) => {
|
|
740
1042
|
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), $(`fleet/drivers/${e.id}`));
|
|
741
1043
|
},
|
|
742
|
-
children: [/* @__PURE__ */
|
|
1044
|
+
children: [/* @__PURE__ */ B(h, { children: /* @__PURE__ */ B(re, { children: ce(e.fullName) }) }), /* @__PURE__ */ V("div", {
|
|
743
1045
|
className: "min-w-0 space-y-1",
|
|
744
1046
|
children: [
|
|
745
|
-
/* @__PURE__ */
|
|
1047
|
+
/* @__PURE__ */ B("p", {
|
|
746
1048
|
className: "font-medium",
|
|
747
1049
|
children: e.fullName
|
|
748
1050
|
}),
|
|
749
|
-
/* @__PURE__ */
|
|
1051
|
+
/* @__PURE__ */ B("p", {
|
|
750
1052
|
className: "text-xs text-text-secondary",
|
|
751
1053
|
children: e.employeeId
|
|
752
1054
|
}),
|
|
753
|
-
/* @__PURE__ */
|
|
1055
|
+
/* @__PURE__ */ B(p, {
|
|
754
1056
|
status: e.status,
|
|
755
1057
|
type: "driver",
|
|
756
1058
|
size: "sm"
|
|
757
1059
|
}),
|
|
758
|
-
e.email && /* @__PURE__ */
|
|
1060
|
+
e.email && /* @__PURE__ */ V("p", {
|
|
759
1061
|
className: "flex items-center gap-1.5 truncate text-sm text-text-secondary",
|
|
760
1062
|
children: [
|
|
761
|
-
/* @__PURE__ */
|
|
1063
|
+
/* @__PURE__ */ B(o, { size: 13 }),
|
|
762
1064
|
" ",
|
|
763
1065
|
e.email
|
|
764
1066
|
]
|
|
765
1067
|
}),
|
|
766
|
-
e.phone && /* @__PURE__ */
|
|
1068
|
+
e.phone && /* @__PURE__ */ V("p", {
|
|
767
1069
|
className: "flex items-center gap-1.5 text-sm text-text-secondary",
|
|
768
1070
|
children: [
|
|
769
|
-
/* @__PURE__ */
|
|
1071
|
+
/* @__PURE__ */ B(te, { size: 13 }),
|
|
770
1072
|
" ",
|
|
771
1073
|
e.phone
|
|
772
1074
|
]
|
|
@@ -775,27 +1077,27 @@ function me() {
|
|
|
775
1077
|
})]
|
|
776
1078
|
}, e.id))
|
|
777
1079
|
})] }),
|
|
778
|
-
/* @__PURE__ */
|
|
779
|
-
vehicle:
|
|
780
|
-
t:
|
|
1080
|
+
/* @__PURE__ */ B(ae, {
|
|
1081
|
+
vehicle: N,
|
|
1082
|
+
t: Ce,
|
|
781
1083
|
onRecord: async (e) => {
|
|
782
|
-
await
|
|
1084
|
+
await be(N.id, e), W(Ce("movethewheels.vehicles.service.saved", "Service recorded.")), H();
|
|
783
1085
|
}
|
|
784
1086
|
}),
|
|
785
|
-
|
|
1087
|
+
N.currentLocation && /* @__PURE__ */ V(_, { children: [/* @__PURE__ */ B(y, { children: /* @__PURE__ */ V(b, {
|
|
786
1088
|
className: "flex items-center gap-2",
|
|
787
|
-
children: [/* @__PURE__ */
|
|
788
|
-
}) }), /* @__PURE__ */
|
|
1089
|
+
children: [/* @__PURE__ */ B(n, { size: 18 }), " Current Location"]
|
|
1090
|
+
}) }), /* @__PURE__ */ V(v, { children: [/* @__PURE__ */ B("p", {
|
|
789
1091
|
className: "text-sm",
|
|
790
|
-
children:
|
|
791
|
-
}), /* @__PURE__ */
|
|
1092
|
+
children: N.currentLocation.address || "Location updating..."
|
|
1093
|
+
}), /* @__PURE__ */ B("p", {
|
|
792
1094
|
className: "text-xs text-text-secondary mt-1",
|
|
793
|
-
children:
|
|
1095
|
+
children: N.currentLocation.timestamp ? `Updated ${F(N.currentLocation.timestamp, "relative")}` : "Update time not recorded"
|
|
794
1096
|
})] })] })
|
|
795
1097
|
]
|
|
796
1098
|
})]
|
|
797
1099
|
})
|
|
798
1100
|
]
|
|
799
|
-
}) : /* @__PURE__ */
|
|
1101
|
+
}) : /* @__PURE__ */ B(Y, {});
|
|
800
1102
|
}
|
|
801
|
-
export {
|
|
1103
|
+
export { X as default };
|