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