@burdenoff/microfe-movethewheels 2026.925.1 → 2026.925.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/components/StatusBadge.js +31 -31
- package/dist/constants/index.js +10 -3
- package/dist/hooks/useFleet.js +85 -76
- 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 +41 -1
- package/dist/movethewheels/types/index.d.ts +16 -38
- package/dist/node_modules/lucide-react/dist/esm/icons/sticky-note.js +11 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/user-x.js +30 -0
- package/dist/pages/DriverDetailsPage.js +702 -421
- package/dist/pages/DriversPage.js +106 -117
- package/dist/pages/FleetPage.js +4 -10
- package/dist/pages/OrderDetailsPage.js +279 -274
- package/dist/pages/RouteDetailsPage.js +264 -252
- package/dist/pages/VehicleDetailsPage.js +403 -243
- package/package.json +1 -1
- package/src/movethewheels/components/StatusBadge.tsx +11 -2
- package/src/movethewheels/constants/index.ts +12 -0
- package/src/movethewheels/hooks/useFleet.ts +163 -44
- package/src/movethewheels/pages/DriverDetailsPage.tsx +516 -156
- package/src/movethewheels/pages/DriversPage.tsx +28 -11
- package/src/movethewheels/pages/FleetPage.tsx +7 -10
- package/src/movethewheels/pages/OrderDetailsPage.tsx +12 -7
- package/src/movethewheels/pages/RouteDetailsPage.tsx +15 -7
- package/src/movethewheels/pages/VehicleDetailsPage.tsx +137 -15
- package/src/movethewheels/types/index.ts +16 -38
|
@@ -10,30 +10,31 @@ import { MapPin as r } from "../node_modules/lucide-react/dist/esm/icons/map-pin
|
|
|
10
10
|
import { Package as i } from "../node_modules/lucide-react/dist/esm/icons/package.js";
|
|
11
11
|
import { Phone as ae } from "../node_modules/lucide-react/dist/esm/icons/phone.js";
|
|
12
12
|
import { Printer as a } from "../node_modules/lucide-react/dist/esm/icons/printer.js";
|
|
13
|
+
import { Search as oe } from "../node_modules/lucide-react/dist/esm/icons/search.js";
|
|
13
14
|
import { SquarePen as o } from "../node_modules/lucide-react/dist/esm/icons/square-pen.js";
|
|
14
|
-
import { Truck as
|
|
15
|
-
import { UserCheck as
|
|
16
|
-
import { User as
|
|
15
|
+
import { Truck as se } from "../node_modules/lucide-react/dist/esm/icons/truck.js";
|
|
16
|
+
import { UserCheck as ce } from "../node_modules/lucide-react/dist/esm/icons/user-check.js";
|
|
17
|
+
import { User as le } from "../node_modules/lucide-react/dist/esm/icons/user.js";
|
|
17
18
|
import { joinPath as s } from "../utils/navigation.js";
|
|
18
|
-
import { useMoveTheWheels as
|
|
19
|
-
import { useOrder as
|
|
20
|
-
import { useDriver as
|
|
21
|
-
import { Badge as c, Button as l, Card as u, CardContent as d, CardHeader as f, CardTitle as p, Input as
|
|
19
|
+
import { useMoveTheWheels as ue } from "../providers/MoveTheWheelsProvider.js";
|
|
20
|
+
import { useOrder as de, useOrders as fe } from "../hooks/useOrders.js";
|
|
21
|
+
import { useDriver as pe, useDrivers as me, useVehicle as he, useVehicles as ge } from "../hooks/useFleet.js";
|
|
22
|
+
import { Badge as c, Button as l, Card as u, CardContent as d, CardHeader as f, CardTitle as p, Input as _e, Label as m, Separator as h, Table as ve, TableBody as ye, TableCell as g, TableHead as _, TableHeader as be, TableRow as v } from "../components/ui.js";
|
|
22
23
|
import { ErrorState as xe, LoadingState as Se, PageLayout as Ce } from "../components/PageLayout.js";
|
|
23
|
-
import { PaymentStatusBadge as we, PriorityBadge as Te, StatusBadge as
|
|
24
|
+
import { PaymentStatusBadge as we, PriorityBadge as Te, StatusBadge as y } from "../components/StatusBadge.js";
|
|
24
25
|
import { FormError as Ee } from "../components/FormError.js";
|
|
25
26
|
import { Notice as De, useNotice as Oe } from "../components/Notice.js";
|
|
26
|
-
import { formatAddress as
|
|
27
|
+
import { formatAddress as b, formatCurrency as x, formatDate as S } from "../utils/formatters.js";
|
|
27
28
|
import { DocumentsCard as ke } from "../components/DocumentsCard.js";
|
|
28
29
|
import { useDebouncedValue as Ae } from "../hooks/useDebouncedValue.js";
|
|
29
|
-
import { EntityCombobox as
|
|
30
|
+
import { EntityCombobox as C } from "../components/EntityCombobox.js";
|
|
30
31
|
import { ProofOfDeliveryCard as je } from "../components/ProofOfDeliveryCard.js";
|
|
31
|
-
import { useEffect as
|
|
32
|
+
import { useEffect as w, useState as T } from "react";
|
|
32
33
|
import { useParams as Me } from "react-router";
|
|
33
|
-
import { Fragment as
|
|
34
|
+
import { Fragment as E, jsx as D, jsxs as O } from "react/jsx-runtime";
|
|
34
35
|
import { EmphasisPanel as Ne, NextSteps as Pe, PagePurpose as Fe } from "@burdenoff/fe-libs/ui";
|
|
35
36
|
//#region src/movethewheels/pages/OrderDetailsPage.tsx
|
|
36
|
-
var
|
|
37
|
+
var k = [
|
|
37
38
|
"pending",
|
|
38
39
|
"confirmed",
|
|
39
40
|
"assigned",
|
|
@@ -41,7 +42,7 @@ var O = [
|
|
|
41
42
|
"in_transit",
|
|
42
43
|
"out_for_delivery",
|
|
43
44
|
"delivered"
|
|
44
|
-
],
|
|
45
|
+
], A = {
|
|
45
46
|
pending: "Pending",
|
|
46
47
|
confirmed: "Confirmed",
|
|
47
48
|
assigned: "Assigned",
|
|
@@ -52,389 +53,389 @@ var O = [
|
|
|
52
53
|
returned: "Returned",
|
|
53
54
|
cancelled: "Cancelled",
|
|
54
55
|
failed: "Failed"
|
|
55
|
-
},
|
|
56
|
+
}, j = new Set([
|
|
56
57
|
"delivered",
|
|
57
58
|
"returned",
|
|
58
59
|
"cancelled",
|
|
59
60
|
"failed"
|
|
60
61
|
]);
|
|
61
62
|
function Ie(e) {
|
|
62
|
-
let t =
|
|
63
|
-
return t === -1 || t >=
|
|
63
|
+
let t = k.indexOf(e);
|
|
64
|
+
return t === -1 || t >= k.length - 1 ? null : k[t + 1];
|
|
64
65
|
}
|
|
65
|
-
function
|
|
66
|
-
let { orderId:
|
|
66
|
+
function M() {
|
|
67
|
+
let { orderId: k } = Me(), { basePath: M, navigate: N } = ue(), { order: P, isLoading: Le, error: Re, refetch: F } = de(k), { updateOrder: ze, updateOrderStatus: I } = fe(), [L, Be] = T(""), [R, z] = T(""), [B, V] = T(""), [H, U] = T(!1), [W, G] = T(!1), [K, q] = T(null), J = Ae(L), { vehicles: Y, isLoading: X } = ge({
|
|
67
68
|
limit: 20,
|
|
68
|
-
search:
|
|
69
|
-
driverId:
|
|
70
|
-
}), { drivers:
|
|
69
|
+
search: J || void 0,
|
|
70
|
+
driverId: B || void 0
|
|
71
|
+
}), { drivers: Z, isLoading: Q } = me({
|
|
71
72
|
limit: 20,
|
|
72
|
-
search:
|
|
73
|
-
vehicleId:
|
|
74
|
-
}), { vehicle:
|
|
75
|
-
|
|
76
|
-
!
|
|
73
|
+
search: J || void 0,
|
|
74
|
+
vehicleId: R || void 0
|
|
75
|
+
}), { vehicle: Ve, isLoading: He } = he(R || void 0), { driver: Ue, isLoading: We } = pe(B || void 0), { message: Ge, notify: Ke } = Oe(), qe = Y.filter((e) => e.status === "available" || e.id === P?.vehicleId), Je = Z.filter((e) => e.status === "available" || e.id === P?.driverId);
|
|
76
|
+
w(() => {
|
|
77
|
+
!Q && B && !Z.some((e) => e.id === B) && V("");
|
|
77
78
|
}, [
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
]),
|
|
82
|
-
!
|
|
79
|
+
Z,
|
|
80
|
+
Q,
|
|
81
|
+
B
|
|
82
|
+
]), w(() => {
|
|
83
|
+
!X && R && !Y.some((e) => e.id === R) && z("");
|
|
83
84
|
}, [
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
85
|
+
R,
|
|
86
|
+
Y,
|
|
87
|
+
X
|
|
87
88
|
]);
|
|
88
89
|
let Ye = async () => {
|
|
89
|
-
if (!
|
|
90
|
-
|
|
90
|
+
if (!k || !P) {
|
|
91
|
+
q("This order is no longer available. Refresh and try again.");
|
|
91
92
|
return;
|
|
92
93
|
}
|
|
93
|
-
let e =
|
|
94
|
+
let e = R || P.vehicleId, t = B || P.driverId;
|
|
94
95
|
if (!e || !t) {
|
|
95
|
-
|
|
96
|
+
q("Select both a compatible vehicle and driver before dispatching.");
|
|
96
97
|
return;
|
|
97
98
|
}
|
|
98
|
-
let n = !!(
|
|
99
|
-
|
|
99
|
+
let n = !!(P.vehicleId && P.driverId);
|
|
100
|
+
U(!0), q(null);
|
|
100
101
|
try {
|
|
101
|
-
await ze(
|
|
102
|
+
await ze(k, {
|
|
102
103
|
vehicleId: e,
|
|
103
104
|
driverId: t
|
|
104
|
-
}), !n &&
|
|
105
|
+
}), !n && P.status === "confirmed" && await I(k, "assigned"), Ke(!n && P.status === "confirmed" ? "Fleet assigned and order advanced to Assigned." : "Assignment updated."), z(""), V(""), F();
|
|
105
106
|
} catch (e) {
|
|
106
|
-
|
|
107
|
+
q(e instanceof Error ? e.message : "Failed to update assignment.");
|
|
107
108
|
} finally {
|
|
108
|
-
|
|
109
|
+
U(!1);
|
|
109
110
|
}
|
|
110
|
-
},
|
|
111
|
-
if (!(!
|
|
112
|
-
if (e === "assigned" && (!
|
|
113
|
-
|
|
111
|
+
}, Xe = async (e, t) => {
|
|
112
|
+
if (!(!k || !P)) {
|
|
113
|
+
if (e === "assigned" && (!P.vehicleId || !P.driverId)) {
|
|
114
|
+
q("Assign both a compatible vehicle and driver before advancing to Assigned.");
|
|
114
115
|
return;
|
|
115
116
|
}
|
|
116
|
-
if (!
|
|
117
|
-
|
|
117
|
+
if (!j.has(P.status)) {
|
|
118
|
+
G(!0), q(null);
|
|
118
119
|
try {
|
|
119
|
-
await
|
|
120
|
+
await I(k, e), Ke(t), F();
|
|
120
121
|
} catch (e) {
|
|
121
|
-
|
|
122
|
+
q(e instanceof Error ? e.message : "Failed to update status.");
|
|
122
123
|
} finally {
|
|
123
|
-
|
|
124
|
+
G(!1);
|
|
124
125
|
}
|
|
125
126
|
}
|
|
126
127
|
}
|
|
127
128
|
}, $ = (e) => {
|
|
128
|
-
|
|
129
|
+
N && N(s(M, e));
|
|
129
130
|
};
|
|
130
|
-
return Le ? /* @__PURE__ */
|
|
131
|
+
return Le ? /* @__PURE__ */ D(Se, { message: "Loading order details..." }) : Re || !P ? /* @__PURE__ */ D(xe, {
|
|
131
132
|
title: "Order not found",
|
|
132
133
|
message: "The order you're looking for doesn't exist or has been removed.",
|
|
133
|
-
onRetry:
|
|
134
|
-
}) : /* @__PURE__ */
|
|
135
|
-
title:
|
|
136
|
-
subtitle: `Created ${
|
|
137
|
-
icon: /* @__PURE__ */
|
|
138
|
-
headerActions: /* @__PURE__ */
|
|
134
|
+
onRetry: F
|
|
135
|
+
}) : /* @__PURE__ */ O(Ce, {
|
|
136
|
+
title: P.orderNumber,
|
|
137
|
+
subtitle: `Created ${S(P.createdAt, "full")}`,
|
|
138
|
+
icon: /* @__PURE__ */ D(i, { size: 24 }),
|
|
139
|
+
headerActions: /* @__PURE__ */ O("div", {
|
|
139
140
|
className: "flex gap-2",
|
|
140
141
|
children: [
|
|
141
|
-
/* @__PURE__ */
|
|
142
|
+
/* @__PURE__ */ O(l, {
|
|
142
143
|
variant: "outline",
|
|
143
144
|
onClick: () => {
|
|
144
|
-
|
|
145
|
+
N && N(s(M, "orders"));
|
|
145
146
|
},
|
|
146
|
-
children: [/* @__PURE__ */
|
|
147
|
+
children: [/* @__PURE__ */ D(e, { size: 16 }), "Back"]
|
|
147
148
|
}),
|
|
148
|
-
/* @__PURE__ */
|
|
149
|
+
/* @__PURE__ */ O(l, {
|
|
149
150
|
variant: "outline",
|
|
150
151
|
onClick: () => window.print(),
|
|
151
|
-
children: [/* @__PURE__ */
|
|
152
|
+
children: [/* @__PURE__ */ D(a, { size: 16 }), "Print"]
|
|
152
153
|
}),
|
|
153
|
-
/* @__PURE__ */
|
|
154
|
-
onClick: () => $(`orders/${
|
|
155
|
-
children: [/* @__PURE__ */
|
|
154
|
+
/* @__PURE__ */ O(l, {
|
|
155
|
+
onClick: () => $(`orders/${k}/edit`),
|
|
156
|
+
children: [/* @__PURE__ */ D(o, { size: 16 }), "Edit"]
|
|
156
157
|
})
|
|
157
158
|
]
|
|
158
159
|
}),
|
|
159
|
-
headerContent: /* @__PURE__ */
|
|
160
|
+
headerContent: /* @__PURE__ */ O("div", {
|
|
160
161
|
className: "flex flex-wrap gap-2",
|
|
161
162
|
children: [
|
|
162
|
-
/* @__PURE__ */
|
|
163
|
-
status:
|
|
163
|
+
/* @__PURE__ */ D(y, {
|
|
164
|
+
status: P.status,
|
|
164
165
|
type: "order"
|
|
165
166
|
}),
|
|
166
|
-
/* @__PURE__ */
|
|
167
|
-
/* @__PURE__ */
|
|
167
|
+
/* @__PURE__ */ D(Te, { priority: P.priority }),
|
|
168
|
+
/* @__PURE__ */ D(we, { status: P.pricing.paymentStatus })
|
|
168
169
|
]
|
|
169
170
|
}),
|
|
170
171
|
children: [
|
|
171
|
-
/* @__PURE__ */
|
|
172
|
-
icon: /* @__PURE__ */
|
|
172
|
+
/* @__PURE__ */ D(Fe, {
|
|
173
|
+
icon: /* @__PURE__ */ D(i, { size: 18 }),
|
|
173
174
|
children: "Everything about this one delivery in a single place — who it's for, where it's going, what's inside, the running cost and the full status history. Use this page to review the order, hand it to a driver, print the docket, or jump into live tracking."
|
|
174
175
|
}),
|
|
175
|
-
/* @__PURE__ */
|
|
176
|
+
/* @__PURE__ */ D(Pe, {
|
|
176
177
|
storageKey: "movethewheels-order-details",
|
|
177
178
|
steps: [
|
|
178
179
|
{
|
|
179
180
|
id: "track",
|
|
180
181
|
label: "Track this order live",
|
|
181
182
|
description: "See where the shipment is right now on the map.",
|
|
182
|
-
icon: /* @__PURE__ */
|
|
183
|
-
onClick: () => $(`tracking?order=${
|
|
183
|
+
icon: /* @__PURE__ */ D(r, { size: 16 }),
|
|
184
|
+
onClick: () => $(`tracking?order=${P.id}`)
|
|
184
185
|
},
|
|
185
186
|
{
|
|
186
187
|
id: "edit",
|
|
187
188
|
label: "Edit order details",
|
|
188
189
|
description: "Update items, addresses or instructions before dispatch.",
|
|
189
|
-
icon: /* @__PURE__ */
|
|
190
|
-
onClick: () => $(`orders/${
|
|
190
|
+
icon: /* @__PURE__ */ D(o, { size: 16 }),
|
|
191
|
+
onClick: () => $(`orders/${k}/edit`)
|
|
191
192
|
},
|
|
192
193
|
{
|
|
193
194
|
id: "print",
|
|
194
195
|
label: "Print the delivery docket",
|
|
195
196
|
description: "Generate a printable copy for the driver or warehouse.",
|
|
196
|
-
icon: /* @__PURE__ */
|
|
197
|
+
icon: /* @__PURE__ */ D(a, { size: 16 }),
|
|
197
198
|
onClick: () => window.print()
|
|
198
199
|
}
|
|
199
200
|
]
|
|
200
201
|
}),
|
|
201
|
-
/* @__PURE__ */
|
|
202
|
+
/* @__PURE__ */ O("div", {
|
|
202
203
|
className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
|
|
203
|
-
children: [/* @__PURE__ */
|
|
204
|
+
children: [/* @__PURE__ */ O("div", {
|
|
204
205
|
className: "lg:col-span-2 space-y-6",
|
|
205
206
|
children: [
|
|
206
|
-
/* @__PURE__ */
|
|
207
|
+
/* @__PURE__ */ O(u, { children: [/* @__PURE__ */ D(f, { children: /* @__PURE__ */ O(p, {
|
|
207
208
|
className: "flex items-center gap-2",
|
|
208
|
-
children: [/* @__PURE__ */
|
|
209
|
-
}) }), /* @__PURE__ */
|
|
209
|
+
children: [/* @__PURE__ */ D(le, { size: 18 }), "Customer Information"]
|
|
210
|
+
}) }), /* @__PURE__ */ D(d, { children: /* @__PURE__ */ O("div", {
|
|
210
211
|
className: "grid grid-cols-1 md:grid-cols-2 gap-6",
|
|
211
|
-
children: [/* @__PURE__ */
|
|
212
|
-
/* @__PURE__ */
|
|
212
|
+
children: [/* @__PURE__ */ O("div", { children: [
|
|
213
|
+
/* @__PURE__ */ D("h4", {
|
|
213
214
|
className: "font-medium mb-2",
|
|
214
|
-
children:
|
|
215
|
+
children: P.customerInfo.name
|
|
215
216
|
}),
|
|
216
|
-
|
|
217
|
+
P.customerInfo.company && /* @__PURE__ */ D("p", {
|
|
217
218
|
className: "text-sm text-text-secondary mb-2",
|
|
218
|
-
children:
|
|
219
|
+
children: P.customerInfo.company
|
|
219
220
|
}),
|
|
220
|
-
/* @__PURE__ */
|
|
221
|
+
/* @__PURE__ */ O("div", {
|
|
221
222
|
className: "space-y-1 text-sm",
|
|
222
|
-
children: [/* @__PURE__ */
|
|
223
|
+
children: [/* @__PURE__ */ O("p", {
|
|
223
224
|
className: "flex items-center gap-2",
|
|
224
|
-
children: [/* @__PURE__ */
|
|
225
|
+
children: [/* @__PURE__ */ D(ie, {
|
|
225
226
|
size: 14,
|
|
226
227
|
className: "text-text-secondary"
|
|
227
|
-
}),
|
|
228
|
-
}), /* @__PURE__ */
|
|
228
|
+
}), P.customerInfo.email]
|
|
229
|
+
}), /* @__PURE__ */ O("p", {
|
|
229
230
|
className: "flex items-center gap-2",
|
|
230
|
-
children: [/* @__PURE__ */
|
|
231
|
+
children: [/* @__PURE__ */ D(ae, {
|
|
231
232
|
size: 14,
|
|
232
233
|
className: "text-text-secondary"
|
|
233
|
-
}),
|
|
234
|
+
}), P.customerInfo.phone]
|
|
234
235
|
})]
|
|
235
236
|
})
|
|
236
|
-
] }), /* @__PURE__ */
|
|
237
|
+
] }), /* @__PURE__ */ O("div", { children: [P.customerInfo.preferredDeliveryTime && /* @__PURE__ */ O("div", {
|
|
237
238
|
className: "mb-2",
|
|
238
|
-
children: [/* @__PURE__ */
|
|
239
|
+
children: [/* @__PURE__ */ D("p", {
|
|
239
240
|
className: "text-sm text-text-secondary",
|
|
240
241
|
children: "Preferred Delivery Time"
|
|
241
|
-
}), /* @__PURE__ */
|
|
242
|
+
}), /* @__PURE__ */ D("p", {
|
|
242
243
|
className: "text-sm",
|
|
243
|
-
children:
|
|
244
|
+
children: P.customerInfo.preferredDeliveryTime
|
|
244
245
|
})]
|
|
245
|
-
}),
|
|
246
|
+
}), P.customerInfo.deliveryInstructions && /* @__PURE__ */ O("div", { children: [/* @__PURE__ */ D("p", {
|
|
246
247
|
className: "text-sm text-text-secondary",
|
|
247
248
|
children: "Delivery Instructions"
|
|
248
|
-
}), /* @__PURE__ */
|
|
249
|
+
}), /* @__PURE__ */ D("p", {
|
|
249
250
|
className: "text-sm",
|
|
250
|
-
children:
|
|
251
|
+
children: P.customerInfo.deliveryInstructions
|
|
251
252
|
})] })] })]
|
|
252
253
|
}) })] }),
|
|
253
|
-
/* @__PURE__ */
|
|
254
|
+
/* @__PURE__ */ O(u, { children: [/* @__PURE__ */ D(f, { children: /* @__PURE__ */ O(p, {
|
|
254
255
|
className: "flex items-center gap-2",
|
|
255
|
-
children: [/* @__PURE__ */
|
|
256
|
-
}) }), /* @__PURE__ */
|
|
256
|
+
children: [/* @__PURE__ */ D(r, { size: 18 }), "Addresses"]
|
|
257
|
+
}) }), /* @__PURE__ */ D(d, { children: /* @__PURE__ */ O("div", {
|
|
257
258
|
className: "grid grid-cols-1 md:grid-cols-2 gap-6",
|
|
258
|
-
children: [/* @__PURE__ */
|
|
259
|
-
/* @__PURE__ */
|
|
259
|
+
children: [/* @__PURE__ */ O("div", { children: [
|
|
260
|
+
/* @__PURE__ */ D("h4", {
|
|
260
261
|
className: "font-medium mb-2 flex items-center gap-2",
|
|
261
|
-
children: /* @__PURE__ */
|
|
262
|
+
children: /* @__PURE__ */ D(c, {
|
|
262
263
|
variant: "outline",
|
|
263
264
|
children: "Pickup"
|
|
264
265
|
})
|
|
265
266
|
}),
|
|
266
|
-
/* @__PURE__ */
|
|
267
|
+
/* @__PURE__ */ D("p", {
|
|
267
268
|
className: "text-sm",
|
|
268
|
-
children:
|
|
269
|
+
children: b(P.pickupAddress)
|
|
269
270
|
}),
|
|
270
|
-
|
|
271
|
+
P.scheduledPickup && /* @__PURE__ */ O("p", {
|
|
271
272
|
className: "text-sm text-text-secondary mt-2",
|
|
272
|
-
children: ["Scheduled: ",
|
|
273
|
+
children: ["Scheduled: ", S(P.scheduledPickup, "full")]
|
|
273
274
|
}),
|
|
274
|
-
|
|
275
|
+
P.actualPickup && /* @__PURE__ */ O("p", {
|
|
275
276
|
className: "text-sm text-status-success-text mt-1",
|
|
276
277
|
children: [
|
|
277
|
-
/* @__PURE__ */
|
|
278
|
+
/* @__PURE__ */ D(n, {
|
|
278
279
|
size: 14,
|
|
279
280
|
className: "inline mr-1"
|
|
280
281
|
}),
|
|
281
282
|
"Picked up: ",
|
|
282
|
-
|
|
283
|
+
S(P.actualPickup, "full")
|
|
283
284
|
]
|
|
284
285
|
})
|
|
285
|
-
] }), /* @__PURE__ */
|
|
286
|
-
/* @__PURE__ */
|
|
286
|
+
] }), /* @__PURE__ */ O("div", { children: [
|
|
287
|
+
/* @__PURE__ */ D("h4", {
|
|
287
288
|
className: "font-medium mb-2 flex items-center gap-2",
|
|
288
|
-
children: /* @__PURE__ */
|
|
289
|
+
children: /* @__PURE__ */ D(c, {
|
|
289
290
|
variant: "outline",
|
|
290
291
|
children: "Delivery"
|
|
291
292
|
})
|
|
292
293
|
}),
|
|
293
|
-
/* @__PURE__ */
|
|
294
|
+
/* @__PURE__ */ D("p", {
|
|
294
295
|
className: "text-sm",
|
|
295
|
-
children:
|
|
296
|
+
children: b(P.deliveryAddress)
|
|
296
297
|
}),
|
|
297
|
-
|
|
298
|
+
P.scheduledDelivery && /* @__PURE__ */ O("p", {
|
|
298
299
|
className: "text-sm text-text-secondary mt-2",
|
|
299
|
-
children: ["Scheduled: ",
|
|
300
|
+
children: ["Scheduled: ", S(P.scheduledDelivery, "full")]
|
|
300
301
|
}),
|
|
301
|
-
|
|
302
|
+
P.actualDelivery && /* @__PURE__ */ O("p", {
|
|
302
303
|
className: "text-sm text-status-success-text mt-1",
|
|
303
304
|
children: [
|
|
304
|
-
/* @__PURE__ */
|
|
305
|
+
/* @__PURE__ */ D(n, {
|
|
305
306
|
size: 14,
|
|
306
307
|
className: "inline mr-1"
|
|
307
308
|
}),
|
|
308
309
|
"Delivered: ",
|
|
309
|
-
|
|
310
|
+
S(P.actualDelivery, "full")
|
|
310
311
|
]
|
|
311
312
|
})
|
|
312
313
|
] })]
|
|
313
314
|
}) })] }),
|
|
314
|
-
/* @__PURE__ */
|
|
315
|
+
/* @__PURE__ */ O(u, { children: [/* @__PURE__ */ D(f, { children: /* @__PURE__ */ O(p, {
|
|
315
316
|
className: "flex items-center gap-2",
|
|
316
|
-
children: [/* @__PURE__ */
|
|
317
|
-
}) }), /* @__PURE__ */
|
|
317
|
+
children: [/* @__PURE__ */ D(se, { size: 18 }), "Saved Route"]
|
|
318
|
+
}) }), /* @__PURE__ */ D(d, { children: P.route ? /* @__PURE__ */ O("div", {
|
|
318
319
|
className: "space-y-3",
|
|
319
|
-
children: [/* @__PURE__ */
|
|
320
|
+
children: [/* @__PURE__ */ O("div", {
|
|
320
321
|
className: "flex items-center justify-between gap-3",
|
|
321
|
-
children: [/* @__PURE__ */
|
|
322
|
+
children: [/* @__PURE__ */ O("div", { children: [/* @__PURE__ */ D("p", {
|
|
322
323
|
className: "font-medium",
|
|
323
|
-
children:
|
|
324
|
-
}), /* @__PURE__ */
|
|
324
|
+
children: P.route.name
|
|
325
|
+
}), /* @__PURE__ */ O("p", {
|
|
325
326
|
className: "text-sm text-text-secondary",
|
|
326
327
|
children: [
|
|
327
|
-
|
|
328
|
+
P.route.stops.length,
|
|
328
329
|
" stops ·",
|
|
329
330
|
" ",
|
|
330
|
-
|
|
331
|
+
P.route.status.replace("_", " ").toLowerCase()
|
|
331
332
|
]
|
|
332
|
-
})] }), /* @__PURE__ */
|
|
333
|
+
})] }), /* @__PURE__ */ D(c, {
|
|
333
334
|
variant: "outline",
|
|
334
335
|
children: "Reusable route"
|
|
335
336
|
})]
|
|
336
|
-
}), /* @__PURE__ */
|
|
337
|
+
}), /* @__PURE__ */ D("div", {
|
|
337
338
|
className: "space-y-2",
|
|
338
|
-
children:
|
|
339
|
+
children: P.route.stops.map((e, t) => /* @__PURE__ */ O("div", {
|
|
339
340
|
className: "flex items-start gap-2 text-sm",
|
|
340
|
-
children: [/* @__PURE__ */
|
|
341
|
+
children: [/* @__PURE__ */ O("span", {
|
|
341
342
|
className: "text-text-secondary",
|
|
342
343
|
children: [t + 1, "."]
|
|
343
|
-
}), /* @__PURE__ */
|
|
344
|
-
/* @__PURE__ */
|
|
344
|
+
}), /* @__PURE__ */ O("span", { children: [
|
|
345
|
+
/* @__PURE__ */ D("span", {
|
|
345
346
|
className: "font-medium capitalize",
|
|
346
347
|
children: e.type
|
|
347
348
|
}),
|
|
348
349
|
" ·",
|
|
349
350
|
" ",
|
|
350
|
-
|
|
351
|
+
b(e.address)
|
|
351
352
|
] })]
|
|
352
353
|
}, e.id))
|
|
353
354
|
})]
|
|
354
|
-
}) : /* @__PURE__ */
|
|
355
|
+
}) : /* @__PURE__ */ D("p", {
|
|
355
356
|
className: "text-sm text-text-secondary",
|
|
356
357
|
children: "No saved route was selected for this order."
|
|
357
358
|
}) })] }),
|
|
358
|
-
/* @__PURE__ */
|
|
359
|
+
/* @__PURE__ */ O(u, { children: [/* @__PURE__ */ D(f, { children: /* @__PURE__ */ O(p, {
|
|
359
360
|
className: "flex items-center gap-2",
|
|
360
361
|
children: [
|
|
361
|
-
/* @__PURE__ */
|
|
362
|
+
/* @__PURE__ */ D(i, { size: 18 }),
|
|
362
363
|
"Order Items (",
|
|
363
|
-
|
|
364
|
+
P.items.length,
|
|
364
365
|
")"
|
|
365
366
|
]
|
|
366
|
-
}) }), /* @__PURE__ */
|
|
367
|
+
}) }), /* @__PURE__ */ D(d, {
|
|
367
368
|
className: "p-0",
|
|
368
|
-
children: /* @__PURE__ */
|
|
369
|
-
/* @__PURE__ */
|
|
370
|
-
/* @__PURE__ */
|
|
371
|
-
/* @__PURE__ */
|
|
369
|
+
children: /* @__PURE__ */ O(ve, { children: [/* @__PURE__ */ D(be, { children: /* @__PURE__ */ O(v, { children: [
|
|
370
|
+
/* @__PURE__ */ D(_, { children: "Item" }),
|
|
371
|
+
/* @__PURE__ */ D(_, { children: "SKU" }),
|
|
372
|
+
/* @__PURE__ */ D(_, {
|
|
372
373
|
className: "text-center",
|
|
373
374
|
children: "Qty"
|
|
374
375
|
}),
|
|
375
|
-
/* @__PURE__ */
|
|
376
|
+
/* @__PURE__ */ D(_, {
|
|
376
377
|
className: "text-right",
|
|
377
378
|
children: "Unit Price"
|
|
378
379
|
}),
|
|
379
|
-
/* @__PURE__ */
|
|
380
|
+
/* @__PURE__ */ D(_, {
|
|
380
381
|
className: "text-right",
|
|
381
382
|
children: "Total"
|
|
382
383
|
})
|
|
383
|
-
] }) }), /* @__PURE__ */
|
|
384
|
-
/* @__PURE__ */
|
|
384
|
+
] }) }), /* @__PURE__ */ D(ye, { children: P.items.map((e) => /* @__PURE__ */ O(v, { children: [
|
|
385
|
+
/* @__PURE__ */ D(g, { children: /* @__PURE__ */ O("div", { children: [/* @__PURE__ */ D("p", {
|
|
385
386
|
className: "font-medium",
|
|
386
387
|
children: e.name
|
|
387
|
-
}), e.description && /* @__PURE__ */
|
|
388
|
+
}), e.description && /* @__PURE__ */ D("p", {
|
|
388
389
|
className: "text-sm text-text-secondary",
|
|
389
390
|
children: e.description
|
|
390
391
|
})] }) }),
|
|
391
|
-
/* @__PURE__ */
|
|
392
|
+
/* @__PURE__ */ D(g, {
|
|
392
393
|
className: "font-mono text-sm",
|
|
393
394
|
children: e.sku
|
|
394
395
|
}),
|
|
395
|
-
/* @__PURE__ */
|
|
396
|
+
/* @__PURE__ */ D(g, {
|
|
396
397
|
className: "text-center",
|
|
397
398
|
children: e.quantity
|
|
398
399
|
}),
|
|
399
|
-
/* @__PURE__ */
|
|
400
|
+
/* @__PURE__ */ D(g, {
|
|
400
401
|
className: "text-right",
|
|
401
|
-
children:
|
|
402
|
+
children: x(e.value)
|
|
402
403
|
}),
|
|
403
|
-
/* @__PURE__ */
|
|
404
|
+
/* @__PURE__ */ D(g, {
|
|
404
405
|
className: "text-right font-medium",
|
|
405
|
-
children:
|
|
406
|
+
children: x(e.value * e.quantity)
|
|
406
407
|
})
|
|
407
408
|
] }, e.id)) })] })
|
|
408
409
|
})] }),
|
|
409
|
-
/* @__PURE__ */
|
|
410
|
+
/* @__PURE__ */ O(u, { children: [/* @__PURE__ */ D(f, { children: /* @__PURE__ */ O(p, {
|
|
410
411
|
className: "flex items-center gap-2",
|
|
411
|
-
children: [/* @__PURE__ */
|
|
412
|
-
}) }), /* @__PURE__ */
|
|
412
|
+
children: [/* @__PURE__ */ D(te, { size: 18 }), "Order Timeline"]
|
|
413
|
+
}) }), /* @__PURE__ */ D(d, { children: /* @__PURE__ */ D("div", {
|
|
413
414
|
className: "relative",
|
|
414
|
-
children:
|
|
415
|
+
children: P.timeline.map((e, t) => /* @__PURE__ */ O("div", {
|
|
415
416
|
className: "flex gap-4 pb-6 last:pb-0",
|
|
416
|
-
children: [/* @__PURE__ */
|
|
417
|
+
children: [/* @__PURE__ */ O("div", {
|
|
417
418
|
className: "relative",
|
|
418
|
-
children: [/* @__PURE__ */
|
|
419
|
-
}), /* @__PURE__ */
|
|
419
|
+
children: [/* @__PURE__ */ D("div", { className: "w-3 h-3 rounded-full bg-action-primary-bg mt-1.5" }), t < P.timeline.length - 1 && /* @__PURE__ */ D("div", { className: "absolute top-4 left-1.5 w-px h-full -ml-px bg-border" })]
|
|
420
|
+
}), /* @__PURE__ */ O("div", {
|
|
420
421
|
className: "flex-1",
|
|
421
422
|
children: [
|
|
422
|
-
/* @__PURE__ */
|
|
423
|
+
/* @__PURE__ */ O("div", {
|
|
423
424
|
className: "flex items-center gap-2 mb-1",
|
|
424
|
-
children: [/* @__PURE__ */
|
|
425
|
+
children: [/* @__PURE__ */ D(y, {
|
|
425
426
|
status: e.status,
|
|
426
427
|
type: "order",
|
|
427
428
|
size: "sm"
|
|
428
|
-
}), /* @__PURE__ */
|
|
429
|
+
}), /* @__PURE__ */ D("span", {
|
|
429
430
|
className: "text-sm text-text-secondary",
|
|
430
|
-
children:
|
|
431
|
+
children: S(e.timestamp, "full")
|
|
431
432
|
})]
|
|
432
433
|
}),
|
|
433
|
-
e.notes && /* @__PURE__ */
|
|
434
|
+
e.notes && /* @__PURE__ */ D("p", {
|
|
434
435
|
className: "text-sm",
|
|
435
436
|
children: e.notes
|
|
436
437
|
}),
|
|
437
|
-
/* @__PURE__ */
|
|
438
|
+
/* @__PURE__ */ O("p", {
|
|
438
439
|
className: "text-xs text-text-secondary",
|
|
439
440
|
children: ["by ", e.performedBy]
|
|
440
441
|
})
|
|
@@ -443,219 +444,223 @@ function j() {
|
|
|
443
444
|
}, t))
|
|
444
445
|
}) })] })
|
|
445
446
|
]
|
|
446
|
-
}), /* @__PURE__ */
|
|
447
|
+
}), /* @__PURE__ */ O("div", {
|
|
447
448
|
className: "space-y-6",
|
|
448
449
|
children: [
|
|
449
|
-
/* @__PURE__ */
|
|
450
|
+
/* @__PURE__ */ O(Ne, { children: [/* @__PURE__ */ O("h2", {
|
|
450
451
|
className: "flex items-center gap-2 text-base font-semibold text-text-primary mb-4",
|
|
451
|
-
children: [/* @__PURE__ */
|
|
452
|
-
}), /* @__PURE__ */
|
|
452
|
+
children: [/* @__PURE__ */ D(ne, { size: 18 }), "Order Summary"]
|
|
453
|
+
}), /* @__PURE__ */ O("div", {
|
|
453
454
|
className: "space-y-3",
|
|
454
455
|
children: [
|
|
455
|
-
/* @__PURE__ */
|
|
456
|
+
/* @__PURE__ */ O("div", {
|
|
456
457
|
className: "flex justify-between text-sm",
|
|
457
|
-
children: [/* @__PURE__ */
|
|
458
|
+
children: [/* @__PURE__ */ D("span", {
|
|
458
459
|
className: "text-text-secondary",
|
|
459
460
|
children: "Subtotal"
|
|
460
|
-
}), /* @__PURE__ */
|
|
461
|
+
}), /* @__PURE__ */ D("span", { children: x(P.pricing.subtotal) })]
|
|
461
462
|
}),
|
|
462
|
-
/* @__PURE__ */
|
|
463
|
+
/* @__PURE__ */ O("div", {
|
|
463
464
|
className: "flex justify-between text-sm",
|
|
464
|
-
children: [/* @__PURE__ */
|
|
465
|
+
children: [/* @__PURE__ */ D("span", {
|
|
465
466
|
className: "text-text-secondary",
|
|
466
467
|
children: "Delivery"
|
|
467
|
-
}), /* @__PURE__ */
|
|
468
|
+
}), /* @__PURE__ */ D("span", { children: x(P.pricing.fees.delivery) })]
|
|
468
469
|
}),
|
|
469
|
-
/* @__PURE__ */
|
|
470
|
+
/* @__PURE__ */ O("div", {
|
|
470
471
|
className: "flex justify-between text-sm",
|
|
471
|
-
children: [/* @__PURE__ */
|
|
472
|
+
children: [/* @__PURE__ */ D("span", {
|
|
472
473
|
className: "text-text-secondary",
|
|
473
474
|
children: "Handling"
|
|
474
|
-
}), /* @__PURE__ */
|
|
475
|
+
}), /* @__PURE__ */ D("span", { children: x(P.pricing.fees.handling) })]
|
|
475
476
|
}),
|
|
476
|
-
|
|
477
|
+
P.pricing.fees.insurance && /* @__PURE__ */ O("div", {
|
|
477
478
|
className: "flex justify-between text-sm",
|
|
478
|
-
children: [/* @__PURE__ */
|
|
479
|
+
children: [/* @__PURE__ */ D("span", {
|
|
479
480
|
className: "text-text-secondary",
|
|
480
481
|
children: "Insurance"
|
|
481
|
-
}), /* @__PURE__ */
|
|
482
|
+
}), /* @__PURE__ */ D("span", { children: x(P.pricing.fees.insurance) })]
|
|
482
483
|
}),
|
|
483
|
-
/* @__PURE__ */
|
|
484
|
+
/* @__PURE__ */ O("div", {
|
|
484
485
|
className: "flex justify-between text-sm",
|
|
485
|
-
children: [/* @__PURE__ */
|
|
486
|
+
children: [/* @__PURE__ */ D("span", {
|
|
486
487
|
className: "text-text-secondary",
|
|
487
488
|
children: "Taxes"
|
|
488
|
-
}), /* @__PURE__ */
|
|
489
|
+
}), /* @__PURE__ */ D("span", { children: x(P.pricing.taxes) })]
|
|
489
490
|
}),
|
|
490
|
-
/* @__PURE__ */
|
|
491
|
-
/* @__PURE__ */
|
|
491
|
+
/* @__PURE__ */ D(h, {}),
|
|
492
|
+
/* @__PURE__ */ O("div", {
|
|
492
493
|
className: "flex justify-between font-medium",
|
|
493
|
-
children: [/* @__PURE__ */
|
|
494
|
+
children: [/* @__PURE__ */ D("span", { children: "Total" }), /* @__PURE__ */ D("span", {
|
|
494
495
|
className: "text-lg",
|
|
495
|
-
children:
|
|
496
|
+
children: x(P.pricing.total)
|
|
496
497
|
})]
|
|
497
498
|
}),
|
|
498
|
-
/* @__PURE__ */
|
|
499
|
+
/* @__PURE__ */ O("div", {
|
|
499
500
|
className: "pt-2",
|
|
500
|
-
children: [/* @__PURE__ */
|
|
501
|
+
children: [/* @__PURE__ */ D("p", {
|
|
501
502
|
className: "text-sm text-text-secondary",
|
|
502
503
|
children: "Payment Method"
|
|
503
|
-
}), /* @__PURE__ */
|
|
504
|
+
}), /* @__PURE__ */ D("p", {
|
|
504
505
|
className: "text-sm capitalize",
|
|
505
|
-
children:
|
|
506
|
+
children: P.pricing.paymentMethod.replace("_", " ")
|
|
506
507
|
})]
|
|
507
508
|
})
|
|
508
509
|
]
|
|
509
510
|
})] }),
|
|
510
|
-
/* @__PURE__ */
|
|
511
|
+
/* @__PURE__ */ O(u, { children: [/* @__PURE__ */ D(f, { children: /* @__PURE__ */ O(p, {
|
|
511
512
|
className: "flex items-center gap-2",
|
|
512
|
-
children: [/* @__PURE__ */
|
|
513
|
-
}) }), /* @__PURE__ */
|
|
513
|
+
children: [/* @__PURE__ */ D(se, { size: 18 }), "Assignment"]
|
|
514
|
+
}) }), /* @__PURE__ */ D(d, { children: /* @__PURE__ */ O("div", {
|
|
514
515
|
className: "space-y-4",
|
|
515
516
|
children: [
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
/* @__PURE__ */
|
|
517
|
+
K && /* @__PURE__ */ D(Ee, { message: K }),
|
|
518
|
+
Ge && /* @__PURE__ */ D(De, { message: Ge }),
|
|
519
|
+
/* @__PURE__ */ O("div", { children: [/* @__PURE__ */ D("p", {
|
|
519
520
|
className: "text-sm text-text-secondary",
|
|
520
521
|
children: "Tracking Number"
|
|
521
|
-
}), /* @__PURE__ */
|
|
522
|
+
}), /* @__PURE__ */ D("p", {
|
|
522
523
|
className: "text-sm font-mono",
|
|
523
|
-
children:
|
|
524
|
+
children: P.trackingNumber || "—"
|
|
524
525
|
})] }),
|
|
525
|
-
/* @__PURE__ */
|
|
526
|
-
/* @__PURE__ */
|
|
526
|
+
/* @__PURE__ */ D(h, {}),
|
|
527
|
+
/* @__PURE__ */ O("div", {
|
|
527
528
|
className: "space-y-3",
|
|
528
529
|
children: [
|
|
529
|
-
/* @__PURE__ */
|
|
530
|
+
/* @__PURE__ */ O("div", {
|
|
530
531
|
className: "space-y-1.5",
|
|
531
|
-
children: [/* @__PURE__ */
|
|
532
|
+
children: [/* @__PURE__ */ D(m, {
|
|
532
533
|
htmlFor: "assign-fleet-search",
|
|
533
|
-
children: "Search
|
|
534
|
-
}), /* @__PURE__ */
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
534
|
+
children: "Search vehicles & drivers"
|
|
535
|
+
}), /* @__PURE__ */ O("div", {
|
|
536
|
+
className: "relative",
|
|
537
|
+
children: [/* @__PURE__ */ D(oe, { className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-secondary" }), /* @__PURE__ */ D(_e, {
|
|
538
|
+
id: "assign-fleet-search",
|
|
539
|
+
value: L,
|
|
540
|
+
onChange: (e) => Be(e.target.value),
|
|
541
|
+
placeholder: "Vehicle number, driver name or employee ID",
|
|
542
|
+
className: "pl-9"
|
|
543
|
+
})]
|
|
539
544
|
})]
|
|
540
545
|
}),
|
|
541
|
-
/* @__PURE__ */
|
|
546
|
+
/* @__PURE__ */ O("div", {
|
|
542
547
|
className: "space-y-1.5",
|
|
543
|
-
children: [/* @__PURE__ */
|
|
548
|
+
children: [/* @__PURE__ */ D(m, {
|
|
544
549
|
htmlFor: "assign-vehicle",
|
|
545
550
|
children: "Vehicle"
|
|
546
|
-
}), /* @__PURE__ */
|
|
551
|
+
}), /* @__PURE__ */ D(C, {
|
|
547
552
|
id: "assign-vehicle",
|
|
548
|
-
value:
|
|
549
|
-
onChange:
|
|
553
|
+
value: R,
|
|
554
|
+
onChange: z,
|
|
550
555
|
options: qe,
|
|
551
|
-
loading:
|
|
556
|
+
loading: X,
|
|
552
557
|
getId: (e) => e.id,
|
|
553
558
|
getLabel: (e) => `${e.vehicleNumber} (${e.type})`,
|
|
554
|
-
renderOption: (e) => /* @__PURE__ */
|
|
559
|
+
renderOption: (e) => /* @__PURE__ */ O(E, { children: [
|
|
555
560
|
e.vehicleNumber,
|
|
556
561
|
" (",
|
|
557
562
|
e.type,
|
|
558
563
|
")"
|
|
559
564
|
] }),
|
|
560
|
-
selectedOption:
|
|
561
|
-
selectedLoading:
|
|
565
|
+
selectedOption: Ve,
|
|
566
|
+
selectedLoading: He,
|
|
562
567
|
required: !0,
|
|
563
|
-
placeholder:
|
|
568
|
+
placeholder: P.vehicleId ? `Current: ${P.vehicleId}` : "Select a vehicle",
|
|
564
569
|
emptyText: "No available vehicles."
|
|
565
570
|
})]
|
|
566
571
|
}),
|
|
567
|
-
/* @__PURE__ */
|
|
572
|
+
/* @__PURE__ */ O("div", {
|
|
568
573
|
className: "space-y-1.5",
|
|
569
|
-
children: [/* @__PURE__ */
|
|
574
|
+
children: [/* @__PURE__ */ D(m, {
|
|
570
575
|
htmlFor: "assign-driver",
|
|
571
576
|
children: "Driver"
|
|
572
|
-
}), /* @__PURE__ */
|
|
577
|
+
}), /* @__PURE__ */ D(C, {
|
|
573
578
|
id: "assign-driver",
|
|
574
|
-
value:
|
|
575
|
-
onChange:
|
|
579
|
+
value: B,
|
|
580
|
+
onChange: V,
|
|
576
581
|
options: Je,
|
|
577
|
-
loading:
|
|
582
|
+
loading: Q,
|
|
578
583
|
getId: (e) => e.id,
|
|
579
584
|
getLabel: (e) => `${e.fullName} (${e.employeeId})`,
|
|
580
|
-
renderOption: (e) => /* @__PURE__ */
|
|
585
|
+
renderOption: (e) => /* @__PURE__ */ O(E, { children: [
|
|
581
586
|
e.fullName,
|
|
582
587
|
" (",
|
|
583
588
|
e.employeeId,
|
|
584
589
|
")"
|
|
585
590
|
] }),
|
|
586
|
-
selectedOption:
|
|
587
|
-
selectedLoading:
|
|
591
|
+
selectedOption: Ue,
|
|
592
|
+
selectedLoading: We,
|
|
588
593
|
required: !0,
|
|
589
|
-
placeholder:
|
|
594
|
+
placeholder: P.driverId ? `Current: ${P.driverId}` : "Select a driver",
|
|
590
595
|
emptyText: "No available drivers."
|
|
591
596
|
})]
|
|
592
597
|
}),
|
|
593
|
-
/* @__PURE__ */
|
|
598
|
+
/* @__PURE__ */ O(l, {
|
|
594
599
|
className: "w-full",
|
|
595
600
|
onClick: Ye,
|
|
596
|
-
disabled:
|
|
597
|
-
children: [/* @__PURE__ */
|
|
601
|
+
disabled: H || !R && !B,
|
|
602
|
+
children: [/* @__PURE__ */ D(ce, { size: 16 }), H ? "Assigning…" : "Assign driver & vehicle"]
|
|
598
603
|
})
|
|
599
604
|
]
|
|
600
605
|
}),
|
|
601
|
-
/* @__PURE__ */
|
|
602
|
-
/* @__PURE__ */
|
|
606
|
+
/* @__PURE__ */ D(h, {}),
|
|
607
|
+
/* @__PURE__ */ O("div", {
|
|
603
608
|
className: "space-y-2",
|
|
604
609
|
children: [
|
|
605
|
-
/* @__PURE__ */
|
|
610
|
+
/* @__PURE__ */ O("p", {
|
|
606
611
|
className: "text-sm text-text-secondary",
|
|
607
612
|
children: [
|
|
608
613
|
"Current status:",
|
|
609
614
|
" ",
|
|
610
|
-
/* @__PURE__ */
|
|
615
|
+
/* @__PURE__ */ D("span", {
|
|
611
616
|
className: "font-medium",
|
|
612
|
-
children:
|
|
617
|
+
children: A[P.status]
|
|
613
618
|
})
|
|
614
619
|
]
|
|
615
620
|
}),
|
|
616
621
|
(() => {
|
|
617
|
-
let e = Ie(
|
|
622
|
+
let e = Ie(P.status);
|
|
618
623
|
if (!e) return null;
|
|
619
|
-
let n = e === "assigned" && (!
|
|
620
|
-
return /* @__PURE__ */
|
|
624
|
+
let n = e === "assigned" && (!P.vehicleId || !P.driverId);
|
|
625
|
+
return /* @__PURE__ */ O(E, { children: [/* @__PURE__ */ O(l, {
|
|
621
626
|
variant: "outline",
|
|
622
627
|
className: "w-full",
|
|
623
|
-
onClick: () =>
|
|
624
|
-
disabled:
|
|
625
|
-
children: [/* @__PURE__ */
|
|
626
|
-
}), n && /* @__PURE__ */
|
|
628
|
+
onClick: () => Xe(e, `Order advanced to ${A[e]}.`),
|
|
629
|
+
disabled: W || n,
|
|
630
|
+
children: [/* @__PURE__ */ D(t, { size: 16 }), W ? "Updating…" : `Advance to ${A[e]}`]
|
|
631
|
+
}), n && /* @__PURE__ */ D("p", {
|
|
627
632
|
className: "text-xs text-text-secondary",
|
|
628
633
|
children: "Assign both a compatible vehicle and driver before dispatching this order."
|
|
629
634
|
})] });
|
|
630
635
|
})(),
|
|
631
|
-
|
|
636
|
+
P.status !== "cancelled" && !j.has(P.status) && /* @__PURE__ */ O(l, {
|
|
632
637
|
variant: "outline",
|
|
633
638
|
className: "w-full text-status-error-text",
|
|
634
|
-
onClick: () =>
|
|
635
|
-
disabled:
|
|
636
|
-
children: [/* @__PURE__ */
|
|
639
|
+
onClick: () => Xe("cancelled", "Order cancelled."),
|
|
640
|
+
disabled: W,
|
|
641
|
+
children: [/* @__PURE__ */ D(ee, { size: 16 }), "Cancel order"]
|
|
637
642
|
})
|
|
638
643
|
]
|
|
639
644
|
}),
|
|
640
|
-
/* @__PURE__ */
|
|
645
|
+
/* @__PURE__ */ O(l, {
|
|
641
646
|
variant: "outline",
|
|
642
647
|
className: "w-full",
|
|
643
|
-
onClick: () => $(`tracking?order=${
|
|
644
|
-
children: [/* @__PURE__ */
|
|
648
|
+
onClick: () => $(`tracking?order=${P.id}`),
|
|
649
|
+
children: [/* @__PURE__ */ D(r, { size: 16 }), "Track Order"]
|
|
645
650
|
})
|
|
646
651
|
]
|
|
647
652
|
}) })] }),
|
|
648
|
-
/* @__PURE__ */
|
|
653
|
+
/* @__PURE__ */ D(ke, {
|
|
649
654
|
entityType: "order",
|
|
650
|
-
entityId:
|
|
655
|
+
entityId: P.id
|
|
651
656
|
}),
|
|
652
|
-
/* @__PURE__ */
|
|
653
|
-
|
|
657
|
+
/* @__PURE__ */ D(je, { deliveryJobId: P.id }),
|
|
658
|
+
P.specialInstructions && /* @__PURE__ */ O(u, { children: [/* @__PURE__ */ D(f, { children: /* @__PURE__ */ O(p, {
|
|
654
659
|
className: "flex items-center gap-2",
|
|
655
|
-
children: [/* @__PURE__ */
|
|
656
|
-
}) }), /* @__PURE__ */
|
|
660
|
+
children: [/* @__PURE__ */ D(re, { size: 18 }), "Special Instructions"]
|
|
661
|
+
}) }), /* @__PURE__ */ D(d, { children: /* @__PURE__ */ D("p", {
|
|
657
662
|
className: "text-sm",
|
|
658
|
-
children:
|
|
663
|
+
children: P.specialInstructions
|
|
659
664
|
}) })] })
|
|
660
665
|
]
|
|
661
666
|
})]
|
|
@@ -664,4 +669,4 @@ function j() {
|
|
|
664
669
|
});
|
|
665
670
|
}
|
|
666
671
|
//#endregion
|
|
667
|
-
export {
|
|
672
|
+
export { M as default };
|