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