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