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