@burdenoff/microfe-movethewheels 2026.925.1 → 2026.925.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/StatusBadge.js +31 -31
- package/dist/constants/index.js +10 -3
- package/dist/hooks/useFleet.js +85 -76
- 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 +41 -1
- package/dist/movethewheels/types/index.d.ts +16 -38
- 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/DriverDetailsPage.js +702 -421
- package/dist/pages/DriversPage.js +106 -117
- package/dist/pages/FleetPage.js +4 -10
- package/dist/pages/OrderDetailsPage.js +279 -274
- package/dist/pages/RouteDetailsPage.js +264 -252
- package/dist/pages/VehicleDetailsPage.js +403 -243
- package/package.json +1 -1
- package/src/movethewheels/components/StatusBadge.tsx +11 -2
- package/src/movethewheels/constants/index.ts +12 -0
- package/src/movethewheels/hooks/useFleet.ts +163 -44
- package/src/movethewheels/pages/DriverDetailsPage.tsx +516 -156
- package/src/movethewheels/pages/DriversPage.tsx +28 -11
- package/src/movethewheels/pages/FleetPage.tsx +7 -10
- package/src/movethewheels/pages/OrderDetailsPage.tsx +12 -7
- package/src/movethewheels/pages/RouteDetailsPage.tsx +15 -7
- package/src/movethewheels/pages/VehicleDetailsPage.tsx +137 -15
- package/src/movethewheels/types/index.ts +16 -38
|
@@ -8,34 +8,35 @@ import { MapPin as ee } from "../node_modules/lucide-react/dist/esm/icons/map-pi
|
|
|
8
8
|
import { Navigation as o } from "../node_modules/lucide-react/dist/esm/icons/navigation.js";
|
|
9
9
|
import { Plus as s } from "../node_modules/lucide-react/dist/esm/icons/plus.js";
|
|
10
10
|
import { Save as c } from "../node_modules/lucide-react/dist/esm/icons/save.js";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
11
|
+
import { Search as l } from "../node_modules/lucide-react/dist/esm/icons/search.js";
|
|
12
|
+
import { SquarePen as u } from "../node_modules/lucide-react/dist/esm/icons/square-pen.js";
|
|
13
|
+
import { Trash2 as d } from "../node_modules/lucide-react/dist/esm/icons/trash-2.js";
|
|
14
|
+
import { Zap as f } from "../node_modules/lucide-react/dist/esm/icons/zap.js";
|
|
15
|
+
import { joinPath as p } from "../utils/navigation.js";
|
|
16
|
+
import { useMoveTheWheels as m } from "../providers/MoveTheWheelsProvider.js";
|
|
17
|
+
import { useRoute as te, useRoutes as ne } from "../hooks/useRoutes.js";
|
|
18
|
+
import { useDriver as re, useDrivers as h, useVehicle as g, useVehicles as ie } from "../hooks/useFleet.js";
|
|
19
|
+
import { Badge as _, Button as v, Card as y, CardContent as b, CardHeader as x, CardTitle as S, Input as C, Label as w, Select as T, SelectContent as E, SelectItem as D, SelectTrigger as O, SelectValue as k } from "../components/ui.js";
|
|
20
|
+
import { ErrorState as A, LoadingState as j, PageLayout as ae } from "../components/PageLayout.js";
|
|
20
21
|
import { RouteMap as M } from "../components/maps/RouteMap.js";
|
|
21
22
|
import "../components/maps/index.js";
|
|
22
23
|
import { ROUTE_STATUS_COLORS as N } from "../constants/index.js";
|
|
23
24
|
import { StatusBadge as P } from "../components/StatusBadge.js";
|
|
24
|
-
import { FormError as
|
|
25
|
-
import { Notice as
|
|
26
|
-
import { formatAddress as
|
|
27
|
-
import { useDebouncedValue as
|
|
28
|
-
import { EntityCombobox as
|
|
29
|
-
import { firstRealLatLng as
|
|
30
|
-
import { useAssignmentSuggestions as
|
|
31
|
-
import { AssignmentSuggestions as
|
|
32
|
-
import { useEffect as
|
|
33
|
-
import { useLocation as
|
|
34
|
-
import { Fragment as
|
|
35
|
-
import { useI18n as
|
|
36
|
-
import { EmphasisPanel as
|
|
25
|
+
import { FormError as oe } from "../components/FormError.js";
|
|
26
|
+
import { Notice as se, useNotice as ce } from "../components/Notice.js";
|
|
27
|
+
import { formatAddress as F, formatCurrency as le, formatDate as I } from "../utils/formatters.js";
|
|
28
|
+
import { useDebouncedValue as L } from "../hooks/useDebouncedValue.js";
|
|
29
|
+
import { EntityCombobox as R } from "../components/EntityCombobox.js";
|
|
30
|
+
import { firstRealLatLng as z } from "../utils/mapMarkers.js";
|
|
31
|
+
import { useAssignmentSuggestions as B } from "../hooks/useFleetIntelligence.js";
|
|
32
|
+
import { AssignmentSuggestions as V } from "../components/AssignmentSuggestions.js";
|
|
33
|
+
import { useEffect as H, useState as U } from "react";
|
|
34
|
+
import { useLocation as ue, useParams as W } from "react-router";
|
|
35
|
+
import { Fragment as G, jsx as K, jsxs as q } from "react/jsx-runtime";
|
|
36
|
+
import { useI18n as J } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
37
|
+
import { EmphasisPanel as de, NextSteps as Y, PagePurpose as fe } from "@burdenoff/fe-libs/ui";
|
|
37
38
|
//#region src/movethewheels/pages/RouteDetailsPage.tsx
|
|
38
|
-
var
|
|
39
|
+
var X = [
|
|
39
40
|
{
|
|
40
41
|
value: "planned",
|
|
41
42
|
label: "Planned"
|
|
@@ -54,7 +55,7 @@ var de = [
|
|
|
54
55
|
}
|
|
55
56
|
];
|
|
56
57
|
function Z({ editId: r }) {
|
|
57
|
-
let { basePath: i, navigate: a } =
|
|
58
|
+
let { basePath: i, navigate: a } = m(), { createRoute: ee, updateRoute: u } = ne(), { route: f } = te(r), [_, A] = U(""), j = L(_), M = !!r, [N, P] = U({
|
|
58
59
|
name: "",
|
|
59
60
|
status: "planned",
|
|
60
61
|
vehicleId: "",
|
|
@@ -63,46 +64,46 @@ function Z({ editId: r }) {
|
|
|
63
64
|
address: "",
|
|
64
65
|
type: "delivery"
|
|
65
66
|
}]
|
|
66
|
-
}), { vehicles:
|
|
67
|
+
}), { vehicles: se, isLoading: ce } = ie({
|
|
67
68
|
limit: 20,
|
|
68
69
|
search: j || void 0,
|
|
69
70
|
driverId: N.driverId || void 0
|
|
70
|
-
}), { drivers:
|
|
71
|
+
}), { drivers: le, isLoading: I } = h({
|
|
71
72
|
limit: 20,
|
|
72
73
|
search: j || void 0,
|
|
73
74
|
vehicleId: N.vehicleId || void 0
|
|
74
|
-
}), { vehicle:
|
|
75
|
-
|
|
76
|
-
!r || !
|
|
77
|
-
name:
|
|
78
|
-
status:
|
|
79
|
-
vehicleId:
|
|
80
|
-
driverId:
|
|
81
|
-
stops:
|
|
82
|
-
address:
|
|
75
|
+
}), { vehicle: z, isLoading: B } = g(N.vehicleId || void 0), { driver: V, isLoading: ue } = re(N.driverId || void 0), [W, J] = U(!1), [Y, Z] = U(null);
|
|
76
|
+
H(() => {
|
|
77
|
+
!r || !f || P({
|
|
78
|
+
name: f.name || "",
|
|
79
|
+
status: f.status,
|
|
80
|
+
vehicleId: f.vehicleId || "",
|
|
81
|
+
driverId: f.driverId || "",
|
|
82
|
+
stops: f.stops.length > 0 ? f.stops.map((e) => ({
|
|
83
|
+
address: F(e.address) || e.address.street || "",
|
|
83
84
|
type: e.type
|
|
84
85
|
})) : [{
|
|
85
86
|
address: "",
|
|
86
87
|
type: "delivery"
|
|
87
88
|
}]
|
|
88
89
|
});
|
|
89
|
-
}, [r,
|
|
90
|
-
let Q = () => a?.(
|
|
90
|
+
}, [r, f]);
|
|
91
|
+
let Q = () => a?.(p(i, "routes")), $ = () => P((e) => ({
|
|
91
92
|
...e,
|
|
92
93
|
stops: [...e.stops, {
|
|
93
94
|
address: "",
|
|
94
95
|
type: "delivery"
|
|
95
96
|
}]
|
|
96
|
-
})),
|
|
97
|
+
})), pe = (e) => P((t) => ({
|
|
97
98
|
...t,
|
|
98
99
|
stops: t.stops.filter((t, n) => n !== e)
|
|
99
|
-
})),
|
|
100
|
+
})), me = (e, t, n) => P((r) => ({
|
|
100
101
|
...r,
|
|
101
102
|
stops: r.stops.map((r, i) => i === e ? {
|
|
102
103
|
...r,
|
|
103
104
|
[t]: n
|
|
104
105
|
} : r)
|
|
105
|
-
})),
|
|
106
|
+
})), he = (e, t) => P((n) => {
|
|
106
107
|
let r = e + t;
|
|
107
108
|
if (r < 0 || r >= n.stops.length) return n;
|
|
108
109
|
let i = [...n.stops];
|
|
@@ -110,7 +111,7 @@ function Z({ editId: r }) {
|
|
|
110
111
|
...n,
|
|
111
112
|
stops: i
|
|
112
113
|
};
|
|
113
|
-
}),
|
|
114
|
+
}), ge = async (e) => {
|
|
114
115
|
if (e.preventDefault(), !N.name.trim()) {
|
|
115
116
|
Z("Route name is required.");
|
|
116
117
|
return;
|
|
@@ -120,7 +121,7 @@ function Z({ editId: r }) {
|
|
|
120
121
|
Z("Add at least one stop with an address.");
|
|
121
122
|
return;
|
|
122
123
|
}
|
|
123
|
-
|
|
124
|
+
J(!0), Z(null);
|
|
124
125
|
try {
|
|
125
126
|
let e = t.map((e, t) => ({
|
|
126
127
|
id: `stop-${t + 1}`,
|
|
@@ -139,14 +140,14 @@ function Z({ editId: r }) {
|
|
|
139
140
|
status: "pending"
|
|
140
141
|
}));
|
|
141
142
|
if (M) {
|
|
142
|
-
let t = await
|
|
143
|
+
let t = await u(r, {
|
|
143
144
|
name: N.name.trim(),
|
|
144
145
|
status: N.status,
|
|
145
146
|
vehicleId: N.vehicleId || void 0,
|
|
146
147
|
driverId: N.driverId || void 0,
|
|
147
148
|
stops: e
|
|
148
149
|
});
|
|
149
|
-
a?.(
|
|
150
|
+
a?.(p(i, `routes/${t.id}`));
|
|
150
151
|
return;
|
|
151
152
|
}
|
|
152
153
|
let n = await ee({
|
|
@@ -156,57 +157,57 @@ function Z({ editId: r }) {
|
|
|
156
157
|
driverId: N.driverId || void 0,
|
|
157
158
|
stops: e
|
|
158
159
|
});
|
|
159
|
-
a?.(
|
|
160
|
+
a?.(p(i, `routes/${n.id}`));
|
|
160
161
|
} catch (e) {
|
|
161
|
-
console.error("Failed to create route:", e), Z(e instanceof Error ? e.message : "Failed to create route. Please try again."),
|
|
162
|
+
console.error("Failed to create route:", e), Z(e instanceof Error ? e.message : "Failed to create route. Please try again."), J(!1);
|
|
162
163
|
}
|
|
163
164
|
};
|
|
164
|
-
return /* @__PURE__ */
|
|
165
|
+
return /* @__PURE__ */ q(ae, {
|
|
165
166
|
title: M ? "Edit Route" : "Create Route",
|
|
166
167
|
subtitle: "Plan a new delivery route",
|
|
167
|
-
icon: /* @__PURE__ */
|
|
168
|
-
headerActions: /* @__PURE__ */
|
|
168
|
+
icon: /* @__PURE__ */ K(o, { size: 24 }),
|
|
169
|
+
headerActions: /* @__PURE__ */ q("div", {
|
|
169
170
|
className: "flex gap-2",
|
|
170
|
-
children: [/* @__PURE__ */
|
|
171
|
+
children: [/* @__PURE__ */ q(v, {
|
|
171
172
|
variant: "outline",
|
|
172
173
|
onClick: Q,
|
|
173
|
-
disabled:
|
|
174
|
-
children: [/* @__PURE__ */
|
|
175
|
-
}), /* @__PURE__ */
|
|
176
|
-
onClick:
|
|
177
|
-
disabled:
|
|
174
|
+
disabled: W,
|
|
175
|
+
children: [/* @__PURE__ */ K(t, { size: 16 }), " Cancel"]
|
|
176
|
+
}), /* @__PURE__ */ q(v, {
|
|
177
|
+
onClick: ge,
|
|
178
|
+
disabled: W,
|
|
178
179
|
children: [
|
|
179
|
-
/* @__PURE__ */
|
|
180
|
+
/* @__PURE__ */ K(c, { size: 16 }),
|
|
180
181
|
" ",
|
|
181
|
-
M ?
|
|
182
|
+
M ? W ? "Saving..." : "Save Changes" : W ? "Saving..." : "Create Route"
|
|
182
183
|
]
|
|
183
184
|
})]
|
|
184
185
|
}),
|
|
185
|
-
children: [/* @__PURE__ */
|
|
186
|
-
icon: /* @__PURE__ */
|
|
186
|
+
children: [/* @__PURE__ */ K(fe, {
|
|
187
|
+
icon: /* @__PURE__ */ K(o, { size: 18 }),
|
|
187
188
|
children: "Plan a new delivery route — name it, list the stops to visit, and optionally assign a vehicle and driver. Once created you can optimize it to sequence the stops into the shortest run."
|
|
188
|
-
}), /* @__PURE__ */
|
|
189
|
-
onSubmit:
|
|
189
|
+
}), /* @__PURE__ */ q("form", {
|
|
190
|
+
onSubmit: ge,
|
|
190
191
|
className: "max-w-3xl space-y-6",
|
|
191
192
|
children: [
|
|
192
|
-
/* @__PURE__ */
|
|
193
|
-
/* @__PURE__ */
|
|
193
|
+
/* @__PURE__ */ K(oe, { message: Y }),
|
|
194
|
+
/* @__PURE__ */ q(de, { children: [/* @__PURE__ */ K("h2", {
|
|
194
195
|
className: "text-base font-semibold text-text-primary mb-4",
|
|
195
196
|
children: "Route Details"
|
|
196
|
-
}), /* @__PURE__ */
|
|
197
|
+
}), /* @__PURE__ */ q("div", {
|
|
197
198
|
className: "space-y-4",
|
|
198
199
|
children: [
|
|
199
|
-
/* @__PURE__ */
|
|
200
|
+
/* @__PURE__ */ q("div", {
|
|
200
201
|
className: "grid grid-cols-1 md:grid-cols-2 gap-4",
|
|
201
|
-
children: [/* @__PURE__ */
|
|
202
|
+
children: [/* @__PURE__ */ q("div", {
|
|
202
203
|
className: "space-y-2",
|
|
203
|
-
children: [/* @__PURE__ */
|
|
204
|
+
children: [/* @__PURE__ */ q(w, {
|
|
204
205
|
htmlFor: "name",
|
|
205
|
-
children: ["Route Name ", /* @__PURE__ */
|
|
206
|
+
children: ["Route Name ", /* @__PURE__ */ K("span", {
|
|
206
207
|
className: "text-status-error-text",
|
|
207
208
|
children: "*"
|
|
208
209
|
})]
|
|
209
|
-
}), /* @__PURE__ */
|
|
210
|
+
}), /* @__PURE__ */ K(C, {
|
|
210
211
|
id: "name",
|
|
211
212
|
value: N.name,
|
|
212
213
|
onChange: (e) => P((t) => ({
|
|
@@ -216,93 +217,104 @@ function Z({ editId: r }) {
|
|
|
216
217
|
placeholder: "Downtown morning run",
|
|
217
218
|
required: !0
|
|
218
219
|
})]
|
|
219
|
-
}), /* @__PURE__ */
|
|
220
|
+
}), /* @__PURE__ */ q("div", {
|
|
220
221
|
className: "space-y-2",
|
|
221
|
-
children: [/* @__PURE__ */
|
|
222
|
+
children: [/* @__PURE__ */ K(w, {
|
|
222
223
|
htmlFor: "status",
|
|
223
224
|
children: "Status"
|
|
224
|
-
}), /* @__PURE__ */
|
|
225
|
+
}), /* @__PURE__ */ q(T, {
|
|
225
226
|
value: N.status,
|
|
226
227
|
onValueChange: (e) => P((t) => ({
|
|
227
228
|
...t,
|
|
228
229
|
status: e
|
|
229
230
|
})),
|
|
230
|
-
children: [/* @__PURE__ */
|
|
231
|
+
children: [/* @__PURE__ */ K(O, {
|
|
231
232
|
id: "status",
|
|
232
|
-
children: /* @__PURE__ */
|
|
233
|
-
}), /* @__PURE__ */
|
|
233
|
+
children: /* @__PURE__ */ K(k, {})
|
|
234
|
+
}), /* @__PURE__ */ K(E, { children: X.map((e) => /* @__PURE__ */ K(D, {
|
|
234
235
|
value: e.value,
|
|
235
236
|
children: e.label
|
|
236
237
|
}, e.value)) })]
|
|
237
238
|
})]
|
|
238
239
|
})]
|
|
239
240
|
}),
|
|
240
|
-
/* @__PURE__ */
|
|
241
|
+
/* @__PURE__ */ q("div", {
|
|
241
242
|
className: "space-y-2",
|
|
242
|
-
children: [
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
243
|
+
children: [
|
|
244
|
+
/* @__PURE__ */ K(w, {
|
|
245
|
+
htmlFor: "fleet-search",
|
|
246
|
+
children: "Search vehicles & drivers"
|
|
247
|
+
}),
|
|
248
|
+
/* @__PURE__ */ q("div", {
|
|
249
|
+
className: "relative",
|
|
250
|
+
children: [/* @__PURE__ */ K(l, { className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-secondary" }), /* @__PURE__ */ K(C, {
|
|
251
|
+
id: "fleet-search",
|
|
252
|
+
value: _,
|
|
253
|
+
onChange: (e) => A(e.target.value),
|
|
254
|
+
placeholder: "Vehicle number, driver name or employee ID",
|
|
255
|
+
className: "pl-9"
|
|
256
|
+
})]
|
|
257
|
+
}),
|
|
258
|
+
/* @__PURE__ */ K("p", {
|
|
259
|
+
className: "text-xs text-text-secondary",
|
|
260
|
+
children: "Narrows both pickers below as you type — up to 20 matches at a time."
|
|
261
|
+
})
|
|
262
|
+
]
|
|
251
263
|
}),
|
|
252
|
-
/* @__PURE__ */
|
|
264
|
+
/* @__PURE__ */ q("div", {
|
|
253
265
|
className: "grid grid-cols-1 md:grid-cols-2 gap-4",
|
|
254
|
-
children: [/* @__PURE__ */
|
|
266
|
+
children: [/* @__PURE__ */ q("div", {
|
|
255
267
|
className: "space-y-2",
|
|
256
|
-
children: [/* @__PURE__ */
|
|
268
|
+
children: [/* @__PURE__ */ K(w, {
|
|
257
269
|
htmlFor: "vehicle",
|
|
258
270
|
children: "Vehicle (optional)"
|
|
259
|
-
}), /* @__PURE__ */
|
|
271
|
+
}), /* @__PURE__ */ K(R, {
|
|
260
272
|
id: "vehicle",
|
|
261
273
|
value: N.vehicleId,
|
|
262
274
|
onChange: (e) => P((t) => ({
|
|
263
275
|
...t,
|
|
264
276
|
vehicleId: e
|
|
265
277
|
})),
|
|
266
|
-
options:
|
|
267
|
-
loading:
|
|
278
|
+
options: se,
|
|
279
|
+
loading: ce,
|
|
268
280
|
getId: (e) => e.id,
|
|
269
281
|
getLabel: (e) => `${e.vehicleNumber} (${e.type})`,
|
|
270
|
-
renderOption: (e) => /* @__PURE__ */
|
|
282
|
+
renderOption: (e) => /* @__PURE__ */ q(G, { children: [
|
|
271
283
|
e.vehicleNumber,
|
|
272
284
|
" (",
|
|
273
285
|
e.type,
|
|
274
286
|
")"
|
|
275
287
|
] }),
|
|
276
|
-
selectedOption:
|
|
277
|
-
selectedLoading:
|
|
288
|
+
selectedOption: z,
|
|
289
|
+
selectedLoading: B,
|
|
278
290
|
required: !0,
|
|
279
291
|
placeholder: "Assign later",
|
|
280
292
|
emptyText: "No available vehicles."
|
|
281
293
|
})]
|
|
282
|
-
}), /* @__PURE__ */
|
|
294
|
+
}), /* @__PURE__ */ q("div", {
|
|
283
295
|
className: "space-y-2",
|
|
284
|
-
children: [/* @__PURE__ */
|
|
296
|
+
children: [/* @__PURE__ */ K(w, {
|
|
285
297
|
htmlFor: "driver",
|
|
286
298
|
children: "Driver (optional)"
|
|
287
|
-
}), /* @__PURE__ */
|
|
299
|
+
}), /* @__PURE__ */ K(R, {
|
|
288
300
|
id: "driver",
|
|
289
301
|
value: N.driverId,
|
|
290
302
|
onChange: (e) => P((t) => ({
|
|
291
303
|
...t,
|
|
292
304
|
driverId: e
|
|
293
305
|
})),
|
|
294
|
-
options:
|
|
295
|
-
loading:
|
|
306
|
+
options: le,
|
|
307
|
+
loading: I,
|
|
296
308
|
getId: (e) => e.id,
|
|
297
309
|
getLabel: (e) => `${e.fullName} (${e.employeeId})`,
|
|
298
|
-
renderOption: (e) => /* @__PURE__ */
|
|
310
|
+
renderOption: (e) => /* @__PURE__ */ q(G, { children: [
|
|
299
311
|
e.fullName,
|
|
300
312
|
" (",
|
|
301
313
|
e.employeeId,
|
|
302
314
|
")"
|
|
303
315
|
] }),
|
|
304
|
-
selectedOption:
|
|
305
|
-
selectedLoading:
|
|
316
|
+
selectedOption: V,
|
|
317
|
+
selectedLoading: ue,
|
|
306
318
|
required: !0,
|
|
307
319
|
placeholder: "Assign later",
|
|
308
320
|
emptyText: "No available drivers."
|
|
@@ -311,89 +323,89 @@ function Z({ editId: r }) {
|
|
|
311
323
|
})
|
|
312
324
|
]
|
|
313
325
|
})] }),
|
|
314
|
-
/* @__PURE__ */
|
|
326
|
+
/* @__PURE__ */ q(y, { children: [/* @__PURE__ */ q(x, {
|
|
315
327
|
className: "flex flex-row items-center justify-between",
|
|
316
|
-
children: [/* @__PURE__ */
|
|
328
|
+
children: [/* @__PURE__ */ q(S, { children: ["Stops ", /* @__PURE__ */ K("span", {
|
|
317
329
|
className: "text-status-error-text",
|
|
318
330
|
children: "*"
|
|
319
|
-
})] }), /* @__PURE__ */
|
|
331
|
+
})] }), /* @__PURE__ */ q(v, {
|
|
320
332
|
type: "button",
|
|
321
333
|
variant: "outline",
|
|
322
334
|
size: "sm",
|
|
323
|
-
onClick:
|
|
324
|
-
children: [/* @__PURE__ */
|
|
335
|
+
onClick: $,
|
|
336
|
+
children: [/* @__PURE__ */ K(s, { size: 16 }), " Add Stop"]
|
|
325
337
|
})]
|
|
326
|
-
}), /* @__PURE__ */
|
|
338
|
+
}), /* @__PURE__ */ K(b, {
|
|
327
339
|
className: "space-y-4",
|
|
328
|
-
children: N.stops.map((t, r) => /* @__PURE__ */
|
|
340
|
+
children: N.stops.map((t, r) => /* @__PURE__ */ q("div", {
|
|
329
341
|
className: "grid grid-cols-1 md:grid-cols-12 gap-3 items-end",
|
|
330
342
|
children: [
|
|
331
|
-
/* @__PURE__ */
|
|
343
|
+
/* @__PURE__ */ q("div", {
|
|
332
344
|
className: "md:col-span-7 space-y-2",
|
|
333
|
-
children: [/* @__PURE__ */
|
|
345
|
+
children: [/* @__PURE__ */ q(w, {
|
|
334
346
|
htmlFor: `stop-address-${r}`,
|
|
335
347
|
children: [
|
|
336
348
|
"Stop ",
|
|
337
349
|
r + 1,
|
|
338
350
|
" address"
|
|
339
351
|
]
|
|
340
|
-
}), /* @__PURE__ */
|
|
352
|
+
}), /* @__PURE__ */ K(C, {
|
|
341
353
|
id: `stop-address-${r}`,
|
|
342
354
|
value: t.address,
|
|
343
|
-
onChange: (e) =>
|
|
355
|
+
onChange: (e) => me(r, "address", e.target.value),
|
|
344
356
|
placeholder: "123 Main St, San Francisco, CA"
|
|
345
357
|
})]
|
|
346
358
|
}),
|
|
347
|
-
/* @__PURE__ */
|
|
359
|
+
/* @__PURE__ */ q("div", {
|
|
348
360
|
className: "md:col-span-4 space-y-2",
|
|
349
|
-
children: [/* @__PURE__ */
|
|
361
|
+
children: [/* @__PURE__ */ K(w, {
|
|
350
362
|
htmlFor: `stop-type-${r}`,
|
|
351
363
|
children: "Type"
|
|
352
|
-
}), /* @__PURE__ */
|
|
364
|
+
}), /* @__PURE__ */ q(T, {
|
|
353
365
|
value: t.type,
|
|
354
|
-
onValueChange: (e) =>
|
|
355
|
-
children: [/* @__PURE__ */
|
|
366
|
+
onValueChange: (e) => me(r, "type", e),
|
|
367
|
+
children: [/* @__PURE__ */ K(O, {
|
|
356
368
|
id: `stop-type-${r}`,
|
|
357
|
-
children: /* @__PURE__ */
|
|
358
|
-
}), /* @__PURE__ */
|
|
369
|
+
children: /* @__PURE__ */ K(k, {})
|
|
370
|
+
}), /* @__PURE__ */ q(E, { children: [/* @__PURE__ */ K(D, {
|
|
359
371
|
value: "pickup",
|
|
360
372
|
children: "Pickup"
|
|
361
|
-
}), /* @__PURE__ */
|
|
373
|
+
}), /* @__PURE__ */ K(D, {
|
|
362
374
|
value: "delivery",
|
|
363
375
|
children: "Delivery"
|
|
364
376
|
})] })]
|
|
365
377
|
})]
|
|
366
378
|
}),
|
|
367
|
-
/* @__PURE__ */
|
|
379
|
+
/* @__PURE__ */ q("div", {
|
|
368
380
|
className: "md:col-span-1 flex justify-end gap-1",
|
|
369
381
|
children: [
|
|
370
|
-
/* @__PURE__ */
|
|
382
|
+
/* @__PURE__ */ K(v, {
|
|
371
383
|
type: "button",
|
|
372
384
|
variant: "ghost",
|
|
373
385
|
size: "icon",
|
|
374
|
-
onClick: () =>
|
|
386
|
+
onClick: () => he(r, -1),
|
|
375
387
|
disabled: r === 0,
|
|
376
388
|
"aria-label": `Move stop ${r + 1} up`,
|
|
377
|
-
children: /* @__PURE__ */
|
|
389
|
+
children: /* @__PURE__ */ K(n, { size: 16 })
|
|
378
390
|
}),
|
|
379
|
-
/* @__PURE__ */
|
|
391
|
+
/* @__PURE__ */ K(v, {
|
|
380
392
|
type: "button",
|
|
381
393
|
variant: "ghost",
|
|
382
394
|
size: "icon",
|
|
383
|
-
onClick: () =>
|
|
395
|
+
onClick: () => he(r, 1),
|
|
384
396
|
disabled: r === N.stops.length - 1,
|
|
385
397
|
"aria-label": `Move stop ${r + 1} down`,
|
|
386
|
-
children: /* @__PURE__ */
|
|
398
|
+
children: /* @__PURE__ */ K(e, { size: 16 })
|
|
387
399
|
}),
|
|
388
|
-
/* @__PURE__ */
|
|
400
|
+
/* @__PURE__ */ K(v, {
|
|
389
401
|
type: "button",
|
|
390
402
|
variant: "ghost",
|
|
391
403
|
size: "icon",
|
|
392
404
|
className: "text-status-error-text",
|
|
393
|
-
onClick: () =>
|
|
405
|
+
onClick: () => pe(r),
|
|
394
406
|
disabled: N.stops.length === 1,
|
|
395
407
|
"aria-label": `Remove stop ${r + 1}`,
|
|
396
|
-
children: /* @__PURE__ */
|
|
408
|
+
children: /* @__PURE__ */ K(d, { size: 16 })
|
|
397
409
|
})
|
|
398
410
|
]
|
|
399
411
|
})
|
|
@@ -405,185 +417,185 @@ function Z({ editId: r }) {
|
|
|
405
417
|
});
|
|
406
418
|
}
|
|
407
419
|
function Q() {
|
|
408
|
-
let { routeId: e } =
|
|
409
|
-
let n =
|
|
420
|
+
let { routeId: e } = W(), n = ue().pathname.endsWith("/edit"), { basePath: s, navigate: c } = m(), { route: l, isLoading: d, error: re, refetch: h } = te(e), { optimizeRoute: g, updateRoute: ie } = ne(), C = B(e), { t: w } = J(), T = (e, t) => {
|
|
421
|
+
let n = w(e);
|
|
410
422
|
return n === e ? t : n;
|
|
411
|
-
}, { message:
|
|
423
|
+
}, { message: E, notify: D } = ce(), [O, k] = U(null), [L, R] = U(!1), H = () => c?.(p(s, "routes")), G = (e) => c?.(p(s, e)), X = async () => {
|
|
412
424
|
if (e) {
|
|
413
|
-
|
|
425
|
+
R(!0), k(null);
|
|
414
426
|
try {
|
|
415
|
-
await
|
|
427
|
+
await g(e), D("Route optimized — stops resequenced for the shortest run."), h();
|
|
416
428
|
} catch (e) {
|
|
417
|
-
|
|
429
|
+
k(e instanceof Error ? e.message : "Failed to optimize route.");
|
|
418
430
|
} finally {
|
|
419
|
-
|
|
431
|
+
R(!1);
|
|
420
432
|
}
|
|
421
433
|
}
|
|
422
|
-
},
|
|
423
|
-
e && (await
|
|
434
|
+
}, Q = async (t) => {
|
|
435
|
+
e && (await ie(e, t), D(T("movethewheels.routes.suggest.done", "Assignment saved.")), h(), C.refetch());
|
|
424
436
|
};
|
|
425
|
-
if (!e) return /* @__PURE__ */
|
|
426
|
-
if (n) return /* @__PURE__ */
|
|
427
|
-
if (
|
|
428
|
-
if (
|
|
437
|
+
if (!e) return /* @__PURE__ */ K(Z, {});
|
|
438
|
+
if (n) return /* @__PURE__ */ K(Z, { editId: e });
|
|
439
|
+
if (d) return /* @__PURE__ */ K(j, { message: "Loading route details..." });
|
|
440
|
+
if (re || !l) return /* @__PURE__ */ K(A, {
|
|
429
441
|
title: "Route not found",
|
|
430
|
-
onRetry:
|
|
442
|
+
onRetry: h
|
|
431
443
|
});
|
|
432
|
-
let $ =
|
|
433
|
-
let t =
|
|
444
|
+
let $ = l.stops.map((e) => {
|
|
445
|
+
let t = z(e.address);
|
|
434
446
|
return t ? {
|
|
435
447
|
lat: t.lat,
|
|
436
448
|
lng: t.lng,
|
|
437
449
|
sequence: e.sequence,
|
|
438
|
-
label:
|
|
450
|
+
label: F(e.address) || `Order #${e.orderId || e.sequence}`
|
|
439
451
|
} : null;
|
|
440
452
|
}).filter((e) => e !== null);
|
|
441
|
-
return /* @__PURE__ */
|
|
442
|
-
title:
|
|
443
|
-
subtitle: `${
|
|
444
|
-
icon: /* @__PURE__ */
|
|
445
|
-
headerActions: /* @__PURE__ */
|
|
453
|
+
return /* @__PURE__ */ q(ae, {
|
|
454
|
+
title: l.name,
|
|
455
|
+
subtitle: `${l.stops.length} stops - ${l.distance.toFixed(1)} km`,
|
|
456
|
+
icon: /* @__PURE__ */ K(o, { size: 24 }),
|
|
457
|
+
headerActions: /* @__PURE__ */ q("div", {
|
|
446
458
|
className: "flex gap-2",
|
|
447
459
|
children: [
|
|
448
|
-
/* @__PURE__ */
|
|
460
|
+
/* @__PURE__ */ q(v, {
|
|
449
461
|
variant: "outline",
|
|
450
|
-
onClick:
|
|
451
|
-
children: [/* @__PURE__ */
|
|
462
|
+
onClick: H,
|
|
463
|
+
children: [/* @__PURE__ */ K(t, { size: 16 }), " Back"]
|
|
452
464
|
}),
|
|
453
|
-
!
|
|
465
|
+
!l.optimized && /* @__PURE__ */ q(v, {
|
|
454
466
|
variant: "outline",
|
|
455
|
-
onClick:
|
|
456
|
-
disabled:
|
|
467
|
+
onClick: X,
|
|
468
|
+
disabled: L,
|
|
457
469
|
children: [
|
|
458
|
-
/* @__PURE__ */
|
|
470
|
+
/* @__PURE__ */ K(f, { size: 16 }),
|
|
459
471
|
" ",
|
|
460
|
-
|
|
472
|
+
L ? "Optimizing…" : "Optimize"
|
|
461
473
|
]
|
|
462
474
|
}),
|
|
463
|
-
/* @__PURE__ */
|
|
464
|
-
onClick: () => c?.(
|
|
465
|
-
children: [/* @__PURE__ */
|
|
475
|
+
/* @__PURE__ */ q(v, {
|
|
476
|
+
onClick: () => c?.(p(s, `routes/${e}/edit`)),
|
|
477
|
+
children: [/* @__PURE__ */ K(u, { size: 16 }), " Edit"]
|
|
466
478
|
})
|
|
467
479
|
]
|
|
468
480
|
}),
|
|
469
|
-
headerContent: /* @__PURE__ */
|
|
481
|
+
headerContent: /* @__PURE__ */ q("div", {
|
|
470
482
|
className: "flex gap-2",
|
|
471
|
-
children: [/* @__PURE__ */
|
|
472
|
-
status:
|
|
473
|
-
customColors: N[
|
|
474
|
-
}), /* @__PURE__ */
|
|
475
|
-
variant:
|
|
476
|
-
children:
|
|
483
|
+
children: [/* @__PURE__ */ K(P, {
|
|
484
|
+
status: l.status,
|
|
485
|
+
customColors: N[l.status]
|
|
486
|
+
}), /* @__PURE__ */ K(_, {
|
|
487
|
+
variant: l.optimized ? "default" : "secondary",
|
|
488
|
+
children: l.optimized ? "Optimized" : "Not Optimized"
|
|
477
489
|
})]
|
|
478
490
|
}),
|
|
479
491
|
children: [
|
|
480
|
-
/* @__PURE__ */
|
|
481
|
-
icon: /* @__PURE__ */
|
|
492
|
+
/* @__PURE__ */ K(fe, {
|
|
493
|
+
icon: /* @__PURE__ */ K(o, { size: 18 }),
|
|
482
494
|
children: "A single optimized driving plan that chains together this route's stops. Review the sequence, distance and timing here, re-optimize if traffic or stops change, then hand the itinerary to a driver."
|
|
483
495
|
}),
|
|
484
|
-
/* @__PURE__ */
|
|
496
|
+
/* @__PURE__ */ K(Y, {
|
|
485
497
|
storageKey: "movethewheels-route-details",
|
|
486
498
|
steps: [
|
|
487
|
-
...
|
|
499
|
+
...l.optimized ? [] : [{
|
|
488
500
|
id: "optimize",
|
|
489
501
|
label: "Optimize this route",
|
|
490
502
|
description: "Reorder stops to cut distance and driving time.",
|
|
491
|
-
icon: /* @__PURE__ */
|
|
492
|
-
onClick:
|
|
503
|
+
icon: /* @__PURE__ */ K(f, { size: 16 }),
|
|
504
|
+
onClick: X
|
|
493
505
|
}],
|
|
494
506
|
{
|
|
495
507
|
id: "edit",
|
|
496
508
|
label: "Adjust stops",
|
|
497
509
|
description: "Add, remove or reorder the delivery stops.",
|
|
498
|
-
icon: /* @__PURE__ */
|
|
510
|
+
icon: /* @__PURE__ */ K(u, { size: 16 }),
|
|
499
511
|
onClick: () => {}
|
|
500
512
|
},
|
|
501
513
|
{
|
|
502
514
|
id: "orders",
|
|
503
515
|
label: "Review the orders on this route",
|
|
504
516
|
description: "Check the deliveries bundled into this run.",
|
|
505
|
-
icon: /* @__PURE__ */
|
|
506
|
-
onClick: () =>
|
|
517
|
+
icon: /* @__PURE__ */ K(ee, { size: 16 }),
|
|
518
|
+
onClick: () => G("orders")
|
|
507
519
|
}
|
|
508
520
|
]
|
|
509
521
|
}),
|
|
510
|
-
|
|
522
|
+
O && /* @__PURE__ */ K("div", {
|
|
511
523
|
className: "mb-2",
|
|
512
|
-
children: /* @__PURE__ */
|
|
524
|
+
children: /* @__PURE__ */ K(oe, { message: O })
|
|
513
525
|
}),
|
|
514
|
-
|
|
526
|
+
E && /* @__PURE__ */ K("div", {
|
|
515
527
|
className: "mb-2",
|
|
516
|
-
children: /* @__PURE__ */
|
|
528
|
+
children: /* @__PURE__ */ K(se, { message: E })
|
|
517
529
|
}),
|
|
518
|
-
/* @__PURE__ */
|
|
530
|
+
/* @__PURE__ */ q("div", {
|
|
519
531
|
className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
|
|
520
|
-
children: [/* @__PURE__ */
|
|
532
|
+
children: [/* @__PURE__ */ q("div", {
|
|
521
533
|
className: "lg:col-span-2 space-y-6",
|
|
522
|
-
children: [/* @__PURE__ */
|
|
534
|
+
children: [/* @__PURE__ */ q(y, { children: [/* @__PURE__ */ K(x, { children: /* @__PURE__ */ K(S, { children: "Route Map" }) }), /* @__PURE__ */ K(b, { children: $.length > 0 ? /* @__PURE__ */ K(M, {
|
|
523
535
|
className: "overflow-hidden rounded-lg border border-border-seam",
|
|
524
536
|
height: 360,
|
|
525
537
|
stops: $
|
|
526
|
-
}) : /* @__PURE__ */
|
|
538
|
+
}) : /* @__PURE__ */ q("div", {
|
|
527
539
|
className: "rounded-lg border border-border-seam bg-bg-sunken/40 p-4",
|
|
528
|
-
children: [/* @__PURE__ */
|
|
540
|
+
children: [/* @__PURE__ */ K("p", {
|
|
529
541
|
className: "mb-3 text-sm text-text-secondary",
|
|
530
542
|
children: "These stops don't have map coordinates yet — showing the planned sequence instead."
|
|
531
|
-
}), /* @__PURE__ */
|
|
543
|
+
}), /* @__PURE__ */ K("ol", {
|
|
532
544
|
className: "space-y-2",
|
|
533
|
-
children:
|
|
545
|
+
children: l.stops.map((e) => /* @__PURE__ */ q("li", {
|
|
534
546
|
className: "flex items-start gap-3",
|
|
535
|
-
children: [/* @__PURE__ */
|
|
547
|
+
children: [/* @__PURE__ */ K("span", {
|
|
536
548
|
className: "flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-action-primary-bg/10 text-xs font-semibold text-primary",
|
|
537
549
|
children: e.sequence
|
|
538
|
-
}), /* @__PURE__ */
|
|
550
|
+
}), /* @__PURE__ */ K("span", {
|
|
539
551
|
className: "text-sm",
|
|
540
|
-
children:
|
|
552
|
+
children: F(e.address) || `Order #${e.orderId || e.sequence}`
|
|
541
553
|
})]
|
|
542
554
|
}, e.id))
|
|
543
555
|
})]
|
|
544
|
-
}) })] }), /* @__PURE__ */
|
|
556
|
+
}) })] }), /* @__PURE__ */ q(y, { children: [/* @__PURE__ */ K(x, { children: /* @__PURE__ */ q(S, { children: [
|
|
545
557
|
"Stops (",
|
|
546
|
-
|
|
558
|
+
l.stops.length,
|
|
547
559
|
")"
|
|
548
|
-
] }) }), /* @__PURE__ */
|
|
560
|
+
] }) }), /* @__PURE__ */ K(b, { children: /* @__PURE__ */ K("div", {
|
|
549
561
|
className: "space-y-4",
|
|
550
|
-
children:
|
|
562
|
+
children: l.stops.map((e, t) => /* @__PURE__ */ q("div", {
|
|
551
563
|
className: "flex gap-4",
|
|
552
|
-
children: [/* @__PURE__ */
|
|
564
|
+
children: [/* @__PURE__ */ q("div", {
|
|
553
565
|
className: "relative",
|
|
554
|
-
children: [/* @__PURE__ */
|
|
566
|
+
children: [/* @__PURE__ */ K("div", {
|
|
555
567
|
className: `w-8 h-8 rounded-full flex items-center justify-center ${e.status === "completed" ? "bg-status-success-text text-text-inverse" : "bg-bg-sunken"}`,
|
|
556
|
-
children: e.status === "completed" ? /* @__PURE__ */
|
|
557
|
-
}), t <
|
|
558
|
-
}), /* @__PURE__ */
|
|
568
|
+
children: e.status === "completed" ? /* @__PURE__ */ K(r, { size: 16 }) : e.sequence
|
|
569
|
+
}), t < l.stops.length - 1 && /* @__PURE__ */ K("div", { className: "absolute top-8 left-4 w-px h-12 bg-border" })]
|
|
570
|
+
}), /* @__PURE__ */ K("div", {
|
|
559
571
|
className: "flex-1 pb-4",
|
|
560
|
-
children: /* @__PURE__ */
|
|
572
|
+
children: /* @__PURE__ */ q("div", {
|
|
561
573
|
className: "flex items-center justify-between",
|
|
562
|
-
children: [/* @__PURE__ */
|
|
574
|
+
children: [/* @__PURE__ */ q("div", { children: [/* @__PURE__ */ q("div", {
|
|
563
575
|
className: "flex items-center gap-2",
|
|
564
|
-
children: [/* @__PURE__ */
|
|
576
|
+
children: [/* @__PURE__ */ K(_, {
|
|
565
577
|
variant: e.type === "pickup" ? "secondary" : "default",
|
|
566
578
|
className: "capitalize",
|
|
567
579
|
children: e.type
|
|
568
|
-
}), /* @__PURE__ */
|
|
580
|
+
}), /* @__PURE__ */ q("span", {
|
|
569
581
|
className: "font-medium",
|
|
570
582
|
children: ["Order #", e.orderId]
|
|
571
583
|
})]
|
|
572
|
-
}), /* @__PURE__ */
|
|
584
|
+
}), /* @__PURE__ */ K("p", {
|
|
573
585
|
className: "text-sm text-text-secondary mt-1",
|
|
574
|
-
children:
|
|
575
|
-
})] }), /* @__PURE__ */
|
|
586
|
+
children: F(e.address)
|
|
587
|
+
})] }), /* @__PURE__ */ q("div", {
|
|
576
588
|
className: "text-right",
|
|
577
589
|
children: [
|
|
578
|
-
/* @__PURE__ */
|
|
590
|
+
/* @__PURE__ */ q("p", {
|
|
579
591
|
className: "text-sm",
|
|
580
|
-
children: ["Scheduled: ",
|
|
592
|
+
children: ["Scheduled: ", I(e.scheduledTime, "time")]
|
|
581
593
|
}),
|
|
582
|
-
e.actualTime && /* @__PURE__ */
|
|
594
|
+
e.actualTime && /* @__PURE__ */ q("p", {
|
|
583
595
|
className: "text-sm text-status-success-text",
|
|
584
|
-
children: ["Actual: ",
|
|
596
|
+
children: ["Actual: ", I(e.actualTime, "time")]
|
|
585
597
|
}),
|
|
586
|
-
/* @__PURE__ */
|
|
598
|
+
/* @__PURE__ */ q("p", {
|
|
587
599
|
className: "text-xs text-text-secondary",
|
|
588
600
|
children: [e.duration, " min stop"]
|
|
589
601
|
})
|
|
@@ -593,91 +605,91 @@ function Q() {
|
|
|
593
605
|
})]
|
|
594
606
|
}, e.id))
|
|
595
607
|
}) })] })]
|
|
596
|
-
}), /* @__PURE__ */
|
|
608
|
+
}), /* @__PURE__ */ q("div", {
|
|
597
609
|
className: "space-y-6",
|
|
598
610
|
children: [
|
|
599
|
-
(
|
|
600
|
-
suggestions:
|
|
601
|
-
isLoading:
|
|
602
|
-
error:
|
|
603
|
-
onRetry:
|
|
604
|
-
assignedVehicleId:
|
|
605
|
-
assignedDriverId:
|
|
606
|
-
onAssign:
|
|
607
|
-
t:
|
|
611
|
+
(l.status === "planned" || l.status === "in_progress") && /* @__PURE__ */ K(V, {
|
|
612
|
+
suggestions: C.data,
|
|
613
|
+
isLoading: C.isLoading,
|
|
614
|
+
error: C.error,
|
|
615
|
+
onRetry: C.refetch,
|
|
616
|
+
assignedVehicleId: l.vehicleId || void 0,
|
|
617
|
+
assignedDriverId: l.driverId || void 0,
|
|
618
|
+
onAssign: Q,
|
|
619
|
+
t: T
|
|
608
620
|
}),
|
|
609
|
-
/* @__PURE__ */
|
|
621
|
+
/* @__PURE__ */ q(de, {
|
|
610
622
|
className: "space-y-4",
|
|
611
623
|
children: [
|
|
612
|
-
/* @__PURE__ */
|
|
624
|
+
/* @__PURE__ */ K("h2", {
|
|
613
625
|
className: "text-base font-semibold text-text-primary",
|
|
614
626
|
children: "Route Info"
|
|
615
627
|
}),
|
|
616
|
-
/* @__PURE__ */
|
|
628
|
+
/* @__PURE__ */ q("div", { children: [/* @__PURE__ */ K("p", {
|
|
617
629
|
className: "text-sm text-text-secondary",
|
|
618
630
|
children: "Total Distance"
|
|
619
|
-
}), /* @__PURE__ */
|
|
631
|
+
}), /* @__PURE__ */ q("p", {
|
|
620
632
|
className: "text-2xl font-bold",
|
|
621
|
-
children: [
|
|
633
|
+
children: [l.distance.toFixed(1), /* @__PURE__ */ K("span", {
|
|
622
634
|
className: "text-sm font-normal",
|
|
623
635
|
children: " km"
|
|
624
636
|
})]
|
|
625
637
|
})] }),
|
|
626
|
-
/* @__PURE__ */
|
|
638
|
+
/* @__PURE__ */ q("div", { children: [/* @__PURE__ */ K("p", {
|
|
627
639
|
className: "text-sm text-text-secondary",
|
|
628
640
|
children: "Est. Duration"
|
|
629
|
-
}), /* @__PURE__ */
|
|
641
|
+
}), /* @__PURE__ */ q("p", {
|
|
630
642
|
className: "text-2xl font-bold",
|
|
631
|
-
children: [
|
|
643
|
+
children: [l.estimatedDuration, /* @__PURE__ */ K("span", {
|
|
632
644
|
className: "text-sm font-normal",
|
|
633
645
|
children: " min"
|
|
634
646
|
})]
|
|
635
647
|
})] }),
|
|
636
|
-
|
|
648
|
+
l.fuelCost !== void 0 && /* @__PURE__ */ q("div", { children: [/* @__PURE__ */ q("p", {
|
|
637
649
|
className: "text-sm text-text-secondary flex items-center gap-1",
|
|
638
|
-
children: [/* @__PURE__ */
|
|
639
|
-
}), /* @__PURE__ */
|
|
650
|
+
children: [/* @__PURE__ */ K(a, { size: 14 }), " Est. Fuel Cost"]
|
|
651
|
+
}), /* @__PURE__ */ K("p", {
|
|
640
652
|
className: "text-2xl font-bold",
|
|
641
|
-
children:
|
|
653
|
+
children: le(l.fuelCost)
|
|
642
654
|
})] }),
|
|
643
|
-
|
|
655
|
+
l.actualDuration && /* @__PURE__ */ q("div", { children: [/* @__PURE__ */ K("p", {
|
|
644
656
|
className: "text-sm text-text-secondary",
|
|
645
657
|
children: "Actual Duration"
|
|
646
|
-
}), /* @__PURE__ */
|
|
658
|
+
}), /* @__PURE__ */ q("p", {
|
|
647
659
|
className: "text-2xl font-bold",
|
|
648
|
-
children: [
|
|
660
|
+
children: [l.actualDuration, /* @__PURE__ */ K("span", {
|
|
649
661
|
className: "text-sm font-normal",
|
|
650
662
|
children: " min"
|
|
651
663
|
})]
|
|
652
664
|
})] })
|
|
653
665
|
]
|
|
654
666
|
}),
|
|
655
|
-
/* @__PURE__ */
|
|
667
|
+
/* @__PURE__ */ q(y, { children: [/* @__PURE__ */ K(x, { children: /* @__PURE__ */ q(S, {
|
|
656
668
|
className: "flex items-center gap-2",
|
|
657
|
-
children: [/* @__PURE__ */
|
|
658
|
-
}) }), /* @__PURE__ */
|
|
669
|
+
children: [/* @__PURE__ */ K(i, { size: 18 }), " Timeline"]
|
|
670
|
+
}) }), /* @__PURE__ */ q(b, {
|
|
659
671
|
className: "space-y-3",
|
|
660
672
|
children: [
|
|
661
|
-
|
|
673
|
+
l.startTime && /* @__PURE__ */ q("div", { children: [/* @__PURE__ */ K("p", {
|
|
662
674
|
className: "text-sm text-text-secondary",
|
|
663
675
|
children: "Started"
|
|
664
|
-
}), /* @__PURE__ */
|
|
665
|
-
|
|
676
|
+
}), /* @__PURE__ */ K("p", { children: I(l.startTime, "full") })] }),
|
|
677
|
+
l.endTime && /* @__PURE__ */ q("div", { children: [/* @__PURE__ */ K("p", {
|
|
666
678
|
className: "text-sm text-text-secondary",
|
|
667
679
|
children: "Completed"
|
|
668
|
-
}), /* @__PURE__ */
|
|
669
|
-
/* @__PURE__ */
|
|
680
|
+
}), /* @__PURE__ */ K("p", { children: I(l.endTime, "full") })] }),
|
|
681
|
+
/* @__PURE__ */ q("div", { children: [/* @__PURE__ */ K("p", {
|
|
670
682
|
className: "text-sm text-text-secondary",
|
|
671
683
|
children: "Created"
|
|
672
|
-
}), /* @__PURE__ */
|
|
684
|
+
}), /* @__PURE__ */ K("p", { children: I(l.createdAt, "full") })] })
|
|
673
685
|
]
|
|
674
686
|
})] }),
|
|
675
|
-
|
|
687
|
+
l.trafficConditions.length > 0 && /* @__PURE__ */ q(y, { children: [/* @__PURE__ */ K(x, { children: /* @__PURE__ */ K(S, { children: "Traffic Conditions" }) }), /* @__PURE__ */ K(b, { children: l.trafficConditions.map((e, t) => /* @__PURE__ */ q("div", {
|
|
676
688
|
className: `p-2 rounded mb-2 ${e.condition === "severe" ? "bg-status-error-bg-subtle" : (e.condition, "bg-status-warning-bg-subtle")}`,
|
|
677
|
-
children: [/* @__PURE__ */
|
|
689
|
+
children: [/* @__PURE__ */ q("p", {
|
|
678
690
|
className: "text-sm font-medium capitalize",
|
|
679
691
|
children: [e.condition, " traffic"]
|
|
680
|
-
}), /* @__PURE__ */
|
|
692
|
+
}), /* @__PURE__ */ q("p", {
|
|
681
693
|
className: "text-xs text-text-secondary",
|
|
682
694
|
children: [
|
|
683
695
|
e.location,
|