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