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