@burdenoff/microfe-movethewheels 2026.1031.3 → 2026.1031.4
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 +136 -127
- package/dist/MoveTheWheelsRoutes.js +140 -135
- package/dist/components/DocumentsCard.js +11 -11
- package/dist/components/ProofOfDeliveryCard.js +13 -13
- package/dist/components/ShipmentRiskDialog.js +24 -24
- package/dist/components/ShippingQuoteResults.js +46 -46
- package/dist/components/TrackingAlertList.js +17 -17
- package/dist/generated/tracking-quality-operations.d.ts +56 -0
- package/dist/hooks/useOrderDispatch.js +17 -17
- package/dist/movethewheels/pages/SettingsPage.d.ts +1 -0
- package/dist/movethewheels/providers/ModuleSettingsProvider.d.ts +17 -0
- package/dist/movethewheels/utils/formatters.d.ts +23 -3
- package/dist/movethewheels/utils/moduleSettings.d.ts +52 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/bell.js +11 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/key-round.js +14 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/plug.js +22 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/rotate-ccw.js +11 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/settings.js +13 -0
- package/dist/pages/AnalyticsPage.js +27 -27
- package/dist/pages/CreateOrderPage.js +340 -317
- package/dist/pages/CustomerDetailsPage.js +246 -246
- package/dist/pages/CustomersPage.js +19 -19
- package/dist/pages/DashboardPage.js +24 -24
- package/dist/pages/DeliveryCapturePage.js +74 -74
- package/dist/pages/DriverDetailsPage.js +337 -337
- package/dist/pages/DriversPage.js +26 -26
- package/dist/pages/FinancePage.js +26 -26
- package/dist/pages/InventoryPage.js +28 -28
- package/dist/pages/LiveTrackingPage.js +108 -108
- package/dist/pages/MarketplacePage.js +44 -44
- package/dist/pages/OrderDetailsPage.js +306 -306
- package/dist/pages/OrdersListPage.js +27 -27
- package/dist/pages/ProductDetailsPage.js +89 -89
- package/dist/pages/ProductsPage.js +73 -73
- package/dist/pages/RouteDetailsPage.js +282 -285
- package/dist/pages/RoutesPage.js +78 -78
- package/dist/pages/SettingsPage.js +459 -0
- package/dist/pages/TrackingPage.js +41 -41
- package/dist/pages/VehicleDetailsPage.js +207 -207
- package/dist/pages/VehiclesPage.js +17 -16
- package/dist/pages/WarehouseDetailsPage.js +132 -132
- package/dist/providers/ModuleSettingsProvider.js +74 -0
- package/dist/utils/formatters.js +53 -26
- package/dist/utils/moduleSettings.js +132 -0
- package/package.json +3 -2
- package/src/generated/tracking-quality-operations.ts +62 -0
- package/src/movethewheels/MoveTheWheelsRoot.tsx +14 -3
- package/src/movethewheels/MoveTheWheelsRoutes.tsx +9 -0
- package/src/movethewheels/pages/CreateOrderPage.tsx +38 -6
- package/src/movethewheels/pages/ProductsPage.tsx +2 -2
- package/src/movethewheels/pages/RouteDetailsPage.tsx +3 -6
- package/src/movethewheels/pages/RoutesPage.tsx +2 -2
- package/src/movethewheels/pages/SettingsPage.tsx +516 -0
- package/src/movethewheels/pages/VehicleDetailsPage.tsx +4 -2
- package/src/movethewheels/pages/VehiclesPage.tsx +2 -1
- package/src/movethewheels/providers/ModuleSettingsProvider.tsx +133 -0
- package/src/movethewheels/utils/formatters.ts +69 -10
- package/src/movethewheels/utils/moduleSettings.ts +224 -0
|
@@ -10,25 +10,25 @@ import { Truck as c } from "../node_modules/lucide-react/dist/esm/icons/truck.js
|
|
|
10
10
|
import { UserRound as l } from "../node_modules/lucide-react/dist/esm/icons/user-round.js";
|
|
11
11
|
import { joinPath as u } from "../utils/navigation.js";
|
|
12
12
|
import { useMoveTheWheels as d } from "../providers/MoveTheWheelsProvider.js";
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import { DocumentsCard as
|
|
22
|
-
import { useRefetchOnLeaveEdit as
|
|
23
|
-
import { useRecordVehicleService as
|
|
24
|
-
import { VehicleServiceCard as
|
|
13
|
+
import { formatDate as f, formatWeight as p, getInitials as m } from "../utils/formatters.js";
|
|
14
|
+
import { toApiVehicleStatus as h, useFleet as g, useVehicle as _, useVehicleDrivers as v } from "../hooks/useFleet.js";
|
|
15
|
+
import { Avatar as y, AvatarFallback as b, Button as x, Card as S, CardContent as C, CardHeader as w, CardTitle as T, Input as E, Label as D, Progress as O, Select as k, SelectContent as A, SelectItem as j, SelectTrigger as M, SelectValue as N } from "../components/ui.js";
|
|
16
|
+
import { ErrorState as P, LoadingState as F, PageLayout as I } from "../components/PageLayout.js";
|
|
17
|
+
import { VEHICLE_STATUS_LABELS as L } from "../constants/index.js";
|
|
18
|
+
import { StatusBadge as R, VehicleTypeBadge as z } from "../components/StatusBadge.js";
|
|
19
|
+
import { FormError as B } from "../components/FormError.js";
|
|
20
|
+
import { Notice as V, useNotice as H } from "../components/Notice.js";
|
|
21
|
+
import { DocumentsCard as U } from "../components/DocumentsCard.js";
|
|
22
|
+
import { useRefetchOnLeaveEdit as W } from "../hooks/useRefetchOnLeaveEdit.js";
|
|
23
|
+
import { useRecordVehicleService as ee } from "../hooks/useFleetIntelligence.js";
|
|
24
|
+
import { VehicleServiceCard as te } from "../components/VehicleServiceCard.js";
|
|
25
25
|
import { useEffect as G, useState as K } from "react";
|
|
26
|
-
import { useLocation as
|
|
26
|
+
import { useLocation as ne, useParams as re } from "react-router";
|
|
27
27
|
import { jsx as q, jsxs as J } from "react/jsx-runtime";
|
|
28
|
-
import { useI18n as
|
|
29
|
-
import { EmphasisPanel as Y, NextSteps as
|
|
28
|
+
import { useI18n as ie } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
29
|
+
import { EmphasisPanel as Y, NextSteps as ae, PagePurpose as X, ResponsiveDialog as Z, ResponsiveDialogContent as Q, ResponsiveDialogDescription as $, ResponsiveDialogFooter as oe, ResponsiveDialogHeader as se, ResponsiveDialogTitle as ce } from "@burdenoff/fe-libs/ui";
|
|
30
30
|
//#region src/movethewheels/pages/VehicleDetailsPage.tsx
|
|
31
|
-
var
|
|
31
|
+
var le = [
|
|
32
32
|
{
|
|
33
33
|
value: "TRUCK",
|
|
34
34
|
label: "Truck"
|
|
@@ -61,10 +61,10 @@ var ce = [
|
|
|
61
61
|
value: "DRONE",
|
|
62
62
|
label: "Drone"
|
|
63
63
|
}
|
|
64
|
-
],
|
|
64
|
+
], ue = Object.entries(L).map(([e, t]) => ({
|
|
65
65
|
value: e,
|
|
66
66
|
label: t
|
|
67
|
-
})),
|
|
67
|
+
})), de = [
|
|
68
68
|
{
|
|
69
69
|
value: "DIESEL",
|
|
70
70
|
label: "Diesel"
|
|
@@ -85,7 +85,7 @@ var ce = [
|
|
|
85
85
|
value: "HYBRID",
|
|
86
86
|
label: "Hybrid"
|
|
87
87
|
}
|
|
88
|
-
],
|
|
88
|
+
], fe = [
|
|
89
89
|
{
|
|
90
90
|
value: "owned",
|
|
91
91
|
label: "Owned"
|
|
@@ -99,8 +99,8 @@ var ce = [
|
|
|
99
99
|
label: "Rented"
|
|
100
100
|
}
|
|
101
101
|
];
|
|
102
|
-
function
|
|
103
|
-
let { basePath: n, navigate: r } = d(), { createVehicle: i, updateVehicle: o, deleteVehicle: l } =
|
|
102
|
+
function pe({ editId: t }) {
|
|
103
|
+
let { basePath: n, navigate: r } = d(), { createVehicle: i, updateVehicle: o, deleteVehicle: l } = g(), { vehicle: f } = _(t), p = !!t, [m, v] = K({
|
|
104
104
|
vehicleNumber: "",
|
|
105
105
|
type: "VAN",
|
|
106
106
|
make: "",
|
|
@@ -114,46 +114,46 @@ function fe({ editId: t }) {
|
|
|
114
114
|
capacityWeight: "",
|
|
115
115
|
capacityVolume: "",
|
|
116
116
|
capacityPallets: ""
|
|
117
|
-
}), [
|
|
117
|
+
}), [y, b] = K(!1), [O, P] = K(null), [F, L] = K(!1), [R, z] = K(!1), [V, H] = K(null);
|
|
118
118
|
G(() => {
|
|
119
|
-
t &&
|
|
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:
|
|
119
|
+
t && f && v({
|
|
120
|
+
vehicleNumber: f.vehicleNumber ?? "",
|
|
121
|
+
type: f.type ? f.type.toUpperCase() : "VAN",
|
|
122
|
+
make: f.make ?? "",
|
|
123
|
+
model: f.model ?? "",
|
|
124
|
+
licensePlate: f.licensePlate ?? "",
|
|
125
|
+
ownershipType: f.ownershipType ?? "",
|
|
126
|
+
year: f.year ? String(f.year) : "",
|
|
127
|
+
status: f.status,
|
|
128
|
+
fuelType: f.fuelType ?? "",
|
|
129
|
+
fuelEfficiencyLPer100Km: f.fuelEfficiencyLPer100Km === void 0 ? "" : String(f.fuelEfficiencyLPer100Km),
|
|
130
|
+
capacityWeight: f.capacity.weight ? String(f.capacity.weight) : "",
|
|
131
|
+
capacityVolume: f.capacity.volume ? String(f.capacity.volume) : "",
|
|
132
|
+
capacityPallets: f.capacity.pallets ? String(f.capacity.pallets) : ""
|
|
133
133
|
});
|
|
134
|
-
}, [t,
|
|
134
|
+
}, [t, f]);
|
|
135
135
|
let U = () => r?.(u(n, "fleet/vehicles")), W = async (e) => {
|
|
136
|
-
if (e.preventDefault(), !
|
|
137
|
-
|
|
136
|
+
if (e.preventDefault(), !m.vehicleNumber.trim()) {
|
|
137
|
+
P("Vehicle number is required.");
|
|
138
138
|
return;
|
|
139
139
|
}
|
|
140
|
-
|
|
140
|
+
b(!0), P(null);
|
|
141
141
|
try {
|
|
142
142
|
let e = {
|
|
143
|
-
vehicleNumber:
|
|
144
|
-
type:
|
|
145
|
-
make:
|
|
146
|
-
model:
|
|
147
|
-
licensePlate:
|
|
148
|
-
ownershipType:
|
|
149
|
-
year:
|
|
150
|
-
status:
|
|
151
|
-
fuelType:
|
|
152
|
-
fuelEfficiencyLPer100Km:
|
|
153
|
-
capacity:
|
|
154
|
-
weight:
|
|
155
|
-
volume:
|
|
156
|
-
pallets:
|
|
143
|
+
vehicleNumber: m.vehicleNumber.trim(),
|
|
144
|
+
type: m.type,
|
|
145
|
+
make: m.make.trim() || void 0,
|
|
146
|
+
model: m.model.trim() || void 0,
|
|
147
|
+
licensePlate: m.licensePlate.trim() || void 0,
|
|
148
|
+
ownershipType: m.ownershipType || void 0,
|
|
149
|
+
year: m.year ? Number(m.year) : void 0,
|
|
150
|
+
status: h(m.status),
|
|
151
|
+
fuelType: m.fuelType || void 0,
|
|
152
|
+
fuelEfficiencyLPer100Km: m.fuelEfficiencyLPer100Km ? Number(m.fuelEfficiencyLPer100Km) : void 0,
|
|
153
|
+
capacity: m.capacityWeight || m.capacityVolume || m.capacityPallets ? {
|
|
154
|
+
weight: m.capacityWeight ? Number(m.capacityWeight) : void 0,
|
|
155
|
+
volume: m.capacityVolume ? Number(m.capacityVolume) : void 0,
|
|
156
|
+
pallets: m.capacityPallets ? Number(m.capacityPallets) : void 0
|
|
157
157
|
} : void 0
|
|
158
158
|
};
|
|
159
159
|
if (t) {
|
|
@@ -164,27 +164,27 @@ function fe({ editId: t }) {
|
|
|
164
164
|
r?.(u(n, `fleet/vehicles/${t.id}`));
|
|
165
165
|
}
|
|
166
166
|
} catch (e) {
|
|
167
|
-
console.error("Failed to create vehicle:", e),
|
|
167
|
+
console.error("Failed to create vehicle:", e), P(e instanceof Error ? e.message : "Failed to create vehicle. Please try again."), b(!1);
|
|
168
168
|
}
|
|
169
169
|
};
|
|
170
|
-
return /* @__PURE__ */ J(
|
|
171
|
-
title:
|
|
170
|
+
return /* @__PURE__ */ J(I, {
|
|
171
|
+
title: p ? "Edit Vehicle" : "Add Vehicle",
|
|
172
172
|
subtitle: "Register a new vehicle in your fleet",
|
|
173
173
|
icon: /* @__PURE__ */ q(c, { size: 24 }),
|
|
174
174
|
headerActions: /* @__PURE__ */ J("div", {
|
|
175
175
|
className: "flex gap-2",
|
|
176
|
-
children: [/* @__PURE__ */ J(
|
|
176
|
+
children: [/* @__PURE__ */ J(x, {
|
|
177
177
|
variant: "outline",
|
|
178
178
|
onClick: U,
|
|
179
|
-
disabled:
|
|
179
|
+
disabled: y,
|
|
180
180
|
children: [/* @__PURE__ */ q(e, { size: 16 }), " Cancel"]
|
|
181
|
-
}), /* @__PURE__ */ J(
|
|
181
|
+
}), /* @__PURE__ */ J(x, {
|
|
182
182
|
onClick: W,
|
|
183
|
-
disabled:
|
|
183
|
+
disabled: y,
|
|
184
184
|
children: [
|
|
185
185
|
/* @__PURE__ */ q(a, { size: 16 }),
|
|
186
186
|
" ",
|
|
187
|
-
|
|
187
|
+
p ? y ? "Saving..." : "Save Changes" : y ? "Saving..." : "Add Vehicle"
|
|
188
188
|
]
|
|
189
189
|
})]
|
|
190
190
|
}),
|
|
@@ -197,7 +197,7 @@ function fe({ editId: t }) {
|
|
|
197
197
|
onSubmit: W,
|
|
198
198
|
className: "max-w-2xl space-y-6",
|
|
199
199
|
children: [
|
|
200
|
-
/* @__PURE__ */ q(
|
|
200
|
+
/* @__PURE__ */ q(B, { message: O }),
|
|
201
201
|
/* @__PURE__ */ J(Y, { children: [/* @__PURE__ */ q("h2", {
|
|
202
202
|
className: "text-base font-semibold text-text-primary mb-4",
|
|
203
203
|
children: "Vehicle Details"
|
|
@@ -208,16 +208,16 @@ function fe({ editId: t }) {
|
|
|
208
208
|
className: "grid grid-cols-1 md:grid-cols-2 gap-4",
|
|
209
209
|
children: [/* @__PURE__ */ J("div", {
|
|
210
210
|
className: "space-y-2",
|
|
211
|
-
children: [/* @__PURE__ */ J(
|
|
211
|
+
children: [/* @__PURE__ */ J(D, {
|
|
212
212
|
htmlFor: "vehicleNumber",
|
|
213
213
|
children: ["Vehicle Number ", /* @__PURE__ */ q("span", {
|
|
214
214
|
className: "text-status-error-text",
|
|
215
215
|
children: "*"
|
|
216
216
|
})]
|
|
217
|
-
}), /* @__PURE__ */ q(
|
|
217
|
+
}), /* @__PURE__ */ q(E, {
|
|
218
218
|
id: "vehicleNumber",
|
|
219
|
-
value:
|
|
220
|
-
onChange: (e) =>
|
|
219
|
+
value: m.vehicleNumber,
|
|
220
|
+
onChange: (e) => v((t) => ({
|
|
221
221
|
...t,
|
|
222
222
|
vehicleNumber: e.target.value
|
|
223
223
|
})),
|
|
@@ -226,22 +226,22 @@ function fe({ editId: t }) {
|
|
|
226
226
|
})]
|
|
227
227
|
}), /* @__PURE__ */ J("div", {
|
|
228
228
|
className: "space-y-2",
|
|
229
|
-
children: [/* @__PURE__ */ J(
|
|
229
|
+
children: [/* @__PURE__ */ J(D, {
|
|
230
230
|
htmlFor: "type",
|
|
231
231
|
children: ["Type ", /* @__PURE__ */ q("span", {
|
|
232
232
|
className: "text-status-error-text",
|
|
233
233
|
children: "*"
|
|
234
234
|
})]
|
|
235
|
-
}), /* @__PURE__ */ J(
|
|
236
|
-
value:
|
|
237
|
-
onValueChange: (e) =>
|
|
235
|
+
}), /* @__PURE__ */ J(k, {
|
|
236
|
+
value: m.type,
|
|
237
|
+
onValueChange: (e) => v((t) => ({
|
|
238
238
|
...t,
|
|
239
239
|
type: e
|
|
240
240
|
})),
|
|
241
|
-
children: [/* @__PURE__ */ q(
|
|
241
|
+
children: [/* @__PURE__ */ q(M, {
|
|
242
242
|
id: "type",
|
|
243
|
-
children: /* @__PURE__ */ q(
|
|
244
|
-
}), /* @__PURE__ */ q(
|
|
243
|
+
children: /* @__PURE__ */ q(N, {})
|
|
244
|
+
}), /* @__PURE__ */ q(A, { children: le.map((e) => /* @__PURE__ */ q(j, {
|
|
245
245
|
value: e.value,
|
|
246
246
|
children: e.label
|
|
247
247
|
}, e.value)) })]
|
|
@@ -253,13 +253,13 @@ function fe({ editId: t }) {
|
|
|
253
253
|
children: [
|
|
254
254
|
/* @__PURE__ */ J("div", {
|
|
255
255
|
className: "space-y-2",
|
|
256
|
-
children: [/* @__PURE__ */ q(
|
|
256
|
+
children: [/* @__PURE__ */ q(D, {
|
|
257
257
|
htmlFor: "make",
|
|
258
258
|
children: "Make"
|
|
259
|
-
}), /* @__PURE__ */ q(
|
|
259
|
+
}), /* @__PURE__ */ q(E, {
|
|
260
260
|
id: "make",
|
|
261
|
-
value:
|
|
262
|
-
onChange: (e) =>
|
|
261
|
+
value: m.make,
|
|
262
|
+
onChange: (e) => v((t) => ({
|
|
263
263
|
...t,
|
|
264
264
|
make: e.target.value
|
|
265
265
|
})),
|
|
@@ -268,13 +268,13 @@ function fe({ editId: t }) {
|
|
|
268
268
|
}),
|
|
269
269
|
/* @__PURE__ */ J("div", {
|
|
270
270
|
className: "space-y-2",
|
|
271
|
-
children: [/* @__PURE__ */ q(
|
|
271
|
+
children: [/* @__PURE__ */ q(D, {
|
|
272
272
|
htmlFor: "model",
|
|
273
273
|
children: "Model"
|
|
274
|
-
}), /* @__PURE__ */ q(
|
|
274
|
+
}), /* @__PURE__ */ q(E, {
|
|
275
275
|
id: "model",
|
|
276
|
-
value:
|
|
277
|
-
onChange: (e) =>
|
|
276
|
+
value: m.model,
|
|
277
|
+
onChange: (e) => v((t) => ({
|
|
278
278
|
...t,
|
|
279
279
|
model: e.target.value
|
|
280
280
|
})),
|
|
@@ -283,13 +283,13 @@ function fe({ editId: t }) {
|
|
|
283
283
|
}),
|
|
284
284
|
/* @__PURE__ */ J("div", {
|
|
285
285
|
className: "space-y-2",
|
|
286
|
-
children: [/* @__PURE__ */ q(
|
|
286
|
+
children: [/* @__PURE__ */ q(D, {
|
|
287
287
|
htmlFor: "licensePlate",
|
|
288
288
|
children: "License Plate"
|
|
289
|
-
}), /* @__PURE__ */ q(
|
|
289
|
+
}), /* @__PURE__ */ q(E, {
|
|
290
290
|
id: "licensePlate",
|
|
291
|
-
value:
|
|
292
|
-
onChange: (e) =>
|
|
291
|
+
value: m.licensePlate,
|
|
292
|
+
onChange: (e) => v((t) => ({
|
|
293
293
|
...t,
|
|
294
294
|
licensePlate: e.target.value
|
|
295
295
|
})),
|
|
@@ -303,19 +303,19 @@ function fe({ editId: t }) {
|
|
|
303
303
|
children: [
|
|
304
304
|
/* @__PURE__ */ J("div", {
|
|
305
305
|
className: "space-y-2",
|
|
306
|
-
children: [/* @__PURE__ */ q(
|
|
306
|
+
children: [/* @__PURE__ */ q(D, {
|
|
307
307
|
htmlFor: "ownershipType",
|
|
308
308
|
children: "Ownership"
|
|
309
|
-
}), /* @__PURE__ */ J(
|
|
310
|
-
value:
|
|
311
|
-
onValueChange: (e) =>
|
|
309
|
+
}), /* @__PURE__ */ J(k, {
|
|
310
|
+
value: m.ownershipType || void 0,
|
|
311
|
+
onValueChange: (e) => v((t) => ({
|
|
312
312
|
...t,
|
|
313
313
|
ownershipType: e
|
|
314
314
|
})),
|
|
315
|
-
children: [/* @__PURE__ */ q(
|
|
315
|
+
children: [/* @__PURE__ */ q(M, {
|
|
316
316
|
id: "ownershipType",
|
|
317
|
-
children: /* @__PURE__ */ q(
|
|
318
|
-
}), /* @__PURE__ */ q(
|
|
317
|
+
children: /* @__PURE__ */ q(N, { placeholder: "Select ownership" })
|
|
318
|
+
}), /* @__PURE__ */ q(A, { children: fe.map((e) => /* @__PURE__ */ q(j, {
|
|
319
319
|
value: e.value,
|
|
320
320
|
children: e.label
|
|
321
321
|
}, e.value)) })]
|
|
@@ -323,16 +323,16 @@ function fe({ editId: t }) {
|
|
|
323
323
|
}),
|
|
324
324
|
/* @__PURE__ */ J("div", {
|
|
325
325
|
className: "space-y-2",
|
|
326
|
-
children: [/* @__PURE__ */ q(
|
|
326
|
+
children: [/* @__PURE__ */ q(D, {
|
|
327
327
|
htmlFor: "year",
|
|
328
328
|
children: "Year"
|
|
329
|
-
}), /* @__PURE__ */ q(
|
|
329
|
+
}), /* @__PURE__ */ q(E, {
|
|
330
330
|
id: "year",
|
|
331
331
|
type: "number",
|
|
332
332
|
min: 1980,
|
|
333
333
|
max: (/* @__PURE__ */ new Date()).getFullYear() + 1,
|
|
334
|
-
value:
|
|
335
|
-
onChange: (e) =>
|
|
334
|
+
value: m.year,
|
|
335
|
+
onChange: (e) => v((t) => ({
|
|
336
336
|
...t,
|
|
337
337
|
year: e.target.value
|
|
338
338
|
})),
|
|
@@ -341,19 +341,19 @@ function fe({ editId: t }) {
|
|
|
341
341
|
}),
|
|
342
342
|
/* @__PURE__ */ J("div", {
|
|
343
343
|
className: "space-y-2",
|
|
344
|
-
children: [/* @__PURE__ */ q(
|
|
344
|
+
children: [/* @__PURE__ */ q(D, {
|
|
345
345
|
htmlFor: "vehicleStatus",
|
|
346
346
|
children: "Status"
|
|
347
|
-
}), /* @__PURE__ */ J(
|
|
348
|
-
value:
|
|
349
|
-
onValueChange: (e) =>
|
|
347
|
+
}), /* @__PURE__ */ J(k, {
|
|
348
|
+
value: m.status,
|
|
349
|
+
onValueChange: (e) => v((t) => ({
|
|
350
350
|
...t,
|
|
351
351
|
status: e
|
|
352
352
|
})),
|
|
353
|
-
children: [/* @__PURE__ */ q(
|
|
353
|
+
children: [/* @__PURE__ */ q(M, {
|
|
354
354
|
id: "vehicleStatus",
|
|
355
|
-
children: /* @__PURE__ */ q(
|
|
356
|
-
}), /* @__PURE__ */ q(
|
|
355
|
+
children: /* @__PURE__ */ q(N, {})
|
|
356
|
+
}), /* @__PURE__ */ q(A, { children: ue.map((e) => /* @__PURE__ */ q(j, {
|
|
357
357
|
value: e.value,
|
|
358
358
|
children: e.label
|
|
359
359
|
}, e.value)) })]
|
|
@@ -365,38 +365,38 @@ function fe({ editId: t }) {
|
|
|
365
365
|
className: "grid grid-cols-1 md:grid-cols-2 gap-4",
|
|
366
366
|
children: [/* @__PURE__ */ J("div", {
|
|
367
367
|
className: "space-y-2",
|
|
368
|
-
children: [/* @__PURE__ */ q(
|
|
368
|
+
children: [/* @__PURE__ */ q(D, {
|
|
369
369
|
htmlFor: "fuelType",
|
|
370
370
|
children: "Fuel Type"
|
|
371
|
-
}), /* @__PURE__ */ J(
|
|
372
|
-
value:
|
|
371
|
+
}), /* @__PURE__ */ J(k, {
|
|
372
|
+
value: m.fuelType || void 0,
|
|
373
373
|
onValueChange: (e) => {
|
|
374
|
-
let t =
|
|
375
|
-
|
|
374
|
+
let t = de.find((t) => t.value === e)?.value;
|
|
375
|
+
v((e) => ({
|
|
376
376
|
...e,
|
|
377
377
|
fuelType: t ?? ""
|
|
378
378
|
}));
|
|
379
379
|
},
|
|
380
|
-
children: [/* @__PURE__ */ q(
|
|
380
|
+
children: [/* @__PURE__ */ q(M, {
|
|
381
381
|
id: "fuelType",
|
|
382
|
-
children: /* @__PURE__ */ q(
|
|
383
|
-
}), /* @__PURE__ */ q(
|
|
382
|
+
children: /* @__PURE__ */ q(N, { placeholder: "Select fuel type" })
|
|
383
|
+
}), /* @__PURE__ */ q(A, { children: de.map((e) => /* @__PURE__ */ q(j, {
|
|
384
384
|
value: e.value,
|
|
385
385
|
children: e.label
|
|
386
386
|
}, e.value)) })]
|
|
387
387
|
})]
|
|
388
388
|
}), /* @__PURE__ */ J("div", {
|
|
389
389
|
className: "space-y-2",
|
|
390
|
-
children: [/* @__PURE__ */ q(
|
|
390
|
+
children: [/* @__PURE__ */ q(D, {
|
|
391
391
|
htmlFor: "fuelEfficiency",
|
|
392
392
|
children: "Fuel Efficiency (L/100km)"
|
|
393
|
-
}), /* @__PURE__ */ q(
|
|
393
|
+
}), /* @__PURE__ */ q(E, {
|
|
394
394
|
id: "fuelEfficiency",
|
|
395
395
|
type: "number",
|
|
396
396
|
min: 0,
|
|
397
397
|
step: .1,
|
|
398
|
-
value:
|
|
399
|
-
onChange: (e) =>
|
|
398
|
+
value: m.fuelEfficiencyLPer100Km,
|
|
399
|
+
onChange: (e) => v((t) => ({
|
|
400
400
|
...t,
|
|
401
401
|
fuelEfficiencyLPer100Km: e.target.value
|
|
402
402
|
})),
|
|
@@ -409,15 +409,15 @@ function fe({ editId: t }) {
|
|
|
409
409
|
children: [
|
|
410
410
|
/* @__PURE__ */ J("div", {
|
|
411
411
|
className: "space-y-2",
|
|
412
|
-
children: [/* @__PURE__ */ q(
|
|
412
|
+
children: [/* @__PURE__ */ q(D, {
|
|
413
413
|
htmlFor: "capacityWeight",
|
|
414
414
|
children: "Capacity — Weight (kg)"
|
|
415
|
-
}), /* @__PURE__ */ q(
|
|
415
|
+
}), /* @__PURE__ */ q(E, {
|
|
416
416
|
id: "capacityWeight",
|
|
417
417
|
type: "number",
|
|
418
418
|
min: 0,
|
|
419
|
-
value:
|
|
420
|
-
onChange: (e) =>
|
|
419
|
+
value: m.capacityWeight,
|
|
420
|
+
onChange: (e) => v((t) => ({
|
|
421
421
|
...t,
|
|
422
422
|
capacityWeight: e.target.value
|
|
423
423
|
})),
|
|
@@ -426,16 +426,16 @@ function fe({ editId: t }) {
|
|
|
426
426
|
}),
|
|
427
427
|
/* @__PURE__ */ J("div", {
|
|
428
428
|
className: "space-y-2",
|
|
429
|
-
children: [/* @__PURE__ */ q(
|
|
429
|
+
children: [/* @__PURE__ */ q(D, {
|
|
430
430
|
htmlFor: "capacityVolume",
|
|
431
431
|
children: "Capacity — Volume (m³)"
|
|
432
|
-
}), /* @__PURE__ */ q(
|
|
432
|
+
}), /* @__PURE__ */ q(E, {
|
|
433
433
|
id: "capacityVolume",
|
|
434
434
|
type: "number",
|
|
435
435
|
min: 0,
|
|
436
436
|
step: .1,
|
|
437
|
-
value:
|
|
438
|
-
onChange: (e) =>
|
|
437
|
+
value: m.capacityVolume,
|
|
438
|
+
onChange: (e) => v((t) => ({
|
|
439
439
|
...t,
|
|
440
440
|
capacityVolume: e.target.value
|
|
441
441
|
})),
|
|
@@ -444,15 +444,15 @@ function fe({ editId: t }) {
|
|
|
444
444
|
}),
|
|
445
445
|
/* @__PURE__ */ J("div", {
|
|
446
446
|
className: "space-y-2",
|
|
447
|
-
children: [/* @__PURE__ */ q(
|
|
447
|
+
children: [/* @__PURE__ */ q(D, {
|
|
448
448
|
htmlFor: "capacityPallets",
|
|
449
449
|
children: "Capacity — Pallets"
|
|
450
|
-
}), /* @__PURE__ */ q(
|
|
450
|
+
}), /* @__PURE__ */ q(E, {
|
|
451
451
|
id: "capacityPallets",
|
|
452
452
|
type: "number",
|
|
453
453
|
min: 0,
|
|
454
|
-
value:
|
|
455
|
-
onChange: (e) =>
|
|
454
|
+
value: m.capacityPallets,
|
|
455
|
+
onChange: (e) => v((t) => ({
|
|
456
456
|
...t,
|
|
457
457
|
capacityPallets: e.target.value
|
|
458
458
|
})),
|
|
@@ -463,102 +463,102 @@ function fe({ editId: t }) {
|
|
|
463
463
|
})
|
|
464
464
|
]
|
|
465
465
|
})] }),
|
|
466
|
-
|
|
466
|
+
p && /* @__PURE__ */ J(S, {
|
|
467
467
|
className: "border-status-error-border",
|
|
468
|
-
children: [/* @__PURE__ */ q(
|
|
468
|
+
children: [/* @__PURE__ */ q(w, { children: /* @__PURE__ */ J(T, {
|
|
469
469
|
className: "flex items-center gap-2 text-status-error-text",
|
|
470
470
|
children: [/* @__PURE__ */ q(s, { size: 18 }), " Delete Vehicle"]
|
|
471
|
-
}) }), /* @__PURE__ */ J(
|
|
471
|
+
}) }), /* @__PURE__ */ J(C, { children: [/* @__PURE__ */ q("p", {
|
|
472
472
|
className: "mb-3 text-sm text-text-secondary",
|
|
473
473
|
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."
|
|
474
|
-
}), /* @__PURE__ */ J(
|
|
474
|
+
}), /* @__PURE__ */ J(x, {
|
|
475
475
|
type: "button",
|
|
476
476
|
variant: "outline",
|
|
477
477
|
className: "border-status-error-border text-status-error-text hover:bg-status-error-bg-subtle",
|
|
478
|
-
onClick: () =>
|
|
478
|
+
onClick: () => L(!0),
|
|
479
479
|
children: [/* @__PURE__ */ q(s, { size: 16 }), " Delete this vehicle"]
|
|
480
480
|
})] })]
|
|
481
481
|
})
|
|
482
482
|
]
|
|
483
483
|
}),
|
|
484
484
|
/* @__PURE__ */ q(Z, {
|
|
485
|
-
open:
|
|
486
|
-
onOpenChange:
|
|
485
|
+
open: F,
|
|
486
|
+
onOpenChange: L,
|
|
487
487
|
children: /* @__PURE__ */ J(Q, { children: [
|
|
488
|
-
/* @__PURE__ */ J(
|
|
488
|
+
/* @__PURE__ */ J(se, { children: [/* @__PURE__ */ q(ce, { children: "Delete this vehicle?" }), /* @__PURE__ */ J($, { children: [
|
|
489
489
|
"This removes ",
|
|
490
|
-
|
|
490
|
+
m.vehicleNumber || "this vehicle",
|
|
491
491
|
" from the active fleet. It cannot be undone from here."
|
|
492
492
|
] })] }),
|
|
493
493
|
/* @__PURE__ */ q("div", {
|
|
494
494
|
className: "px-1",
|
|
495
|
-
children: /* @__PURE__ */ q(
|
|
495
|
+
children: /* @__PURE__ */ q(B, { message: V })
|
|
496
496
|
}),
|
|
497
|
-
/* @__PURE__ */ J(
|
|
497
|
+
/* @__PURE__ */ J(oe, { children: [/* @__PURE__ */ q(x, {
|
|
498
498
|
variant: "outline",
|
|
499
|
-
onClick: () =>
|
|
500
|
-
disabled:
|
|
499
|
+
onClick: () => L(!1),
|
|
500
|
+
disabled: R,
|
|
501
501
|
children: "Cancel"
|
|
502
|
-
}), /* @__PURE__ */ q(
|
|
502
|
+
}), /* @__PURE__ */ q(x, {
|
|
503
503
|
className: "bg-status-error-text text-text-inverse hover:opacity-90",
|
|
504
504
|
onClick: async () => {
|
|
505
505
|
if (t) {
|
|
506
|
-
|
|
506
|
+
z(!0), H(null);
|
|
507
507
|
try {
|
|
508
|
-
await l(t),
|
|
508
|
+
await l(t), L(!1), r?.(u(n, "fleet/vehicles"));
|
|
509
509
|
} catch (e) {
|
|
510
510
|
H(e instanceof Error ? e.message : "Failed to delete vehicle.");
|
|
511
511
|
} finally {
|
|
512
|
-
|
|
512
|
+
z(!1);
|
|
513
513
|
}
|
|
514
514
|
}
|
|
515
515
|
},
|
|
516
|
-
disabled:
|
|
517
|
-
children:
|
|
516
|
+
disabled: R,
|
|
517
|
+
children: R ? "Deleting..." : "Delete vehicle"
|
|
518
518
|
})] })
|
|
519
519
|
] })
|
|
520
520
|
})
|
|
521
521
|
]
|
|
522
522
|
});
|
|
523
523
|
}
|
|
524
|
-
function
|
|
525
|
-
let { vehicleId: a } =
|
|
526
|
-
let n =
|
|
524
|
+
function me() {
|
|
525
|
+
let { vehicleId: a } = re(), { basePath: s, navigate: h } = d(), { vehicle: g, isLoading: E, error: D, refetch: k } = _(a), A = ee(), { message: j, notify: M } = H(), { t: N } = ie(), L = (e, t) => {
|
|
526
|
+
let n = N(e);
|
|
527
527
|
return n === e ? t : n;
|
|
528
|
-
},
|
|
529
|
-
|
|
530
|
-
let { drivers: G, isLoading: K, error: Z } =
|
|
531
|
-
return a ?
|
|
528
|
+
}, B = ne().pathname.endsWith("/edit");
|
|
529
|
+
W(B, k);
|
|
530
|
+
let { drivers: G, isLoading: K, error: Z } = v(B ? void 0 : a), Q = () => h?.(u(s, "fleet/vehicles")), $ = (e) => h?.(u(s, e));
|
|
531
|
+
return a ? B ? /* @__PURE__ */ q(pe, { editId: a }) : E ? /* @__PURE__ */ q(F, { message: "Loading vehicle details..." }) : D || !g ? /* @__PURE__ */ q(P, {
|
|
532
532
|
title: "Vehicle not found",
|
|
533
|
-
onRetry:
|
|
534
|
-
}) : /* @__PURE__ */ J(
|
|
535
|
-
title:
|
|
536
|
-
subtitle: `${
|
|
533
|
+
onRetry: k
|
|
534
|
+
}) : /* @__PURE__ */ J(I, {
|
|
535
|
+
title: g.vehicleNumber,
|
|
536
|
+
subtitle: `${g.make} ${g.model}${g.year ? ` (${g.year})` : ""}`,
|
|
537
537
|
icon: /* @__PURE__ */ q(c, { size: 24 }),
|
|
538
538
|
headerActions: /* @__PURE__ */ J("div", {
|
|
539
539
|
className: "flex gap-2",
|
|
540
|
-
children: [/* @__PURE__ */ J(
|
|
540
|
+
children: [/* @__PURE__ */ J(x, {
|
|
541
541
|
variant: "outline",
|
|
542
542
|
onClick: Q,
|
|
543
543
|
children: [/* @__PURE__ */ q(e, { size: 16 }), " Back"]
|
|
544
|
-
}), /* @__PURE__ */ J(
|
|
545
|
-
onClick: () =>
|
|
544
|
+
}), /* @__PURE__ */ J(x, {
|
|
545
|
+
onClick: () => h?.(u(s, "fleet/vehicles/" + a + "/edit")),
|
|
546
546
|
children: [/* @__PURE__ */ q(o, { size: 16 }), " Edit"]
|
|
547
547
|
})]
|
|
548
548
|
}),
|
|
549
549
|
headerContent: /* @__PURE__ */ J("div", {
|
|
550
550
|
className: "flex gap-2",
|
|
551
|
-
children: [/* @__PURE__ */ q(
|
|
552
|
-
status:
|
|
551
|
+
children: [/* @__PURE__ */ q(R, {
|
|
552
|
+
status: g.status,
|
|
553
553
|
type: "vehicle"
|
|
554
|
-
}), /* @__PURE__ */ q(
|
|
554
|
+
}), /* @__PURE__ */ q(z, { type: g.type })]
|
|
555
555
|
}),
|
|
556
556
|
children: [
|
|
557
557
|
/* @__PURE__ */ q(X, {
|
|
558
558
|
icon: /* @__PURE__ */ q(c, { size: 18 }),
|
|
559
559
|
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."
|
|
560
560
|
}),
|
|
561
|
-
/* @__PURE__ */ q(
|
|
561
|
+
/* @__PURE__ */ q(ae, {
|
|
562
562
|
storageKey: "movethewheels-vehicle-details",
|
|
563
563
|
steps: [{
|
|
564
564
|
id: "assign",
|
|
@@ -575,9 +575,9 @@ function pe() {
|
|
|
575
575
|
onClick: () => G[0] ? $(`fleet/drivers/${G[0].id}`) : $("fleet/drivers")
|
|
576
576
|
}]
|
|
577
577
|
}),
|
|
578
|
-
|
|
578
|
+
j && /* @__PURE__ */ q("div", {
|
|
579
579
|
className: "mb-2",
|
|
580
|
-
children: /* @__PURE__ */ q(
|
|
580
|
+
children: /* @__PURE__ */ q(V, { message: j })
|
|
581
581
|
}),
|
|
582
582
|
/* @__PURE__ */ J("div", {
|
|
583
583
|
className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
|
|
@@ -595,46 +595,46 @@ function pe() {
|
|
|
595
595
|
children: "Type"
|
|
596
596
|
}), /* @__PURE__ */ q("p", {
|
|
597
597
|
className: "font-medium capitalize",
|
|
598
|
-
children:
|
|
598
|
+
children: g.type
|
|
599
599
|
})] }),
|
|
600
600
|
/* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q("p", {
|
|
601
601
|
className: "text-sm text-text-secondary",
|
|
602
602
|
children: "Make"
|
|
603
603
|
}), /* @__PURE__ */ q("p", {
|
|
604
604
|
className: "font-medium",
|
|
605
|
-
children:
|
|
605
|
+
children: g.make || "—"
|
|
606
606
|
})] }),
|
|
607
607
|
/* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q("p", {
|
|
608
608
|
className: "text-sm text-text-secondary",
|
|
609
609
|
children: "Model"
|
|
610
610
|
}), /* @__PURE__ */ q("p", {
|
|
611
611
|
className: "font-medium",
|
|
612
|
-
children:
|
|
612
|
+
children: g.model || "—"
|
|
613
613
|
})] }),
|
|
614
614
|
/* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q("p", {
|
|
615
615
|
className: "text-sm text-text-secondary",
|
|
616
616
|
children: "Year"
|
|
617
617
|
}), /* @__PURE__ */ q("p", {
|
|
618
618
|
className: "font-medium",
|
|
619
|
-
children:
|
|
619
|
+
children: g.year ?? "—"
|
|
620
620
|
})] }),
|
|
621
621
|
/* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q("p", {
|
|
622
622
|
className: "text-sm text-text-secondary",
|
|
623
623
|
children: "License Plate"
|
|
624
624
|
}), /* @__PURE__ */ q("p", {
|
|
625
625
|
className: "font-medium",
|
|
626
|
-
children:
|
|
626
|
+
children: g.licensePlate || "—"
|
|
627
627
|
})] }),
|
|
628
628
|
/* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q("p", {
|
|
629
629
|
className: "text-sm text-text-secondary",
|
|
630
630
|
children: "Ownership"
|
|
631
631
|
}), /* @__PURE__ */ q("p", {
|
|
632
632
|
className: "font-medium capitalize",
|
|
633
|
-
children:
|
|
633
|
+
children: g.ownershipType || "—"
|
|
634
634
|
})] })
|
|
635
635
|
]
|
|
636
636
|
})] }),
|
|
637
|
-
/* @__PURE__ */ J(
|
|
637
|
+
/* @__PURE__ */ J(S, { children: [/* @__PURE__ */ q(w, { children: /* @__PURE__ */ q(T, { children: "Capacity" }) }), /* @__PURE__ */ q(C, { children: /* @__PURE__ */ J("div", {
|
|
638
638
|
className: "grid grid-cols-1 sm:grid-cols-3 gap-6",
|
|
639
639
|
children: [
|
|
640
640
|
/* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q("p", {
|
|
@@ -642,49 +642,49 @@ function pe() {
|
|
|
642
642
|
children: "Weight"
|
|
643
643
|
}), /* @__PURE__ */ q("p", {
|
|
644
644
|
className: "text-2xl font-bold",
|
|
645
|
-
children:
|
|
645
|
+
children: g.capacity.weight === void 0 ? "—" : p(g.capacity.weight)
|
|
646
646
|
})] }),
|
|
647
647
|
/* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q("p", {
|
|
648
648
|
className: "text-sm text-text-secondary",
|
|
649
649
|
children: "Volume"
|
|
650
650
|
}), /* @__PURE__ */ q("p", {
|
|
651
651
|
className: "text-2xl font-bold",
|
|
652
|
-
children:
|
|
652
|
+
children: g.capacity.volume === void 0 ? "—" : `${g.capacity.volume} m³`
|
|
653
653
|
})] }),
|
|
654
|
-
|
|
654
|
+
g.capacity.pallets && /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q("p", {
|
|
655
655
|
className: "text-sm text-text-secondary",
|
|
656
656
|
children: "Pallets"
|
|
657
657
|
}), /* @__PURE__ */ q("p", {
|
|
658
658
|
className: "text-2xl font-bold",
|
|
659
|
-
children:
|
|
659
|
+
children: g.capacity.pallets
|
|
660
660
|
})] })
|
|
661
661
|
]
|
|
662
662
|
}) })] }),
|
|
663
|
-
/* @__PURE__ */ q(
|
|
663
|
+
/* @__PURE__ */ q(U, {
|
|
664
664
|
entityType: "vehicle",
|
|
665
|
-
entityId:
|
|
665
|
+
entityId: g.id
|
|
666
666
|
})
|
|
667
667
|
]
|
|
668
668
|
}), /* @__PURE__ */ J("div", {
|
|
669
669
|
className: "space-y-6",
|
|
670
670
|
children: [
|
|
671
|
-
/* @__PURE__ */ J(
|
|
671
|
+
/* @__PURE__ */ J(S, { children: [/* @__PURE__ */ q(w, { children: /* @__PURE__ */ J(T, {
|
|
672
672
|
className: "flex items-center gap-2",
|
|
673
673
|
children: [/* @__PURE__ */ q(t, { size: 18 }), " Fuel & Mileage"]
|
|
674
|
-
}) }), /* @__PURE__ */ J(
|
|
674
|
+
}) }), /* @__PURE__ */ J(C, {
|
|
675
675
|
className: "space-y-4",
|
|
676
676
|
children: [
|
|
677
|
-
|
|
677
|
+
g.fuelLevel !== void 0 && /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ J("div", {
|
|
678
678
|
className: "flex justify-between text-sm mb-2",
|
|
679
|
-
children: [/* @__PURE__ */ q("span", { children: "Fuel Level" }), /* @__PURE__ */ J("span", { children: [
|
|
680
|
-
}), /* @__PURE__ */ q(
|
|
681
|
-
|
|
679
|
+
children: [/* @__PURE__ */ q("span", { children: "Fuel Level" }), /* @__PURE__ */ J("span", { children: [g.fuelLevel, "%"] })]
|
|
680
|
+
}), /* @__PURE__ */ q(O, { value: g.fuelLevel })] }),
|
|
681
|
+
g.mileage !== void 0 && /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q("p", {
|
|
682
682
|
className: "text-sm text-text-secondary",
|
|
683
683
|
children: "Total Mileage"
|
|
684
684
|
}), /* @__PURE__ */ J("p", {
|
|
685
685
|
className: "text-2xl font-bold",
|
|
686
686
|
children: [
|
|
687
|
-
|
|
687
|
+
g.mileage.toLocaleString(),
|
|
688
688
|
" ",
|
|
689
689
|
/* @__PURE__ */ q("span", {
|
|
690
690
|
className: "text-sm font-normal",
|
|
@@ -692,28 +692,28 @@ function pe() {
|
|
|
692
692
|
})
|
|
693
693
|
]
|
|
694
694
|
})] }),
|
|
695
|
-
(
|
|
695
|
+
(g.fuelType || g.fuelEfficiencyLPer100Km !== void 0) && /* @__PURE__ */ J("div", {
|
|
696
696
|
className: "grid grid-cols-2 gap-4",
|
|
697
|
-
children: [
|
|
697
|
+
children: [g.fuelType && /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q("p", {
|
|
698
698
|
className: "text-sm text-text-secondary",
|
|
699
699
|
children: "Fuel Type"
|
|
700
700
|
}), /* @__PURE__ */ q("p", {
|
|
701
701
|
className: "font-medium",
|
|
702
|
-
children:
|
|
703
|
-
})] }),
|
|
702
|
+
children: g.fuelType
|
|
703
|
+
})] }), g.fuelEfficiencyLPer100Km !== void 0 && /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q("p", {
|
|
704
704
|
className: "text-sm text-text-secondary",
|
|
705
705
|
children: "Efficiency"
|
|
706
706
|
}), /* @__PURE__ */ J("p", {
|
|
707
707
|
className: "font-medium",
|
|
708
|
-
children: [
|
|
708
|
+
children: [g.fuelEfficiencyLPer100Km, " L/100km"]
|
|
709
709
|
})] })]
|
|
710
710
|
})
|
|
711
711
|
]
|
|
712
712
|
})] }),
|
|
713
|
-
/* @__PURE__ */ J(
|
|
713
|
+
/* @__PURE__ */ J(S, { children: [/* @__PURE__ */ q(w, { children: /* @__PURE__ */ J(T, {
|
|
714
714
|
className: "flex items-center gap-2",
|
|
715
715
|
children: [/* @__PURE__ */ q(l, { size: 18 }), " Assigned Driver"]
|
|
716
|
-
}) }), /* @__PURE__ */ q(
|
|
716
|
+
}) }), /* @__PURE__ */ q(C, {
|
|
717
717
|
className: "space-y-4",
|
|
718
718
|
children: K ? /* @__PURE__ */ q("p", {
|
|
719
719
|
className: "text-sm text-text-secondary",
|
|
@@ -726,7 +726,7 @@ function pe() {
|
|
|
726
726
|
children: [/* @__PURE__ */ q("p", {
|
|
727
727
|
className: "text-sm text-text-secondary",
|
|
728
728
|
children: "No driver is assigned to this vehicle yet."
|
|
729
|
-
}), /* @__PURE__ */ q(
|
|
729
|
+
}), /* @__PURE__ */ q(x, {
|
|
730
730
|
variant: "outline",
|
|
731
731
|
size: "sm",
|
|
732
732
|
onClick: () => $("fleet/drivers"),
|
|
@@ -740,7 +740,7 @@ function pe() {
|
|
|
740
740
|
onKeyDown: (t) => {
|
|
741
741
|
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), $(`fleet/drivers/${e.id}`));
|
|
742
742
|
},
|
|
743
|
-
children: [/* @__PURE__ */ q(
|
|
743
|
+
children: [/* @__PURE__ */ q(y, { children: /* @__PURE__ */ q(b, { children: m(e.fullName) }) }), /* @__PURE__ */ J("div", {
|
|
744
744
|
className: "min-w-0 space-y-1",
|
|
745
745
|
children: [
|
|
746
746
|
/* @__PURE__ */ q("p", {
|
|
@@ -751,7 +751,7 @@ function pe() {
|
|
|
751
751
|
className: "text-xs text-text-secondary",
|
|
752
752
|
children: e.employeeId
|
|
753
753
|
}),
|
|
754
|
-
/* @__PURE__ */ q(
|
|
754
|
+
/* @__PURE__ */ q(R, {
|
|
755
755
|
status: e.status,
|
|
756
756
|
type: "driver",
|
|
757
757
|
size: "sm"
|
|
@@ -776,28 +776,28 @@ function pe() {
|
|
|
776
776
|
})]
|
|
777
777
|
}, e.id))
|
|
778
778
|
})] }),
|
|
779
|
-
/* @__PURE__ */ q(
|
|
780
|
-
vehicle:
|
|
781
|
-
t:
|
|
779
|
+
/* @__PURE__ */ q(te, {
|
|
780
|
+
vehicle: g,
|
|
781
|
+
t: L,
|
|
782
782
|
onRecord: async (e) => {
|
|
783
|
-
await
|
|
783
|
+
await A(g.id, e), M(L("movethewheels.vehicles.service.saved", "Service recorded.")), k();
|
|
784
784
|
}
|
|
785
785
|
}),
|
|
786
|
-
|
|
786
|
+
g.currentLocation && /* @__PURE__ */ J(S, { children: [/* @__PURE__ */ q(w, { children: /* @__PURE__ */ J(T, {
|
|
787
787
|
className: "flex items-center gap-2",
|
|
788
788
|
children: [/* @__PURE__ */ q(r, { size: 18 }), " Current Location"]
|
|
789
|
-
}) }), /* @__PURE__ */ J(
|
|
789
|
+
}) }), /* @__PURE__ */ J(C, { children: [/* @__PURE__ */ q("p", {
|
|
790
790
|
className: "text-sm",
|
|
791
|
-
children:
|
|
791
|
+
children: g.currentLocation.address || "Location updating..."
|
|
792
792
|
}), /* @__PURE__ */ q("p", {
|
|
793
793
|
className: "text-xs text-text-secondary mt-1",
|
|
794
|
-
children:
|
|
794
|
+
children: g.currentLocation.timestamp ? `Updated ${f(g.currentLocation.timestamp, "relative")}` : "Update time not recorded"
|
|
795
795
|
})] })] })
|
|
796
796
|
]
|
|
797
797
|
})]
|
|
798
798
|
})
|
|
799
799
|
]
|
|
800
|
-
}) : /* @__PURE__ */ q(
|
|
800
|
+
}) : /* @__PURE__ */ q(pe, {});
|
|
801
801
|
}
|
|
802
802
|
//#endregion
|
|
803
|
-
export {
|
|
803
|
+
export { me as default };
|