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