@burdenoff/microfe-movethewheels 2026.1030.1 → 2026.1031.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/ExportStatusBanner.js +53 -0
- package/dist/components/ShipmentRiskDialog.js +228 -0
- package/dist/components/TrackingAlertList.js +149 -0
- package/dist/generated/tracking-quality-operations.d.ts +1070 -2
- package/dist/generated/wspace-types.d.ts +2895 -50
- package/dist/hooks/useEntityExport.js +85 -0
- package/dist/hooks/useShipmentRisk.js +72 -0
- package/dist/hooks/useTracking.js +96 -82
- package/dist/movethewheels/components/ExportStatusBanner.d.ts +7 -0
- package/dist/movethewheels/components/ShipmentRiskDialog.d.ts +20 -0
- package/dist/movethewheels/components/TrackingAlertList.d.ts +14 -0
- package/dist/movethewheels/hooks/useEntityExport.d.ts +32 -0
- package/dist/movethewheels/hooks/useShipmentRisk.d.ts +41 -0
- package/dist/movethewheels/types/index.d.ts +15 -1
- package/dist/movethewheels/utils/entityExport.d.ts +64 -0
- package/dist/movethewheels/utils/trackingAlerts.d.ts +36 -0
- package/dist/pages/CustomersPage.js +64 -58
- package/dist/pages/DashboardPage.js +147 -151
- package/dist/pages/DriversPage.js +113 -107
- package/dist/pages/LiveTrackingPage.js +169 -169
- package/dist/pages/OrdersListPage.js +85 -79
- package/dist/pages/ProductsPage.js +63 -57
- package/dist/pages/VehiclesPage.js +91 -85
- package/dist/utils/entityExport.js +54 -0
- package/dist/utils/trackingAlerts.js +86 -0
- package/package.json +4 -2
- package/src/generated/tracking-quality-operations.ts +1409 -13
- package/src/generated/wspace-types.ts +3248 -51
- package/src/movethewheels/components/ExportStatusBanner.tsx +78 -0
- package/src/movethewheels/components/ShipmentRiskDialog.tsx +315 -0
- package/src/movethewheels/components/TrackingAlertList.tsx +188 -0
- package/src/movethewheels/hooks/useEntityExport.ts +130 -0
- package/src/movethewheels/hooks/useShipmentRisk.ts +195 -0
- package/src/movethewheels/hooks/useTracking.ts +66 -22
- package/src/movethewheels/pages/CustomersPage.tsx +11 -2
- package/src/movethewheels/pages/DashboardPage.tsx +10 -20
- package/src/movethewheels/pages/DriversPage.tsx +11 -2
- package/src/movethewheels/pages/LiveTrackingPage.tsx +20 -22
- package/src/movethewheels/pages/OrdersListPage.tsx +13 -2
- package/src/movethewheels/pages/ProductsPage.tsx +11 -2
- package/src/movethewheels/pages/VehiclesPage.tsx +11 -2
- package/src/movethewheels/types/index.ts +16 -1
- package/src/movethewheels/utils/entityExport.ts +140 -0
- package/src/movethewheels/utils/trackingAlerts.ts +151 -0
|
@@ -2,142 +2,147 @@ import { List as e } from "../node_modules/lucide-react/dist/esm/icons/list.js";
|
|
|
2
2
|
import { MapPin as t } from "../node_modules/lucide-react/dist/esm/icons/map-pin.js";
|
|
3
3
|
import { Map as n } from "../node_modules/lucide-react/dist/esm/icons/map.js";
|
|
4
4
|
import { Package as r } from "../node_modules/lucide-react/dist/esm/icons/package.js";
|
|
5
|
-
import { RefreshCw as
|
|
6
|
-
import { Truck as
|
|
7
|
-
import { joinPath as
|
|
8
|
-
import { useMoveTheWheels as
|
|
9
|
-
import { useLiveTracking as
|
|
10
|
-
import { Badge as
|
|
11
|
-
import { EmptyState as
|
|
12
|
-
import { MetricCard as
|
|
13
|
-
import { LogisticsMap as
|
|
5
|
+
import { RefreshCw as ee } from "../node_modules/lucide-react/dist/esm/icons/refresh-cw.js";
|
|
6
|
+
import { Truck as i } from "../node_modules/lucide-react/dist/esm/icons/truck.js";
|
|
7
|
+
import { joinPath as a } from "../utils/navigation.js";
|
|
8
|
+
import { useMoveTheWheels as o } from "../providers/MoveTheWheelsProvider.js";
|
|
9
|
+
import { useLiveTracking as s, useTrackingAlerts as c } from "../hooks/useTracking.js";
|
|
10
|
+
import { Badge as l, Button as u, Card as d, CardContent as f, CardHeader as p, CardTitle as m, ScrollArea as h, Tabs as g, TabsList as _, TabsTrigger as v } from "../components/ui.js";
|
|
11
|
+
import { EmptyState as y, PageLayout as b } from "../components/PageLayout.js";
|
|
12
|
+
import { MetricCard as x, MetricGrid as te } from "../components/MetricCard.js";
|
|
13
|
+
import { LogisticsMap as S } from "../components/maps/LogisticsMap.js";
|
|
14
14
|
import "../components/maps/index.js";
|
|
15
|
-
import { StatusBadge as
|
|
16
|
-
import { formatDate as
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
15
|
+
import { StatusBadge as C } from "../components/StatusBadge.js";
|
|
16
|
+
import { formatDate as w } from "../utils/formatters.js";
|
|
17
|
+
import { TrackingAlertList as T } from "../components/TrackingAlertList.js";
|
|
18
|
+
import { deliveryMarkerStatus as E, firstRealLatLng as D } from "../utils/mapMarkers.js";
|
|
19
|
+
import { useMemo as O, useState as k } from "react";
|
|
20
|
+
import { jsx as A, jsxs as j } from "react/jsx-runtime";
|
|
21
|
+
import { useI18n as M } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
22
|
+
import { EmphasisPanel as N, NextSteps as ne, PagePurpose as re } from "@burdenoff/fe-libs/ui";
|
|
21
23
|
//#region src/movethewheels/pages/LiveTrackingPage.tsx
|
|
22
|
-
function
|
|
23
|
-
let { basePath:
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
function P() {
|
|
25
|
+
let { basePath: P, navigate: F } = o(), { activeDeliveries: I, isLoading: L, refetch: R } = s(), { t: z } = M(), B = (e, t) => {
|
|
26
|
+
let n = z(e);
|
|
27
|
+
return n === e ? t : n;
|
|
28
|
+
}, { unacknowledgedAlerts: V, acknowledgeAlert: H, refetch: U } = c(), [W, G] = k("map"), [K, q] = k(null), [J, Y] = k("all"), X = (e) => {
|
|
29
|
+
F && F(a(P, e));
|
|
30
|
+
}, Z = K ? I.find((e) => e.order?.id === K) : null, Q = O(() => I.filter((e) => {
|
|
26
31
|
let t = e.order?.status;
|
|
27
|
-
return
|
|
28
|
-
}), [
|
|
32
|
+
return J === "all" ? !0 : J === "in_transit" ? t === "in_transit" : J === "out_for_delivery" ? t === "out_for_delivery" : t !== "in_transit" && t !== "out_for_delivery";
|
|
33
|
+
}), [I, J]), $ = O(() => Q.flatMap((e) => {
|
|
29
34
|
if (!e.order) return [];
|
|
30
|
-
let t =
|
|
35
|
+
let t = D(e.vehicle?.currentLocation, e.driver?.currentLocation, e.tracking?.currentLocation);
|
|
31
36
|
return t ? [{
|
|
32
37
|
id: e.order.id,
|
|
33
38
|
lat: t.lat,
|
|
34
39
|
lng: t.lng,
|
|
35
40
|
label: e.order.orderNumber,
|
|
36
|
-
status:
|
|
41
|
+
status: E(e.order.status),
|
|
37
42
|
sublabel: e.driver?.fullName || e.vehicle?.vehicleNumber || e.tracking?.currentLocation?.address || void 0
|
|
38
43
|
}] : [];
|
|
39
|
-
}), [
|
|
44
|
+
}), [Q]), ie = $.length, ae = [
|
|
40
45
|
{
|
|
41
46
|
value: "all",
|
|
42
47
|
label: "All",
|
|
43
|
-
count:
|
|
48
|
+
count: I.length
|
|
44
49
|
},
|
|
45
50
|
{
|
|
46
51
|
value: "in_transit",
|
|
47
52
|
label: "In transit",
|
|
48
|
-
count:
|
|
53
|
+
count: I.filter((e) => e.order?.status === "in_transit").length
|
|
49
54
|
},
|
|
50
55
|
{
|
|
51
56
|
value: "out_for_delivery",
|
|
52
57
|
label: "Out for delivery",
|
|
53
|
-
count:
|
|
58
|
+
count: I.filter((e) => e.order?.status === "out_for_delivery").length
|
|
54
59
|
},
|
|
55
60
|
{
|
|
56
61
|
value: "other",
|
|
57
62
|
label: "Other",
|
|
58
|
-
count:
|
|
63
|
+
count: I.filter((e) => e.order?.status !== "in_transit" && e.order?.status !== "out_for_delivery").length
|
|
59
64
|
}
|
|
60
65
|
];
|
|
61
|
-
return /* @__PURE__ */
|
|
66
|
+
return /* @__PURE__ */ j(b, {
|
|
62
67
|
title: "Live Tracking",
|
|
63
|
-
subtitle: `${
|
|
64
|
-
icon: /* @__PURE__ */
|
|
65
|
-
headerActions: /* @__PURE__ */
|
|
68
|
+
subtitle: `${I.length} active deliveries`,
|
|
69
|
+
icon: /* @__PURE__ */ A(t, { size: 24 }),
|
|
70
|
+
headerActions: /* @__PURE__ */ j("div", {
|
|
66
71
|
className: "flex gap-2",
|
|
67
|
-
children: [/* @__PURE__ */
|
|
72
|
+
children: [/* @__PURE__ */ j(u, {
|
|
68
73
|
variant: "outline",
|
|
69
|
-
onClick:
|
|
70
|
-
disabled:
|
|
71
|
-
children: [/* @__PURE__ */
|
|
74
|
+
onClick: R,
|
|
75
|
+
disabled: L,
|
|
76
|
+
children: [/* @__PURE__ */ A(ee, {
|
|
72
77
|
size: 16,
|
|
73
|
-
className:
|
|
78
|
+
className: L ? "animate-spin" : ""
|
|
74
79
|
}), "Refresh"]
|
|
75
|
-
}), /* @__PURE__ */
|
|
76
|
-
value:
|
|
77
|
-
onValueChange: (e) =>
|
|
78
|
-
children: /* @__PURE__ */
|
|
80
|
+
}), /* @__PURE__ */ A(g, {
|
|
81
|
+
value: W,
|
|
82
|
+
onValueChange: (e) => G(e),
|
|
83
|
+
children: /* @__PURE__ */ j(_, { children: [/* @__PURE__ */ A(v, {
|
|
79
84
|
value: "map",
|
|
80
|
-
children: /* @__PURE__ */
|
|
81
|
-
}), /* @__PURE__ */
|
|
85
|
+
children: /* @__PURE__ */ A(n, { size: 16 })
|
|
86
|
+
}), /* @__PURE__ */ A(v, {
|
|
82
87
|
value: "list",
|
|
83
|
-
children: /* @__PURE__ */
|
|
88
|
+
children: /* @__PURE__ */ A(e, { size: 16 })
|
|
84
89
|
})] })
|
|
85
90
|
})]
|
|
86
91
|
}),
|
|
87
92
|
children: [
|
|
88
|
-
/* @__PURE__ */
|
|
89
|
-
icon: /* @__PURE__ */
|
|
93
|
+
/* @__PURE__ */ A(re, {
|
|
94
|
+
icon: /* @__PURE__ */ A(t, { size: 18 }),
|
|
90
95
|
children: "A real-time operations board for every delivery currently on the road. Watch where drivers are, which orders are out for delivery, and react to alerts — switch to the map for a bird's-eye view or the list to drill into a single shipment."
|
|
91
96
|
}),
|
|
92
|
-
/* @__PURE__ */
|
|
97
|
+
/* @__PURE__ */ A(ne, {
|
|
93
98
|
storageKey: "movethewheels-live-tracking",
|
|
94
99
|
steps: [
|
|
95
100
|
{
|
|
96
101
|
id: "select",
|
|
97
102
|
label: "Open a delivery",
|
|
98
103
|
description: "Switch to the list and pick a shipment to see full details.",
|
|
99
|
-
icon: /* @__PURE__ */
|
|
100
|
-
onClick: () =>
|
|
104
|
+
icon: /* @__PURE__ */ A(e, { size: 16 }),
|
|
105
|
+
onClick: () => G("list")
|
|
101
106
|
},
|
|
102
107
|
{
|
|
103
108
|
id: "alerts",
|
|
104
109
|
label: "Clear outstanding alerts",
|
|
105
110
|
description: "Review delays and exceptions that need attention.",
|
|
106
|
-
icon: /* @__PURE__ */
|
|
111
|
+
icon: /* @__PURE__ */ A(i, { size: 16 }),
|
|
107
112
|
done: V.length === 0,
|
|
108
|
-
onClick: () =>
|
|
113
|
+
onClick: () => G("list")
|
|
109
114
|
},
|
|
110
115
|
{
|
|
111
116
|
id: "new-order",
|
|
112
117
|
label: "Create another order",
|
|
113
118
|
description: "Add a new delivery to the pipeline.",
|
|
114
|
-
icon: /* @__PURE__ */
|
|
115
|
-
onClick: () =>
|
|
119
|
+
icon: /* @__PURE__ */ A(r, { size: 16 }),
|
|
120
|
+
onClick: () => X("orders/new")
|
|
116
121
|
}
|
|
117
122
|
]
|
|
118
123
|
}),
|
|
119
|
-
/* @__PURE__ */
|
|
124
|
+
/* @__PURE__ */ j(te, {
|
|
120
125
|
columns: 4,
|
|
121
126
|
children: [
|
|
122
|
-
/* @__PURE__ */
|
|
127
|
+
/* @__PURE__ */ A(x, {
|
|
123
128
|
size: "sm",
|
|
124
129
|
label: "Active Deliveries",
|
|
125
|
-
value:
|
|
126
|
-
icon: /* @__PURE__ */
|
|
130
|
+
value: I.length,
|
|
131
|
+
icon: /* @__PURE__ */ A(i, { size: 18 })
|
|
127
132
|
}),
|
|
128
|
-
/* @__PURE__ */
|
|
133
|
+
/* @__PURE__ */ A(x, {
|
|
129
134
|
size: "sm",
|
|
130
135
|
label: "In Transit",
|
|
131
|
-
value:
|
|
132
|
-
icon: /* @__PURE__ */
|
|
136
|
+
value: I.filter((e) => e.order?.status === "in_transit").length,
|
|
137
|
+
icon: /* @__PURE__ */ A(r, { size: 18 })
|
|
133
138
|
}),
|
|
134
|
-
/* @__PURE__ */
|
|
139
|
+
/* @__PURE__ */ A(x, {
|
|
135
140
|
size: "sm",
|
|
136
141
|
label: "Out for Delivery",
|
|
137
|
-
value:
|
|
138
|
-
icon: /* @__PURE__ */
|
|
142
|
+
value: I.filter((e) => e.order?.status === "out_for_delivery").length,
|
|
143
|
+
icon: /* @__PURE__ */ A(t, { size: 18 })
|
|
139
144
|
}),
|
|
140
|
-
/* @__PURE__ */
|
|
145
|
+
/* @__PURE__ */ A(x, {
|
|
141
146
|
size: "sm",
|
|
142
147
|
label: "Alerts",
|
|
143
148
|
value: V.length,
|
|
@@ -145,92 +150,92 @@ function I() {
|
|
|
145
150
|
})
|
|
146
151
|
]
|
|
147
152
|
}),
|
|
148
|
-
/* @__PURE__ */
|
|
153
|
+
/* @__PURE__ */ j("div", {
|
|
149
154
|
className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
|
|
150
|
-
children: [/* @__PURE__ */
|
|
155
|
+
children: [/* @__PURE__ */ A("div", {
|
|
151
156
|
className: "lg:col-span-2",
|
|
152
|
-
children:
|
|
157
|
+
children: W === "map" ? /* @__PURE__ */ A(d, {
|
|
153
158
|
className: "overflow-hidden",
|
|
154
|
-
children: /* @__PURE__ */
|
|
159
|
+
children: /* @__PURE__ */ j(f, {
|
|
155
160
|
className: "p-0",
|
|
156
|
-
children: [/* @__PURE__ */
|
|
161
|
+
children: [/* @__PURE__ */ j("div", {
|
|
157
162
|
className: "flex flex-wrap items-center gap-2 border-b border-border-seam p-3",
|
|
158
|
-
children: [
|
|
163
|
+
children: [ae.map((e) => /* @__PURE__ */ j("button", {
|
|
159
164
|
type: "button",
|
|
160
|
-
onClick: () =>
|
|
161
|
-
className: `inline-flex items-center gap-1.5 rounded-full border px-3 py-1 text-xs font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-action-primary-bg ${
|
|
162
|
-
children: [e.label, /* @__PURE__ */
|
|
165
|
+
onClick: () => Y(e.value),
|
|
166
|
+
className: `inline-flex items-center gap-1.5 rounded-full border px-3 py-1 text-xs font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-action-primary-bg ${J === e.value ? "border-transparent bg-action-primary-bg text-action-primary-text" : "border-border-seam text-text-secondary hover:bg-bg-sunken/60"}`,
|
|
167
|
+
children: [e.label, /* @__PURE__ */ A("span", {
|
|
163
168
|
className: "tabular-nums opacity-80",
|
|
164
169
|
children: e.count
|
|
165
170
|
})]
|
|
166
|
-
}, e.value)), /* @__PURE__ */
|
|
171
|
+
}, e.value)), /* @__PURE__ */ j("span", {
|
|
167
172
|
className: "ml-auto text-xs text-text-secondary",
|
|
168
173
|
children: [
|
|
169
|
-
|
|
174
|
+
ie,
|
|
170
175
|
" of ",
|
|
171
|
-
|
|
176
|
+
Q.length,
|
|
172
177
|
" located"
|
|
173
178
|
]
|
|
174
179
|
})]
|
|
175
|
-
}), /* @__PURE__ */
|
|
176
|
-
markers:
|
|
180
|
+
}), /* @__PURE__ */ A(S, {
|
|
181
|
+
markers: $,
|
|
177
182
|
height: 560,
|
|
178
|
-
emptyMessage:
|
|
183
|
+
emptyMessage: Q.length === 0 ? "No active deliveries to plot" : "Awaiting live GPS positions for these deliveries"
|
|
179
184
|
})]
|
|
180
185
|
})
|
|
181
|
-
}) : /* @__PURE__ */
|
|
186
|
+
}) : /* @__PURE__ */ j(d, { children: [/* @__PURE__ */ A(p, { children: /* @__PURE__ */ A(m, { children: "Active Deliveries" }) }), /* @__PURE__ */ A(f, {
|
|
182
187
|
className: "p-0",
|
|
183
|
-
children: /* @__PURE__ */
|
|
188
|
+
children: /* @__PURE__ */ A(h, {
|
|
184
189
|
className: "h-[550px]",
|
|
185
|
-
children: /* @__PURE__ */
|
|
190
|
+
children: /* @__PURE__ */ j("div", {
|
|
186
191
|
className: "divide-y",
|
|
187
|
-
children: [
|
|
192
|
+
children: [Q.map((e) => e.order ? /* @__PURE__ */ A("div", {
|
|
188
193
|
role: "button",
|
|
189
194
|
tabIndex: 0,
|
|
190
195
|
"aria-label": `Select delivery ${e.order.orderNumber}`,
|
|
191
|
-
className: `p-4 hover:bg-bg-sunken/50 cursor-pointer transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-action-primary-bg ${
|
|
192
|
-
onClick: () =>
|
|
196
|
+
className: `p-4 hover:bg-bg-sunken/50 cursor-pointer transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-action-primary-bg ${K === e.order.id ? "bg-bg-sunken/50" : ""}`,
|
|
197
|
+
onClick: () => q(e.order.id),
|
|
193
198
|
onKeyDown: (t) => {
|
|
194
|
-
(t.key === "Enter" || t.key === " ") && e.order && (t.preventDefault(),
|
|
199
|
+
(t.key === "Enter" || t.key === " ") && e.order && (t.preventDefault(), q(e.order.id));
|
|
195
200
|
},
|
|
196
|
-
children: /* @__PURE__ */
|
|
201
|
+
children: /* @__PURE__ */ j("div", {
|
|
197
202
|
className: "flex items-start justify-between",
|
|
198
|
-
children: [/* @__PURE__ */
|
|
199
|
-
/* @__PURE__ */
|
|
203
|
+
children: [/* @__PURE__ */ j("div", { children: [
|
|
204
|
+
/* @__PURE__ */ j("div", {
|
|
200
205
|
className: "flex items-center gap-2 mb-1",
|
|
201
|
-
children: [/* @__PURE__ */
|
|
206
|
+
children: [/* @__PURE__ */ A("span", {
|
|
202
207
|
className: "font-medium",
|
|
203
208
|
children: e.order.orderNumber
|
|
204
|
-
}), /* @__PURE__ */
|
|
209
|
+
}), /* @__PURE__ */ A(C, {
|
|
205
210
|
status: e.order.status,
|
|
206
211
|
type: "order",
|
|
207
212
|
size: "sm"
|
|
208
213
|
})]
|
|
209
214
|
}),
|
|
210
|
-
/* @__PURE__ */
|
|
215
|
+
/* @__PURE__ */ A("p", {
|
|
211
216
|
className: "text-sm text-text-secondary",
|
|
212
217
|
children: e.order.customerInfo.name
|
|
213
218
|
}),
|
|
214
|
-
/* @__PURE__ */
|
|
219
|
+
/* @__PURE__ */ j("p", {
|
|
215
220
|
className: "text-sm text-text-secondary",
|
|
216
221
|
children: [e.driver?.fullName || "Unassigned", e.vehicle && ` - ${e.vehicle.vehicleNumber}`]
|
|
217
222
|
})
|
|
218
|
-
] }), /* @__PURE__ */
|
|
223
|
+
] }), /* @__PURE__ */ j("div", {
|
|
219
224
|
className: "text-right",
|
|
220
|
-
children: [/* @__PURE__ */
|
|
225
|
+
children: [/* @__PURE__ */ j("p", {
|
|
221
226
|
className: "text-sm font-medium",
|
|
222
227
|
children: [
|
|
223
228
|
"ETA:",
|
|
224
229
|
" ",
|
|
225
|
-
e.estimatedArrival ?
|
|
230
|
+
e.estimatedArrival ? w(e.estimatedArrival, "time") : "N/A"
|
|
226
231
|
]
|
|
227
|
-
}), /* @__PURE__ */
|
|
232
|
+
}), /* @__PURE__ */ A("p", {
|
|
228
233
|
className: "text-xs text-text-secondary",
|
|
229
234
|
children: e.tracking?.currentLocation?.address || "Location updating..."
|
|
230
235
|
})]
|
|
231
236
|
})]
|
|
232
237
|
})
|
|
233
|
-
}, e.order.id) : null),
|
|
238
|
+
}, e.order.id) : null), Q.length === 0 && /* @__PURE__ */ A(y, {
|
|
234
239
|
illustration: "empty-sessions",
|
|
235
240
|
title: "No active deliveries",
|
|
236
241
|
description: "When orders are dispatched they'll appear here in real time."
|
|
@@ -238,161 +243,156 @@ function I() {
|
|
|
238
243
|
})
|
|
239
244
|
})
|
|
240
245
|
})] })
|
|
241
|
-
}), /* @__PURE__ */
|
|
246
|
+
}), /* @__PURE__ */ j("div", {
|
|
242
247
|
className: "space-y-6",
|
|
243
248
|
children: [
|
|
244
|
-
|
|
249
|
+
Z ? /* @__PURE__ */ j(N, {
|
|
245
250
|
className: "space-y-4",
|
|
246
|
-
children: [/* @__PURE__ */
|
|
251
|
+
children: [/* @__PURE__ */ j("div", {
|
|
247
252
|
className: "flex items-center justify-between",
|
|
248
|
-
children: [/* @__PURE__ */
|
|
253
|
+
children: [/* @__PURE__ */ A("h2", {
|
|
249
254
|
className: "text-base font-semibold text-text-primary",
|
|
250
255
|
children: "Delivery Details"
|
|
251
|
-
}), /* @__PURE__ */
|
|
256
|
+
}), /* @__PURE__ */ A(u, {
|
|
252
257
|
variant: "ghost",
|
|
253
258
|
size: "sm",
|
|
254
|
-
onClick: () =>
|
|
259
|
+
onClick: () => q(null),
|
|
255
260
|
children: "Clear"
|
|
256
261
|
})]
|
|
257
|
-
}), /* @__PURE__ */
|
|
262
|
+
}), /* @__PURE__ */ j("div", {
|
|
258
263
|
className: "space-y-4",
|
|
259
264
|
children: [
|
|
260
|
-
/* @__PURE__ */
|
|
265
|
+
/* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("p", {
|
|
261
266
|
className: "text-sm text-text-secondary",
|
|
262
267
|
children: "Order"
|
|
263
|
-
}), /* @__PURE__ */
|
|
268
|
+
}), /* @__PURE__ */ A("p", {
|
|
264
269
|
className: "font-medium",
|
|
265
|
-
children:
|
|
270
|
+
children: Z.order?.orderNumber ?? "-"
|
|
266
271
|
})] }),
|
|
267
|
-
/* @__PURE__ */
|
|
268
|
-
/* @__PURE__ */
|
|
272
|
+
/* @__PURE__ */ j("div", { children: [
|
|
273
|
+
/* @__PURE__ */ A("p", {
|
|
269
274
|
className: "text-sm text-text-secondary",
|
|
270
275
|
children: "Customer"
|
|
271
276
|
}),
|
|
272
|
-
/* @__PURE__ */
|
|
277
|
+
/* @__PURE__ */ A("p", {
|
|
273
278
|
className: "font-medium",
|
|
274
|
-
children:
|
|
279
|
+
children: Z.order?.customerInfo.name ?? "-"
|
|
275
280
|
}),
|
|
276
|
-
/* @__PURE__ */
|
|
281
|
+
/* @__PURE__ */ A("p", {
|
|
277
282
|
className: "text-sm text-text-secondary",
|
|
278
|
-
children:
|
|
283
|
+
children: Z.order?.customerInfo.phone ?? "-"
|
|
279
284
|
})
|
|
280
285
|
] }),
|
|
281
|
-
/* @__PURE__ */
|
|
286
|
+
/* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("p", {
|
|
282
287
|
className: "text-sm text-text-secondary",
|
|
283
288
|
children: "Driver"
|
|
284
|
-
}), /* @__PURE__ */
|
|
289
|
+
}), /* @__PURE__ */ A("p", {
|
|
285
290
|
className: "font-medium",
|
|
286
|
-
children:
|
|
291
|
+
children: Z.driver?.fullName || "Unassigned"
|
|
287
292
|
})] }),
|
|
288
|
-
/* @__PURE__ */
|
|
293
|
+
/* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("p", {
|
|
289
294
|
className: "text-sm text-text-secondary",
|
|
290
295
|
children: "Vehicle"
|
|
291
|
-
}), /* @__PURE__ */
|
|
296
|
+
}), /* @__PURE__ */ A("p", {
|
|
292
297
|
className: "font-medium",
|
|
293
|
-
children:
|
|
298
|
+
children: Z.vehicle ? `${Z.vehicle.vehicleNumber} - ${Z.vehicle.make} ${Z.vehicle.model}` : "Not assigned"
|
|
294
299
|
})] }),
|
|
295
|
-
/* @__PURE__ */
|
|
296
|
-
/* @__PURE__ */
|
|
300
|
+
/* @__PURE__ */ j("div", { children: [
|
|
301
|
+
/* @__PURE__ */ A("p", {
|
|
297
302
|
className: "text-sm text-text-secondary",
|
|
298
303
|
children: "Current Location"
|
|
299
304
|
}),
|
|
300
|
-
/* @__PURE__ */
|
|
305
|
+
/* @__PURE__ */ A("p", {
|
|
301
306
|
className: "text-sm",
|
|
302
|
-
children:
|
|
307
|
+
children: Z.tracking?.currentLocation?.address || "Updating..."
|
|
303
308
|
}),
|
|
304
309
|
(() => {
|
|
305
|
-
let e =
|
|
306
|
-
return e ? /* @__PURE__ */
|
|
310
|
+
let e = D(Z.vehicle?.currentLocation, Z.driver?.currentLocation, Z.tracking?.currentLocation);
|
|
311
|
+
return e ? /* @__PURE__ */ A(S, {
|
|
307
312
|
className: "mt-3 overflow-hidden rounded-lg border border-border-seam",
|
|
308
313
|
height: 160,
|
|
309
314
|
markers: [{
|
|
310
|
-
id:
|
|
315
|
+
id: Z.order?.id ?? "selected",
|
|
311
316
|
lat: e.lat,
|
|
312
317
|
lng: e.lng,
|
|
313
|
-
label:
|
|
314
|
-
status:
|
|
318
|
+
label: Z.order?.orderNumber ?? "Delivery",
|
|
319
|
+
status: E(Z.order?.status)
|
|
315
320
|
}]
|
|
316
321
|
}) : null;
|
|
317
322
|
})()
|
|
318
323
|
] }),
|
|
319
|
-
/* @__PURE__ */
|
|
324
|
+
/* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("p", {
|
|
320
325
|
className: "text-sm text-text-secondary",
|
|
321
326
|
children: "Estimated Arrival"
|
|
322
|
-
}), /* @__PURE__ */
|
|
327
|
+
}), /* @__PURE__ */ A("p", {
|
|
323
328
|
className: "font-medium",
|
|
324
|
-
children:
|
|
329
|
+
children: Z.estimatedArrival ? w(Z.estimatedArrival, "full") : "Calculating..."
|
|
325
330
|
})] }),
|
|
326
|
-
/* @__PURE__ */
|
|
331
|
+
/* @__PURE__ */ j("div", {
|
|
327
332
|
className: "pt-2 space-y-2",
|
|
328
|
-
children: [/* @__PURE__ */
|
|
333
|
+
children: [/* @__PURE__ */ A(u, {
|
|
329
334
|
className: "w-full",
|
|
330
|
-
onClick: () =>
|
|
331
|
-
disabled: !
|
|
335
|
+
onClick: () => Z.order && X(`orders/${Z.order.id}`),
|
|
336
|
+
disabled: !Z.order,
|
|
332
337
|
children: "View Order"
|
|
333
|
-
}), /* @__PURE__ */
|
|
338
|
+
}), /* @__PURE__ */ A(u, {
|
|
334
339
|
variant: "outline",
|
|
335
340
|
className: "w-full",
|
|
336
|
-
onClick: () =>
|
|
337
|
-
disabled: !
|
|
341
|
+
onClick: () => Z.order && X(`tracking?order=${Z.order.id}`),
|
|
342
|
+
disabled: !Z.order,
|
|
338
343
|
children: "Track Details"
|
|
339
344
|
})]
|
|
340
345
|
})
|
|
341
346
|
]
|
|
342
347
|
})]
|
|
343
|
-
}) : /* @__PURE__ */
|
|
348
|
+
}) : /* @__PURE__ */ A(d, { children: /* @__PURE__ */ A(f, {
|
|
344
349
|
className: "p-6",
|
|
345
|
-
children: /* @__PURE__ */
|
|
350
|
+
children: /* @__PURE__ */ A(y, {
|
|
346
351
|
illustration: "empty-generic",
|
|
347
352
|
title: "No delivery selected",
|
|
348
353
|
description: "Pick a delivery from the list to see its driver, vehicle, ETA and live location."
|
|
349
354
|
})
|
|
350
355
|
}) }),
|
|
351
|
-
/* @__PURE__ */
|
|
356
|
+
/* @__PURE__ */ j(d, { children: [/* @__PURE__ */ A(p, { children: /* @__PURE__ */ j(m, {
|
|
352
357
|
className: "flex items-center gap-2",
|
|
353
|
-
children: ["Alerts", V.length > 0 && /* @__PURE__ */
|
|
358
|
+
children: [B("movethewheels.tracking.live.alerts", "Alerts"), V.length > 0 && /* @__PURE__ */ A(l, {
|
|
354
359
|
variant: "destructive",
|
|
355
360
|
children: V.length
|
|
356
361
|
})]
|
|
357
|
-
}) }), /* @__PURE__ */
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
className: "text-xs text-text-secondary mt-1",
|
|
366
|
-
children: e.timestamp ? E(e.timestamp, "relative") : "Time not recorded"
|
|
367
|
-
})]
|
|
368
|
-
}, e.id))
|
|
369
|
-
}) : /* @__PURE__ */ j("div", {
|
|
362
|
+
}) }), /* @__PURE__ */ A(f, { children: V.length > 0 ? /* @__PURE__ */ A(T, {
|
|
363
|
+
alerts: V,
|
|
364
|
+
limit: 5,
|
|
365
|
+
t: B,
|
|
366
|
+
onAcknowledge: H,
|
|
367
|
+
onOpenOrder: (e) => X(`orders/${e}`),
|
|
368
|
+
onChanged: U
|
|
369
|
+
}) : /* @__PURE__ */ A("div", {
|
|
370
370
|
className: "text-center text-text-secondary py-4",
|
|
371
|
-
children: /* @__PURE__ */
|
|
371
|
+
children: /* @__PURE__ */ A("p", {
|
|
372
372
|
className: "text-sm",
|
|
373
|
-
children: "No active alerts"
|
|
373
|
+
children: B("movethewheels.tracking.live.noAlerts", "No active alerts")
|
|
374
374
|
})
|
|
375
375
|
}) })] }),
|
|
376
|
-
/* @__PURE__ */
|
|
376
|
+
/* @__PURE__ */ j(d, { children: [/* @__PURE__ */ A(p, { children: /* @__PURE__ */ A(m, { children: "Quick Actions" }) }), /* @__PURE__ */ j(f, {
|
|
377
377
|
className: "space-y-2",
|
|
378
378
|
children: [
|
|
379
|
-
/* @__PURE__ */
|
|
379
|
+
/* @__PURE__ */ j(u, {
|
|
380
380
|
variant: "outline",
|
|
381
381
|
className: "w-full",
|
|
382
|
-
onClick: () =>
|
|
383
|
-
children: [/* @__PURE__ */
|
|
382
|
+
onClick: () => X("orders/new"),
|
|
383
|
+
children: [/* @__PURE__ */ A(r, { size: 16 }), "Create Order"]
|
|
384
384
|
}),
|
|
385
|
-
/* @__PURE__ */
|
|
385
|
+
/* @__PURE__ */ j(u, {
|
|
386
386
|
variant: "outline",
|
|
387
387
|
className: "w-full",
|
|
388
|
-
onClick: () =>
|
|
389
|
-
children: [/* @__PURE__ */
|
|
388
|
+
onClick: () => X("routes"),
|
|
389
|
+
children: [/* @__PURE__ */ A(t, { size: 16 }), "Manage Routes"]
|
|
390
390
|
}),
|
|
391
|
-
/* @__PURE__ */
|
|
391
|
+
/* @__PURE__ */ j(u, {
|
|
392
392
|
variant: "outline",
|
|
393
393
|
className: "w-full",
|
|
394
|
-
onClick: () =>
|
|
395
|
-
children: [/* @__PURE__ */
|
|
394
|
+
onClick: () => X("fleet"),
|
|
395
|
+
children: [/* @__PURE__ */ A(i, { size: 16 }), "Fleet Status"]
|
|
396
396
|
})
|
|
397
397
|
]
|
|
398
398
|
})] })
|
|
@@ -403,4 +403,4 @@ function I() {
|
|
|
403
403
|
});
|
|
404
404
|
}
|
|
405
405
|
//#endregion
|
|
406
|
-
export {
|
|
406
|
+
export { P as default };
|