@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
|
@@ -13,21 +13,22 @@ import { joinPath as te } from "../utils/navigation.js";
|
|
|
13
13
|
import { useMoveTheWheels as u } from "../providers/MoveTheWheelsProvider.js";
|
|
14
14
|
import { useOrderStats as d, useOrders as f } from "../hooks/useOrders.js";
|
|
15
15
|
import { useFleetStats as p } from "../hooks/useFleet.js";
|
|
16
|
-
import { useAnalytics as ne, useDashboardMetrics as
|
|
17
|
-
import { useLiveTracking as
|
|
16
|
+
import { useAnalytics as ne, useDashboardMetrics as re } from "../hooks/useAnalytics.js";
|
|
17
|
+
import { useLiveTracking as ie, useTrackingAlerts as m } from "../hooks/useTracking.js";
|
|
18
18
|
import { Badge as h, Button as g, Card as _, CardContent as v, CardHeader as y, CardTitle as b, Progress as x } from "../components/ui.js";
|
|
19
|
-
import { PageLayout as
|
|
20
|
-
import { MetricCard as
|
|
21
|
-
import { VolumeBar as
|
|
19
|
+
import { PageLayout as ae, PageSection as S } from "../components/PageLayout.js";
|
|
20
|
+
import { MetricCard as C, MetricGrid as w } from "../components/MetricCard.js";
|
|
21
|
+
import { VolumeBar as oe } from "../components/charts/VolumeBar.js";
|
|
22
22
|
import "../components/charts/index.js";
|
|
23
|
-
import { LogisticsMap as
|
|
23
|
+
import { LogisticsMap as T } from "../components/maps/LogisticsMap.js";
|
|
24
24
|
import "../components/maps/index.js";
|
|
25
|
-
import { StatusBadge as
|
|
26
|
-
import { formatCurrency as
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
25
|
+
import { StatusBadge as E } from "../components/StatusBadge.js";
|
|
26
|
+
import { formatCurrency as D, formatDate as O } from "../utils/formatters.js";
|
|
27
|
+
import { TrackingAlertList as se } from "../components/TrackingAlertList.js";
|
|
28
|
+
import { deliveryMarkerStatus as ce, firstRealLatLng as le } from "../utils/mapMarkers.js";
|
|
29
|
+
import { useMemo as k } from "react";
|
|
30
|
+
import { jsx as A, jsxs as j } from "react/jsx-runtime";
|
|
31
|
+
import { useI18n as M } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
31
32
|
import { CTAOverflowMenu as N, EmphasisPanel as P, PagePurpose as F } from "@burdenoff/fe-libs/ui";
|
|
32
33
|
//#region src/movethewheels/pages/DashboardPage.tsx
|
|
33
34
|
function I(e, t = !1) {
|
|
@@ -42,78 +43,78 @@ function I(e, t = !1) {
|
|
|
42
43
|
};
|
|
43
44
|
}
|
|
44
45
|
function L() {
|
|
45
|
-
let { t: L } =
|
|
46
|
+
let { t: L } = M(), R = (e, t) => {
|
|
46
47
|
let n = L(e);
|
|
47
48
|
return n === e ? t : n;
|
|
48
|
-
}, { basePath: z, navigate: B } = u(), { metrics: V } =
|
|
49
|
+
}, { basePath: z, navigate: B } = u(), { metrics: V } = re(), { analytics: H } = ne(), { orders: U } = f({ limit: 5 }), { stats: W } = d(), { stats: G } = p(), { activeDeliveries: K } = ie(), { unacknowledgedAlerts: q, acknowledgeAlert: ue, refetch: de } = m(), J = k(() => H.trends.dailyOrders.map((e) => e.orders), [H.trends.dailyOrders]), Y = k(() => H.trends.dailyOrders.map((e) => e.deliveries), [H.trends.dailyOrders]), X = k(() => H.trends.revenue.map((e) => e.revenue), [H.trends.revenue]), fe = k(() => H.trends.dailyOrders.slice(-7), [H.trends.dailyOrders]), pe = k(() => K.flatMap((e) => {
|
|
49
50
|
if (!e.order) return [];
|
|
50
|
-
let t =
|
|
51
|
+
let t = le(e.vehicle?.currentLocation, e.driver?.currentLocation, e.tracking?.currentLocation);
|
|
51
52
|
return t ? [{
|
|
52
53
|
id: e.order.id,
|
|
53
54
|
lat: t.lat,
|
|
54
55
|
lng: t.lng,
|
|
55
56
|
label: e.order.orderNumber,
|
|
56
|
-
status:
|
|
57
|
+
status: ce(e.order.status),
|
|
57
58
|
sublabel: e.driver?.fullName || e.vehicle?.vehicleNumber || void 0
|
|
58
59
|
}] : [];
|
|
59
|
-
}), [K]), Z =
|
|
60
|
+
}), [K]), Z = k(() => [...U].sort((e, t) => new Date(t.updatedAt ?? t.createdAt).getTime() - new Date(e.updatedAt ?? e.createdAt).getTime()).slice(0, 5), [U]), Q = (e) => {
|
|
60
61
|
B && B(te(z, e));
|
|
61
62
|
}, $ = (e, t) => {
|
|
62
63
|
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), t());
|
|
63
64
|
};
|
|
64
|
-
return /* @__PURE__ */
|
|
65
|
+
return /* @__PURE__ */ j(ae, {
|
|
65
66
|
hero: !0,
|
|
66
67
|
titleAccent: R("movethewheels.dashboard.title", "Dashboard"),
|
|
67
68
|
title: R("movethewheels.dashboard.title", "Dashboard"),
|
|
68
69
|
subtitle: R("movethewheels.dashboard.subtitle", "Overview of your logistics operations"),
|
|
69
|
-
icon: /* @__PURE__ */
|
|
70
|
-
headerActions: /* @__PURE__ */
|
|
70
|
+
icon: /* @__PURE__ */ A(s, { size: 24 }),
|
|
71
|
+
headerActions: /* @__PURE__ */ A(N, {
|
|
71
72
|
primary: {
|
|
72
73
|
label: R("movethewheels.dashboard.actions.newOrder", "New Order"),
|
|
73
|
-
icon: /* @__PURE__ */
|
|
74
|
+
icon: /* @__PURE__ */ A(a, { size: 16 }),
|
|
74
75
|
onSelect: () => Q("orders/new")
|
|
75
76
|
},
|
|
76
77
|
actions: [{
|
|
77
78
|
label: R("movethewheels.dashboard.actions.liveMap", "Live Map"),
|
|
78
|
-
icon: /* @__PURE__ */
|
|
79
|
+
icon: /* @__PURE__ */ A(i, { size: 16 }),
|
|
79
80
|
onSelect: () => Q("tracking/live")
|
|
80
81
|
}, {
|
|
81
82
|
label: R("movethewheels.dashboard.actions.multiModal", "Multi-Modal Freight"),
|
|
82
|
-
icon: /* @__PURE__ */
|
|
83
|
+
icon: /* @__PURE__ */ A(o, { size: 16 }),
|
|
83
84
|
onSelect: () => Q("shipments/multi-modal")
|
|
84
85
|
}]
|
|
85
86
|
}),
|
|
86
87
|
children: [
|
|
87
|
-
/* @__PURE__ */
|
|
88
|
-
icon: /* @__PURE__ */
|
|
88
|
+
/* @__PURE__ */ A(F, {
|
|
89
|
+
icon: /* @__PURE__ */ A(s, { size: 18 }),
|
|
89
90
|
children: R("movethewheels.dashboard.purpose", "Your logistics command center — a live snapshot of orders, active deliveries, fleet health and revenue. Start here each day to spot what needs attention, then jump straight into an order, the live map or fleet status.")
|
|
90
91
|
}),
|
|
91
|
-
/* @__PURE__ */
|
|
92
|
+
/* @__PURE__ */ j(w, {
|
|
92
93
|
columns: 4,
|
|
93
94
|
children: [
|
|
94
|
-
/* @__PURE__ */
|
|
95
|
+
/* @__PURE__ */ A(C, {
|
|
95
96
|
label: R("movethewheels.dashboard.metrics.totalOrders", "Total Orders"),
|
|
96
97
|
value: V.orders.total,
|
|
97
|
-
icon: /* @__PURE__ */
|
|
98
|
+
icon: /* @__PURE__ */ A(a, { size: 20 }),
|
|
98
99
|
accent: "brand",
|
|
99
100
|
sparklineData: J.length >= 2 ? J : void 0,
|
|
100
101
|
delta: I(J),
|
|
101
102
|
onClick: () => Q("orders")
|
|
102
103
|
}),
|
|
103
|
-
/* @__PURE__ */
|
|
104
|
+
/* @__PURE__ */ A(C, {
|
|
104
105
|
label: R("movethewheels.dashboard.metrics.activeDeliveries", "Active Deliveries"),
|
|
105
106
|
value: V.orders.inTransit,
|
|
106
|
-
icon: /* @__PURE__ */
|
|
107
|
+
icon: /* @__PURE__ */ A(l, { size: 20 }),
|
|
107
108
|
accent: "blue",
|
|
108
109
|
subtitle: `${V.orders.pending} ${R("movethewheels.dashboard.metrics.pending", "pending")}`,
|
|
109
110
|
sparklineData: Y.length >= 2 ? Y : void 0,
|
|
110
111
|
delta: I(Y),
|
|
111
112
|
onClick: () => Q("tracking")
|
|
112
113
|
}),
|
|
113
|
-
/* @__PURE__ */
|
|
114
|
+
/* @__PURE__ */ A(C, {
|
|
114
115
|
label: R("movethewheels.dashboard.metrics.onTimeDelivery", "On-Time Delivery"),
|
|
115
116
|
value: `${V.performance.onTimeDeliveryRate.toFixed(1)}%`,
|
|
116
|
-
icon: /* @__PURE__ */
|
|
117
|
+
icon: /* @__PURE__ */ A(s, { size: 20 }),
|
|
117
118
|
accent: "success",
|
|
118
119
|
delta: V.performance.onTimeDeliveryRate >= 90 ? {
|
|
119
120
|
value: "On target",
|
|
@@ -124,12 +125,12 @@ function L() {
|
|
|
124
125
|
},
|
|
125
126
|
onClick: () => Q("analytics")
|
|
126
127
|
}),
|
|
127
|
-
/* @__PURE__ */
|
|
128
|
+
/* @__PURE__ */ A(C, {
|
|
128
129
|
treatment: "glass",
|
|
129
130
|
glow: !0,
|
|
130
131
|
label: R("movethewheels.dashboard.metrics.revenue", "Revenue"),
|
|
131
|
-
value:
|
|
132
|
-
icon: /* @__PURE__ */
|
|
132
|
+
value: D(V.revenue.total),
|
|
133
|
+
icon: /* @__PURE__ */ A(r, { size: 20 }),
|
|
133
134
|
accent: "success",
|
|
134
135
|
sparklineData: X.length >= 2 ? X : void 0,
|
|
135
136
|
delta: I(X),
|
|
@@ -137,105 +138,100 @@ function L() {
|
|
|
137
138
|
})
|
|
138
139
|
]
|
|
139
140
|
}),
|
|
140
|
-
/* @__PURE__ */
|
|
141
|
+
/* @__PURE__ */ j("div", {
|
|
141
142
|
className: "grid grid-cols-1 gap-6 lg:grid-cols-3",
|
|
142
|
-
children: [/* @__PURE__ */
|
|
143
|
+
children: [/* @__PURE__ */ j(_, {
|
|
143
144
|
className: "overflow-hidden lg:col-span-2",
|
|
144
|
-
children: [/* @__PURE__ */
|
|
145
|
+
children: [/* @__PURE__ */ j(y, {
|
|
145
146
|
className: "flex flex-row items-center justify-between",
|
|
146
|
-
children: [/* @__PURE__ */
|
|
147
|
+
children: [/* @__PURE__ */ j(b, {
|
|
147
148
|
className: "flex items-center gap-2",
|
|
148
149
|
children: [
|
|
149
|
-
/* @__PURE__ */
|
|
150
|
+
/* @__PURE__ */ A(i, { size: 18 }),
|
|
150
151
|
" ",
|
|
151
152
|
R("movethewheels.dashboard.liveMap.title", "Live Map")
|
|
152
153
|
]
|
|
153
|
-
}), /* @__PURE__ */
|
|
154
|
+
}), /* @__PURE__ */ j(g, {
|
|
154
155
|
variant: "ghost",
|
|
155
156
|
size: "sm",
|
|
156
157
|
onClick: () => Q("tracking/live"),
|
|
157
|
-
children: [R("movethewheels.dashboard.liveMap.open", "Open live tracking"), /* @__PURE__ */
|
|
158
|
+
children: [R("movethewheels.dashboard.liveMap.open", "Open live tracking"), /* @__PURE__ */ A(t, { size: 16 })]
|
|
158
159
|
})]
|
|
159
|
-
}), /* @__PURE__ */
|
|
160
|
+
}), /* @__PURE__ */ A(v, {
|
|
160
161
|
className: "p-0",
|
|
161
|
-
children: /* @__PURE__ */
|
|
162
|
-
markers:
|
|
162
|
+
children: /* @__PURE__ */ A(T, {
|
|
163
|
+
markers: pe,
|
|
163
164
|
height: 460,
|
|
164
165
|
emptyMessage: K.length === 0 ? R("movethewheels.dashboard.liveMap.noActive", "No active deliveries right now") : R("movethewheels.dashboard.liveMap.awaitingGps", "Awaiting live GPS positions for active deliveries")
|
|
165
166
|
})
|
|
166
167
|
})]
|
|
167
|
-
}), /* @__PURE__ */
|
|
168
|
+
}), /* @__PURE__ */ j("div", {
|
|
168
169
|
className: "space-y-6",
|
|
169
|
-
children: [/* @__PURE__ */
|
|
170
|
+
children: [/* @__PURE__ */ j(_, { children: [/* @__PURE__ */ A(y, { children: /* @__PURE__ */ j(b, {
|
|
170
171
|
className: "flex items-center gap-2",
|
|
171
172
|
children: [
|
|
172
|
-
/* @__PURE__ */
|
|
173
|
+
/* @__PURE__ */ A(c, {
|
|
173
174
|
size: 18,
|
|
174
175
|
className: "text-status-warning-text"
|
|
175
176
|
}),
|
|
176
177
|
R("movethewheels.dashboard.exceptions.title", "Exception Alerts"),
|
|
177
|
-
q.length > 0 && /* @__PURE__ */
|
|
178
|
+
q.length > 0 && /* @__PURE__ */ A(h, {
|
|
178
179
|
variant: "destructive",
|
|
179
180
|
className: "ml-auto",
|
|
180
181
|
children: q.length
|
|
181
182
|
})
|
|
182
183
|
]
|
|
183
|
-
}) }), /* @__PURE__ */
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
className: "mt-1 text-xs text-text-secondary",
|
|
192
|
-
children: e.timestamp ? k(e.timestamp, "relative") : "Time not recorded"
|
|
193
|
-
})]
|
|
194
|
-
}, e.id))
|
|
195
|
-
}) : /* @__PURE__ */ j("p", {
|
|
184
|
+
}) }), /* @__PURE__ */ A(v, { children: q.length > 0 ? /* @__PURE__ */ A(se, {
|
|
185
|
+
alerts: q,
|
|
186
|
+
limit: 4,
|
|
187
|
+
t: R,
|
|
188
|
+
onAcknowledge: ue,
|
|
189
|
+
onOpenOrder: (e) => Q(`orders/${e}`),
|
|
190
|
+
onChanged: de
|
|
191
|
+
}) : /* @__PURE__ */ A("p", {
|
|
196
192
|
className: "py-4 text-center text-sm text-text-secondary",
|
|
197
193
|
children: R("movethewheels.dashboard.exceptions.none", "No exceptions — all deliveries on track")
|
|
198
|
-
}) })] }), /* @__PURE__ */
|
|
194
|
+
}) })] }), /* @__PURE__ */ j(_, { children: [/* @__PURE__ */ A(y, { children: /* @__PURE__ */ j(b, {
|
|
199
195
|
className: "flex items-center gap-2",
|
|
200
|
-
children: [/* @__PURE__ */
|
|
201
|
-
}) }), /* @__PURE__ */
|
|
196
|
+
children: [/* @__PURE__ */ A(e, { size: 18 }), R("movethewheels.dashboard.activity.title", "Recent Activity")]
|
|
197
|
+
}) }), /* @__PURE__ */ A(v, { children: Z.length > 0 ? /* @__PURE__ */ A("ul", {
|
|
202
198
|
className: "space-y-3",
|
|
203
|
-
children: Z.map((e) => /* @__PURE__ */
|
|
199
|
+
children: Z.map((e) => /* @__PURE__ */ j("li", {
|
|
204
200
|
className: "flex items-start gap-3",
|
|
205
|
-
children: [/* @__PURE__ */
|
|
201
|
+
children: [/* @__PURE__ */ A("span", {
|
|
206
202
|
"aria-hidden": !0,
|
|
207
203
|
className: "mt-1.5 h-2 w-2 shrink-0 rounded-full bg-action-primary-bg"
|
|
208
|
-
}), /* @__PURE__ */
|
|
204
|
+
}), /* @__PURE__ */ j("div", {
|
|
209
205
|
className: "min-w-0 flex-1",
|
|
210
|
-
children: [/* @__PURE__ */
|
|
206
|
+
children: [/* @__PURE__ */ j("p", {
|
|
211
207
|
className: "truncate text-sm",
|
|
212
208
|
children: [
|
|
213
|
-
/* @__PURE__ */
|
|
209
|
+
/* @__PURE__ */ A("span", {
|
|
214
210
|
className: "font-medium",
|
|
215
211
|
children: e.orderNumber
|
|
216
212
|
}),
|
|
217
213
|
" ",
|
|
218
|
-
/* @__PURE__ */
|
|
214
|
+
/* @__PURE__ */ A("span", {
|
|
219
215
|
className: "text-text-secondary capitalize",
|
|
220
216
|
children: e.status.replace(/_/g, " ")
|
|
221
217
|
})
|
|
222
218
|
]
|
|
223
|
-
}), /* @__PURE__ */
|
|
219
|
+
}), /* @__PURE__ */ A("p", {
|
|
224
220
|
className: "text-xs text-text-secondary",
|
|
225
|
-
children:
|
|
221
|
+
children: O(e.updatedAt ?? e.createdAt, "relative")
|
|
226
222
|
})]
|
|
227
223
|
})]
|
|
228
224
|
}, e.id))
|
|
229
|
-
}) : /* @__PURE__ */
|
|
225
|
+
}) : /* @__PURE__ */ A("p", {
|
|
230
226
|
className: "py-4 text-center text-sm text-text-secondary",
|
|
231
227
|
children: R("movethewheels.dashboard.activity.none", "No recent activity yet")
|
|
232
228
|
}) })] })]
|
|
233
229
|
})]
|
|
234
230
|
}),
|
|
235
|
-
/* @__PURE__ */
|
|
231
|
+
/* @__PURE__ */ j(_, { children: [/* @__PURE__ */ A(y, { children: /* @__PURE__ */ A(b, { children: R("movethewheels.dashboard.weeklyVolume.title", "Weekly order volume") }) }), /* @__PURE__ */ A(v, { children: /* @__PURE__ */ A(oe, {
|
|
236
232
|
xKey: "date",
|
|
237
233
|
height: 240,
|
|
238
|
-
data:
|
|
234
|
+
data: fe,
|
|
239
235
|
series: [{
|
|
240
236
|
dataKey: "orders",
|
|
241
237
|
name: "Orders"
|
|
@@ -245,132 +241,132 @@ function L() {
|
|
|
245
241
|
}],
|
|
246
242
|
emptyMessage: R("movethewheels.dashboard.weeklyVolume.empty", "No order volume recorded yet")
|
|
247
243
|
}) })] }),
|
|
248
|
-
/* @__PURE__ */
|
|
244
|
+
/* @__PURE__ */ j(w, {
|
|
249
245
|
columns: 4,
|
|
250
246
|
children: [
|
|
251
|
-
/* @__PURE__ */
|
|
247
|
+
/* @__PURE__ */ A(C, {
|
|
252
248
|
size: "sm",
|
|
253
249
|
label: R("movethewheels.dashboard.metrics.fleetUtilization", "Fleet Utilization"),
|
|
254
250
|
value: `${V.fleet.activeVehicles}/${V.fleet.totalVehicles}`,
|
|
255
251
|
subtitle: `${V.fleet.availableDrivers} ${R("movethewheels.dashboard.metrics.driversAvailable", "drivers available")}`
|
|
256
252
|
}),
|
|
257
|
-
/* @__PURE__ */
|
|
253
|
+
/* @__PURE__ */ A(C, {
|
|
258
254
|
size: "sm",
|
|
259
255
|
label: R("movethewheels.dashboard.stats.avgOrderValue", "Avg Order Value"),
|
|
260
|
-
value:
|
|
256
|
+
value: D(V.revenue.avgOrderValue)
|
|
261
257
|
}),
|
|
262
|
-
/* @__PURE__ */
|
|
258
|
+
/* @__PURE__ */ A(C, {
|
|
263
259
|
size: "sm",
|
|
264
260
|
label: R("movethewheels.dashboard.stats.driverRating", "Driver Rating"),
|
|
265
261
|
value: V.performance.avgDriverRating.toFixed(1),
|
|
266
262
|
subtitle: R("movethewheels.dashboard.stats.outOfFive", "out of 5")
|
|
267
263
|
}),
|
|
268
|
-
/* @__PURE__ */
|
|
264
|
+
/* @__PURE__ */ A(C, {
|
|
269
265
|
size: "sm",
|
|
270
266
|
label: R("movethewheels.dashboard.stats.deliveredToday", "Delivered Today"),
|
|
271
267
|
value: V.orders.delivered
|
|
272
268
|
})
|
|
273
269
|
]
|
|
274
270
|
}),
|
|
275
|
-
/* @__PURE__ */
|
|
271
|
+
/* @__PURE__ */ j("div", {
|
|
276
272
|
className: "grid grid-cols-1 lg:grid-cols-2 gap-6",
|
|
277
|
-
children: [/* @__PURE__ */
|
|
273
|
+
children: [/* @__PURE__ */ A(S, {
|
|
278
274
|
title: R("movethewheels.dashboard.recentOrders.title", "Recent Orders"),
|
|
279
|
-
actions: /* @__PURE__ */
|
|
275
|
+
actions: /* @__PURE__ */ j(g, {
|
|
280
276
|
variant: "ghost",
|
|
281
277
|
size: "sm",
|
|
282
278
|
onClick: () => Q("orders"),
|
|
283
279
|
children: [
|
|
284
280
|
R("movethewheels.dashboard.common.viewAll", "View all"),
|
|
285
281
|
" ",
|
|
286
|
-
/* @__PURE__ */
|
|
282
|
+
/* @__PURE__ */ A(t, { size: 16 })
|
|
287
283
|
]
|
|
288
284
|
}),
|
|
289
|
-
children: /* @__PURE__ */
|
|
285
|
+
children: /* @__PURE__ */ A(_, { children: /* @__PURE__ */ A(v, {
|
|
290
286
|
className: "p-0",
|
|
291
|
-
children: /* @__PURE__ */
|
|
287
|
+
children: /* @__PURE__ */ j("div", {
|
|
292
288
|
className: "divide-y",
|
|
293
|
-
children: [U.slice(0, 5).map((e) => /* @__PURE__ */
|
|
289
|
+
children: [U.slice(0, 5).map((e) => /* @__PURE__ */ A("div", {
|
|
294
290
|
role: "button",
|
|
295
291
|
tabIndex: 0,
|
|
296
292
|
"aria-label": `View order ${e.orderNumber}`,
|
|
297
293
|
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",
|
|
298
294
|
onClick: () => Q(`orders/${e.id}`),
|
|
299
295
|
onKeyDown: (t) => $(t, () => Q(`orders/${e.id}`)),
|
|
300
|
-
children: /* @__PURE__ */
|
|
296
|
+
children: /* @__PURE__ */ j("div", {
|
|
301
297
|
className: "flex items-center justify-between",
|
|
302
|
-
children: [/* @__PURE__ */
|
|
298
|
+
children: [/* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("p", {
|
|
303
299
|
className: "font-medium",
|
|
304
300
|
children: e.orderNumber
|
|
305
|
-
}), /* @__PURE__ */
|
|
301
|
+
}), /* @__PURE__ */ A("p", {
|
|
306
302
|
className: "text-sm text-text-secondary",
|
|
307
303
|
children: e.customerInfo.name
|
|
308
|
-
})] }), /* @__PURE__ */
|
|
304
|
+
})] }), /* @__PURE__ */ j("div", {
|
|
309
305
|
className: "text-right",
|
|
310
|
-
children: [/* @__PURE__ */
|
|
306
|
+
children: [/* @__PURE__ */ A(E, {
|
|
311
307
|
status: e.status,
|
|
312
308
|
type: "order",
|
|
313
309
|
size: "sm"
|
|
314
|
-
}), /* @__PURE__ */
|
|
310
|
+
}), /* @__PURE__ */ A("p", {
|
|
315
311
|
className: "text-sm text-text-secondary mt-1",
|
|
316
|
-
children:
|
|
312
|
+
children: D(e.pricing.total)
|
|
317
313
|
})]
|
|
318
314
|
})]
|
|
319
315
|
})
|
|
320
|
-
}, e.id)), U.length === 0 && /* @__PURE__ */
|
|
316
|
+
}, e.id)), U.length === 0 && /* @__PURE__ */ A("div", {
|
|
321
317
|
className: "p-8 text-center text-text-secondary",
|
|
322
318
|
children: R("movethewheels.dashboard.recentOrders.empty", "No recent orders")
|
|
323
319
|
})]
|
|
324
320
|
})
|
|
325
321
|
}) })
|
|
326
|
-
}), /* @__PURE__ */
|
|
322
|
+
}), /* @__PURE__ */ A(S, {
|
|
327
323
|
title: R("movethewheels.dashboard.activeDeliveries.title", "Active Deliveries"),
|
|
328
|
-
actions: /* @__PURE__ */
|
|
324
|
+
actions: /* @__PURE__ */ j(g, {
|
|
329
325
|
variant: "ghost",
|
|
330
326
|
size: "sm",
|
|
331
327
|
onClick: () => Q("tracking/live"),
|
|
332
328
|
children: [
|
|
333
329
|
R("movethewheels.dashboard.activeDeliveries.liveTracking", "Live tracking"),
|
|
334
330
|
" ",
|
|
335
|
-
/* @__PURE__ */
|
|
331
|
+
/* @__PURE__ */ A(t, { size: 16 })
|
|
336
332
|
]
|
|
337
333
|
}),
|
|
338
|
-
children: /* @__PURE__ */
|
|
334
|
+
children: /* @__PURE__ */ A(_, { children: /* @__PURE__ */ A(v, {
|
|
339
335
|
className: "p-0",
|
|
340
|
-
children: /* @__PURE__ */
|
|
336
|
+
children: /* @__PURE__ */ j("div", {
|
|
341
337
|
className: "divide-y",
|
|
342
|
-
children: [K.slice(0, 5).map((e) => e.order ? /* @__PURE__ */
|
|
338
|
+
children: [K.slice(0, 5).map((e) => e.order ? /* @__PURE__ */ A("div", {
|
|
343
339
|
role: "button",
|
|
344
340
|
tabIndex: 0,
|
|
345
341
|
"aria-label": `Track order ${e.order.orderNumber}`,
|
|
346
342
|
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",
|
|
347
343
|
onClick: () => Q(`tracking?order=${e.order.id}`),
|
|
348
344
|
onKeyDown: (t) => e.order && $(t, () => Q(`tracking?order=${e.order.id}`)),
|
|
349
|
-
children: /* @__PURE__ */
|
|
345
|
+
children: /* @__PURE__ */ j("div", {
|
|
350
346
|
className: "flex items-center justify-between",
|
|
351
|
-
children: [/* @__PURE__ */
|
|
347
|
+
children: [/* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("p", {
|
|
352
348
|
className: "font-medium",
|
|
353
349
|
children: e.order.orderNumber
|
|
354
|
-
}), /* @__PURE__ */
|
|
350
|
+
}), /* @__PURE__ */ A("p", {
|
|
355
351
|
className: "text-sm text-text-secondary",
|
|
356
352
|
children: e.driver?.fullName || R("movethewheels.dashboard.activeDeliveries.unassigned", "Unassigned")
|
|
357
|
-
})] }), /* @__PURE__ */
|
|
353
|
+
})] }), /* @__PURE__ */ j("div", {
|
|
358
354
|
className: "text-right",
|
|
359
|
-
children: [/* @__PURE__ */
|
|
355
|
+
children: [/* @__PURE__ */ A(E, {
|
|
360
356
|
status: e.order.status,
|
|
361
357
|
type: "order",
|
|
362
358
|
size: "sm"
|
|
363
|
-
}), /* @__PURE__ */
|
|
359
|
+
}), /* @__PURE__ */ j("p", {
|
|
364
360
|
className: "text-sm text-text-secondary mt-1",
|
|
365
361
|
children: [
|
|
366
362
|
R("movethewheels.dashboard.activeDeliveries.eta", "ETA:"),
|
|
367
363
|
" ",
|
|
368
|
-
e.estimatedArrival ?
|
|
364
|
+
e.estimatedArrival ? O(e.estimatedArrival, "time") : R("movethewheels.dashboard.activeDeliveries.na", "N/A")
|
|
369
365
|
]
|
|
370
366
|
})]
|
|
371
367
|
})]
|
|
372
368
|
})
|
|
373
|
-
}, e.order.id) : null), K.length === 0 && /* @__PURE__ */
|
|
369
|
+
}, e.order.id) : null), K.length === 0 && /* @__PURE__ */ A("div", {
|
|
374
370
|
className: "p-8 text-center text-text-secondary",
|
|
375
371
|
children: R("movethewheels.dashboard.activeDeliveries.empty", "No active deliveries")
|
|
376
372
|
})]
|
|
@@ -378,15 +374,15 @@ function L() {
|
|
|
378
374
|
}) })
|
|
379
375
|
})]
|
|
380
376
|
}),
|
|
381
|
-
/* @__PURE__ */
|
|
377
|
+
/* @__PURE__ */ j("div", {
|
|
382
378
|
className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
|
|
383
379
|
children: [
|
|
384
|
-
/* @__PURE__ */
|
|
380
|
+
/* @__PURE__ */ j(P, {
|
|
385
381
|
className: "space-y-4",
|
|
386
|
-
children: [/* @__PURE__ */
|
|
382
|
+
children: [/* @__PURE__ */ A("h2", {
|
|
387
383
|
className: "text-base font-semibold text-text-primary",
|
|
388
384
|
children: R("movethewheels.dashboard.orderStatus.title", "Order Status")
|
|
389
|
-
}), /* @__PURE__ */
|
|
385
|
+
}), /* @__PURE__ */ A("div", {
|
|
390
386
|
className: "space-y-3",
|
|
391
387
|
children: [
|
|
392
388
|
{
|
|
@@ -409,15 +405,15 @@ function L() {
|
|
|
409
405
|
count: W.byStatus.cancelled,
|
|
410
406
|
color: "bg-status-error-text"
|
|
411
407
|
}
|
|
412
|
-
].map(({ status: e, count: t, color: n }) => /* @__PURE__ */
|
|
408
|
+
].map(({ status: e, count: t, color: n }) => /* @__PURE__ */ j("div", {
|
|
413
409
|
className: "flex items-center justify-between",
|
|
414
|
-
children: [/* @__PURE__ */
|
|
410
|
+
children: [/* @__PURE__ */ j("div", {
|
|
415
411
|
className: "flex items-center gap-2",
|
|
416
|
-
children: [/* @__PURE__ */
|
|
412
|
+
children: [/* @__PURE__ */ A("div", { className: `w-2 h-2 rounded-full ${n}` }), /* @__PURE__ */ A("span", {
|
|
417
413
|
className: "text-sm capitalize",
|
|
418
414
|
children: R(`movethewheels.dashboard.orderStatus.status.${e}`, e.replace("_", " "))
|
|
419
415
|
})]
|
|
420
|
-
}), /* @__PURE__ */
|
|
416
|
+
}), /* @__PURE__ */ A(h, {
|
|
421
417
|
variant: "secondary",
|
|
422
418
|
className: "tabular-nums",
|
|
423
419
|
children: t
|
|
@@ -425,69 +421,69 @@ function L() {
|
|
|
425
421
|
}, e))
|
|
426
422
|
})]
|
|
427
423
|
}),
|
|
428
|
-
/* @__PURE__ */
|
|
424
|
+
/* @__PURE__ */ j(_, { children: [/* @__PURE__ */ A(y, { children: /* @__PURE__ */ A(b, {
|
|
429
425
|
className: "text-base",
|
|
430
426
|
children: R("movethewheels.dashboard.fleetStatus.title", "Fleet Status")
|
|
431
|
-
}) }), /* @__PURE__ */
|
|
427
|
+
}) }), /* @__PURE__ */ j(v, {
|
|
432
428
|
className: "space-y-4",
|
|
433
|
-
children: [/* @__PURE__ */
|
|
429
|
+
children: [/* @__PURE__ */ j("div", {
|
|
434
430
|
className: "space-y-2",
|
|
435
|
-
children: [/* @__PURE__ */
|
|
431
|
+
children: [/* @__PURE__ */ j("div", {
|
|
436
432
|
className: "flex justify-between text-sm",
|
|
437
|
-
children: [/* @__PURE__ */
|
|
438
|
-
}), /* @__PURE__ */
|
|
439
|
-
}), /* @__PURE__ */
|
|
433
|
+
children: [/* @__PURE__ */ A("span", { children: R("movethewheels.dashboard.fleetStatus.vehicleUtilization", "Vehicle Utilization") }), /* @__PURE__ */ j("span", { children: [G.utilization.toFixed(0), "%"] })]
|
|
434
|
+
}), /* @__PURE__ */ A(x, { value: G.utilization })]
|
|
435
|
+
}), /* @__PURE__ */ j("div", {
|
|
440
436
|
className: "grid grid-cols-2 gap-4 text-sm",
|
|
441
437
|
children: [
|
|
442
|
-
/* @__PURE__ */
|
|
438
|
+
/* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("p", {
|
|
443
439
|
className: "text-text-secondary",
|
|
444
440
|
children: R("movethewheels.dashboard.fleetStatus.available", "Available")
|
|
445
|
-
}), /* @__PURE__ */
|
|
441
|
+
}), /* @__PURE__ */ A("p", {
|
|
446
442
|
className: "text-lg font-semibold text-status-success-text",
|
|
447
443
|
children: G.vehiclesByStatus.available
|
|
448
444
|
})] }),
|
|
449
|
-
/* @__PURE__ */
|
|
445
|
+
/* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("p", {
|
|
450
446
|
className: "text-text-secondary",
|
|
451
447
|
children: R("movethewheels.dashboard.fleetStatus.inUse", "In Use")
|
|
452
|
-
}), /* @__PURE__ */
|
|
448
|
+
}), /* @__PURE__ */ A("p", {
|
|
453
449
|
className: "text-lg font-semibold text-status-info-text",
|
|
454
450
|
children: G.vehiclesByStatus.assigned
|
|
455
451
|
})] }),
|
|
456
|
-
/* @__PURE__ */
|
|
452
|
+
/* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("p", {
|
|
457
453
|
className: "text-text-secondary",
|
|
458
454
|
children: R("movethewheels.dashboard.fleetStatus.maintenance", "Maintenance")
|
|
459
|
-
}), /* @__PURE__ */
|
|
455
|
+
}), /* @__PURE__ */ A("p", {
|
|
460
456
|
className: "text-lg font-semibold text-status-warning-text",
|
|
461
457
|
children: G.vehiclesByStatus.maintenance
|
|
462
458
|
})] }),
|
|
463
|
-
/* @__PURE__ */
|
|
459
|
+
/* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("p", {
|
|
464
460
|
className: "text-text-secondary",
|
|
465
461
|
children: R("movethewheels.dashboard.fleetStatus.avgFuel", "Avg Fuel")
|
|
466
|
-
}), /* @__PURE__ */
|
|
462
|
+
}), /* @__PURE__ */ j("p", {
|
|
467
463
|
className: "text-lg font-semibold",
|
|
468
464
|
children: [G.avgFuelLevel.toFixed(0), "%"]
|
|
469
465
|
})] })
|
|
470
466
|
]
|
|
471
467
|
})]
|
|
472
468
|
})] }),
|
|
473
|
-
/* @__PURE__ */
|
|
469
|
+
/* @__PURE__ */ j(_, { children: [/* @__PURE__ */ A(y, { children: /* @__PURE__ */ j(b, {
|
|
474
470
|
className: "text-base flex items-center gap-2",
|
|
475
|
-
children: [/* @__PURE__ */
|
|
471
|
+
children: [/* @__PURE__ */ A(c, {
|
|
476
472
|
size: 16,
|
|
477
473
|
className: "text-status-warning-text"
|
|
478
474
|
}), R("movethewheels.dashboard.alerts.title", "Alerts")]
|
|
479
|
-
}) }), /* @__PURE__ */
|
|
475
|
+
}) }), /* @__PURE__ */ A(v, { children: /* @__PURE__ */ j("div", {
|
|
480
476
|
className: "space-y-3",
|
|
481
477
|
children: [
|
|
482
|
-
W.byStatus.pending > 5 && /* @__PURE__ */
|
|
478
|
+
W.byStatus.pending > 5 && /* @__PURE__ */ j("div", {
|
|
483
479
|
className: "flex items-start gap-3 p-2 rounded bg-status-warning-bg-subtle",
|
|
484
|
-
children: [/* @__PURE__ */
|
|
480
|
+
children: [/* @__PURE__ */ A(n, {
|
|
485
481
|
size: 16,
|
|
486
482
|
className: "text-status-warning-text mt-0.5"
|
|
487
|
-
}), /* @__PURE__ */
|
|
483
|
+
}), /* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("p", {
|
|
488
484
|
className: "text-sm font-medium",
|
|
489
485
|
children: R("movethewheels.dashboard.alerts.pendingOrders.title", "Pending Orders")
|
|
490
|
-
}), /* @__PURE__ */
|
|
486
|
+
}), /* @__PURE__ */ j("p", {
|
|
491
487
|
className: "text-xs text-text-secondary",
|
|
492
488
|
children: [
|
|
493
489
|
W.byStatus.pending,
|
|
@@ -496,15 +492,15 @@ function L() {
|
|
|
496
492
|
]
|
|
497
493
|
})] })]
|
|
498
494
|
}),
|
|
499
|
-
G.vehiclesByStatus.maintenance > 0 && /* @__PURE__ */
|
|
495
|
+
G.vehiclesByStatus.maintenance > 0 && /* @__PURE__ */ j("div", {
|
|
500
496
|
className: "flex items-start gap-3 p-2 rounded bg-status-warning-bg-subtle",
|
|
501
|
-
children: [/* @__PURE__ */
|
|
497
|
+
children: [/* @__PURE__ */ A(l, {
|
|
502
498
|
size: 16,
|
|
503
499
|
className: "text-status-warning-text mt-0.5"
|
|
504
|
-
}), /* @__PURE__ */
|
|
500
|
+
}), /* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("p", {
|
|
505
501
|
className: "text-sm font-medium",
|
|
506
502
|
children: R("movethewheels.dashboard.alerts.maintenanceVehicles.title", "Vehicles in Maintenance")
|
|
507
|
-
}), /* @__PURE__ */
|
|
503
|
+
}), /* @__PURE__ */ j("p", {
|
|
508
504
|
className: "text-xs text-text-secondary",
|
|
509
505
|
children: [
|
|
510
506
|
G.vehiclesByStatus.maintenance,
|
|
@@ -513,15 +509,15 @@ function L() {
|
|
|
513
509
|
]
|
|
514
510
|
})] })]
|
|
515
511
|
}),
|
|
516
|
-
G.driversByStatus.offline > 0 && /* @__PURE__ */
|
|
512
|
+
G.driversByStatus.offline > 0 && /* @__PURE__ */ j("div", {
|
|
517
513
|
className: "flex items-start gap-3 p-2 rounded bg-bg-sunken",
|
|
518
|
-
children: [/* @__PURE__ */
|
|
514
|
+
children: [/* @__PURE__ */ A(ee, {
|
|
519
515
|
size: 16,
|
|
520
516
|
className: "text-text-secondary mt-0.5"
|
|
521
|
-
}), /* @__PURE__ */
|
|
517
|
+
}), /* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("p", {
|
|
522
518
|
className: "text-sm font-medium",
|
|
523
519
|
children: R("movethewheels.dashboard.alerts.offlineDrivers.title", "Offline Drivers")
|
|
524
|
-
}), /* @__PURE__ */
|
|
520
|
+
}), /* @__PURE__ */ j("p", {
|
|
525
521
|
className: "text-xs text-text-secondary",
|
|
526
522
|
children: [
|
|
527
523
|
G.driversByStatus.offline,
|
|
@@ -530,9 +526,9 @@ function L() {
|
|
|
530
526
|
]
|
|
531
527
|
})] })]
|
|
532
528
|
}),
|
|
533
|
-
W.byStatus.pending <= 5 && G.vehiclesByStatus.maintenance === 0 && G.driversByStatus.offline === 0 && /* @__PURE__ */
|
|
529
|
+
W.byStatus.pending <= 5 && G.vehiclesByStatus.maintenance === 0 && G.driversByStatus.offline === 0 && /* @__PURE__ */ A("div", {
|
|
534
530
|
className: "text-center py-4 text-text-secondary",
|
|
535
|
-
children: /* @__PURE__ */
|
|
531
|
+
children: /* @__PURE__ */ A("p", {
|
|
536
532
|
className: "text-sm",
|
|
537
533
|
children: R("movethewheels.dashboard.alerts.allOperational", "All systems operational")
|
|
538
534
|
})
|