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