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