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