@burdenoff/microfe-movethewheels 2026.830.5 → 2026.918.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/AssignmentSuggestions.js +135 -0
- package/dist/components/FleetAlertsPanel.js +114 -0
- package/dist/components/VehicleServiceCard.js +176 -0
- package/dist/hooks/useFleet.js +4 -3
- package/dist/hooks/useFleetIntelligence.js +91 -0
- package/dist/movethewheels/components/AssignmentSuggestions.d.ts +17 -0
- package/dist/movethewheels/components/FleetAlertsPanel.d.ts +14 -0
- package/dist/movethewheels/components/VehicleServiceCard.d.ts +10 -0
- package/dist/movethewheels/hooks/useFleetIntelligence.d.ts +64 -0
- package/dist/movethewheels/types/index.d.ts +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/sparkles.js +26 -0
- package/dist/pages/FleetPage.js +156 -146
- package/dist/pages/RouteDetailsPage.js +202 -184
- package/dist/pages/VehicleDetailsPage.js +149 -131
- package/dist/utils/graphqlClient.js +14 -5
- package/package.json +1 -1
- package/src/movethewheels/components/AssignmentSuggestions.tsx +234 -0
- package/src/movethewheels/components/FleetAlertsPanel.tsx +148 -0
- package/src/movethewheels/components/VehicleServiceCard.tsx +220 -0
- package/src/movethewheels/hooks/useFleet.ts +12 -2
- package/src/movethewheels/hooks/useFleetIntelligence.ts +226 -0
- package/src/movethewheels/pages/FleetPage.tsx +21 -0
- package/src/movethewheels/pages/RouteDetailsPage.tsx +33 -1
- package/src/movethewheels/pages/VehicleDetailsPage.tsx +27 -0
- package/src/movethewheels/types/index.ts +2 -0
- package/src/movethewheels/utils/graphqlClient.ts +20 -1
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { createLucideIcon as e } from "../createLucideIcon.js";
|
|
2
|
+
//#region node_modules/lucide-react/dist/esm/icons/sparkles.js
|
|
3
|
+
var t = e("Sparkles", [
|
|
4
|
+
["path", {
|
|
5
|
+
d: "M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",
|
|
6
|
+
key: "4pj2yx"
|
|
7
|
+
}],
|
|
8
|
+
["path", {
|
|
9
|
+
d: "M20 3v4",
|
|
10
|
+
key: "1olli1"
|
|
11
|
+
}],
|
|
12
|
+
["path", {
|
|
13
|
+
d: "M22 5h-4",
|
|
14
|
+
key: "1gvqau"
|
|
15
|
+
}],
|
|
16
|
+
["path", {
|
|
17
|
+
d: "M4 17v2",
|
|
18
|
+
key: "vumght"
|
|
19
|
+
}],
|
|
20
|
+
["path", {
|
|
21
|
+
d: "M5 18H3",
|
|
22
|
+
key: "zchphs"
|
|
23
|
+
}]
|
|
24
|
+
]);
|
|
25
|
+
//#endregion
|
|
26
|
+
export { t as Sparkles };
|
package/dist/pages/FleetPage.js
CHANGED
|
@@ -3,178 +3,188 @@ import { Fuel as t } from "../node_modules/lucide-react/dist/esm/icons/fuel.js";
|
|
|
3
3
|
import { Star as n } from "../node_modules/lucide-react/dist/esm/icons/star.js";
|
|
4
4
|
import { Truck as r } from "../node_modules/lucide-react/dist/esm/icons/truck.js";
|
|
5
5
|
import { Users as i } from "../node_modules/lucide-react/dist/esm/icons/users.js";
|
|
6
|
-
import { Wrench as
|
|
7
|
-
import { joinPath as
|
|
8
|
-
import { useMoveTheWheels as
|
|
9
|
-
import { useDrivers as
|
|
10
|
-
import { Avatar as
|
|
11
|
-
import { PageLayout as
|
|
12
|
-
import { MetricCard as
|
|
13
|
-
import { StatusBadge as
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
6
|
+
import { Wrench as ee } from "../node_modules/lucide-react/dist/esm/icons/wrench.js";
|
|
7
|
+
import { joinPath as te } from "../utils/navigation.js";
|
|
8
|
+
import { useMoveTheWheels as a } from "../providers/MoveTheWheelsProvider.js";
|
|
9
|
+
import { useDrivers as o, useFleetStats as s, useVehicles as c } from "../hooks/useFleet.js";
|
|
10
|
+
import { Avatar as l, AvatarFallback as ne, Button as u, Card as d, CardContent as f, CardHeader as p, CardTitle as m, Progress as h } from "../components/ui.js";
|
|
11
|
+
import { PageLayout as g, PageSection as _ } from "../components/PageLayout.js";
|
|
12
|
+
import { MetricCard as v, MetricCardSkeleton as y, MetricGrid as b } from "../components/MetricCard.js";
|
|
13
|
+
import { StatusBadge as x, VehicleTypeBadge as re } from "../components/StatusBadge.js";
|
|
14
|
+
import { useFleetAlerts as ie } from "../hooks/useFleetIntelligence.js";
|
|
15
|
+
import { FleetAlertsPanel as S } from "../components/FleetAlertsPanel.js";
|
|
16
|
+
import { jsx as C, jsxs as w } from "react/jsx-runtime";
|
|
17
|
+
import { useI18n as T } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
18
|
+
import { CTAOverflowMenu as E, EmphasisPanel as D, NextSteps as O, PagePurpose as k } from "@burdenoff/fe-libs/ui";
|
|
17
19
|
//#region src/movethewheels/pages/FleetPage.tsx
|
|
18
|
-
function
|
|
19
|
-
let { t:
|
|
20
|
-
let n =
|
|
20
|
+
function A() {
|
|
21
|
+
let { t: A } = T(), j = (e, t) => {
|
|
22
|
+
let n = A(e);
|
|
21
23
|
return n === e ? t : n;
|
|
22
|
-
}, { basePath:
|
|
23
|
-
|
|
24
|
+
}, { basePath: M, navigate: N } = a(), { stats: P, isLoading: F, error: I, refetch: L } = s(), { vehicles: R, isLoading: z, error: B, refetch: V } = c(), { drivers: H, isLoading: U, error: W, refetch: G } = o(), { data: K, isLoading: q, error: J, refetch: Y } = ie(), X = F || z || U, Z = I ?? B ?? W, ae = () => {
|
|
25
|
+
L(), V(), G();
|
|
24
26
|
}, Q = (e) => {
|
|
25
|
-
|
|
26
|
-
}, $ = (e, t) => {
|
|
27
|
+
N && N(te(M, e));
|
|
28
|
+
}, oe = (e) => Q(`fleet/${e.subjectType === "VEHICLE" ? "vehicles" : "drivers"}/${e.subjectId}`), $ = (e, t) => {
|
|
27
29
|
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), t());
|
|
28
30
|
};
|
|
29
|
-
return /* @__PURE__ */
|
|
30
|
-
title:
|
|
31
|
-
subtitle:
|
|
32
|
-
icon: /* @__PURE__ */
|
|
33
|
-
headerActions: /* @__PURE__ */ E
|
|
31
|
+
return /* @__PURE__ */ w(g, {
|
|
32
|
+
title: j("movethewheels.fleet.title", "Fleet Management"),
|
|
33
|
+
subtitle: j("movethewheels.fleet.subtitle", "Manage your vehicles and drivers"),
|
|
34
|
+
icon: /* @__PURE__ */ C(r, { size: 24 }),
|
|
35
|
+
headerActions: /* @__PURE__ */ C(E, {
|
|
34
36
|
primary: {
|
|
35
|
-
label:
|
|
36
|
-
icon: /* @__PURE__ */
|
|
37
|
+
label: j("movethewheels.fleet.actions.allVehicles", "All Vehicles"),
|
|
38
|
+
icon: /* @__PURE__ */ C(r, { size: 16 }),
|
|
37
39
|
onSelect: () => Q("fleet/vehicles")
|
|
38
40
|
},
|
|
39
41
|
actions: [{
|
|
40
|
-
label:
|
|
41
|
-
icon: /* @__PURE__ */
|
|
42
|
+
label: j("movethewheels.fleet.actions.allDrivers", "All Drivers"),
|
|
43
|
+
icon: /* @__PURE__ */ C(i, { size: 16 }),
|
|
42
44
|
onSelect: () => Q("fleet/drivers")
|
|
43
45
|
}]
|
|
44
46
|
}),
|
|
45
47
|
children: [
|
|
46
|
-
/* @__PURE__ */
|
|
47
|
-
icon: /* @__PURE__ */
|
|
48
|
-
children:
|
|
48
|
+
/* @__PURE__ */ C(k, {
|
|
49
|
+
icon: /* @__PURE__ */ C(r, { size: 18 }),
|
|
50
|
+
children: j("movethewheels.fleet.purpose", "Your command center for vehicles and drivers. See utilization at a glance, keep an eye on availability and ratings, and act on maintenance alerts so you always have road-ready capacity to fulfil orders.")
|
|
49
51
|
}),
|
|
50
|
-
/* @__PURE__ */
|
|
52
|
+
/* @__PURE__ */ C(O, {
|
|
51
53
|
storageKey: "movethewheels-fleet",
|
|
52
54
|
steps: [
|
|
53
55
|
{
|
|
54
56
|
id: "vehicles",
|
|
55
|
-
label:
|
|
56
|
-
description:
|
|
57
|
-
icon: /* @__PURE__ */
|
|
57
|
+
label: j("movethewheels.fleet.nextSteps.vehicles", "Review your vehicles"),
|
|
58
|
+
description: j("movethewheels.fleet.nextSteps.vehiclesDesc", "Check capacity, fuel and maintenance status across the fleet."),
|
|
59
|
+
icon: /* @__PURE__ */ C(r, { size: 16 }),
|
|
58
60
|
onClick: () => Q("fleet/vehicles")
|
|
59
61
|
},
|
|
60
62
|
{
|
|
61
63
|
id: "drivers",
|
|
62
|
-
label:
|
|
63
|
-
description:
|
|
64
|
-
icon: /* @__PURE__ */
|
|
64
|
+
label: j("movethewheels.fleet.nextSteps.drivers", "Review your drivers"),
|
|
65
|
+
description: j("movethewheels.fleet.nextSteps.driversDesc", "See availability, ratings and delivery history before assigning work."),
|
|
66
|
+
icon: /* @__PURE__ */ C(i, { size: 16 }),
|
|
65
67
|
onClick: () => Q("fleet/drivers")
|
|
66
68
|
},
|
|
67
69
|
{
|
|
68
70
|
id: "assign",
|
|
69
|
-
label:
|
|
70
|
-
description:
|
|
71
|
-
icon: /* @__PURE__ */
|
|
71
|
+
label: j("movethewheels.fleet.nextSteps.assign", "Assign capacity to orders"),
|
|
72
|
+
description: j("movethewheels.fleet.nextSteps.assignDesc", "Open an order to assign an available vehicle and driver."),
|
|
73
|
+
icon: /* @__PURE__ */ C(e, { size: 16 }),
|
|
72
74
|
onClick: () => Q("orders")
|
|
73
75
|
}
|
|
74
76
|
]
|
|
75
77
|
}),
|
|
76
|
-
|
|
78
|
+
/* @__PURE__ */ C(S, {
|
|
79
|
+
alerts: K,
|
|
80
|
+
isLoading: q,
|
|
81
|
+
error: J,
|
|
82
|
+
onRetry: Y,
|
|
83
|
+
onOpen: oe,
|
|
84
|
+
t: j
|
|
85
|
+
}),
|
|
86
|
+
Z && !X ? /* @__PURE__ */ C(d, {
|
|
77
87
|
className: "border-status-error-border",
|
|
78
|
-
children: /* @__PURE__ */
|
|
88
|
+
children: /* @__PURE__ */ w(f, {
|
|
79
89
|
className: "p-6 text-center space-y-3",
|
|
80
90
|
children: [
|
|
81
|
-
/* @__PURE__ */
|
|
91
|
+
/* @__PURE__ */ C("p", {
|
|
82
92
|
className: "text-status-error-text font-medium",
|
|
83
|
-
children:
|
|
93
|
+
children: j("movethewheels.fleet.error.title", "Couldn't load fleet data")
|
|
84
94
|
}),
|
|
85
|
-
/* @__PURE__ */
|
|
95
|
+
/* @__PURE__ */ C("p", {
|
|
86
96
|
className: "text-sm text-text-secondary",
|
|
87
|
-
children:
|
|
97
|
+
children: Z.message
|
|
88
98
|
}),
|
|
89
|
-
/* @__PURE__ */
|
|
99
|
+
/* @__PURE__ */ C(u, {
|
|
90
100
|
variant: "outline",
|
|
91
|
-
onClick:
|
|
92
|
-
children:
|
|
101
|
+
onClick: ae,
|
|
102
|
+
children: j("movethewheels.fleet.error.retry", "Retry")
|
|
93
103
|
})
|
|
94
104
|
]
|
|
95
105
|
})
|
|
96
|
-
}) :
|
|
106
|
+
}) : X ? /* @__PURE__ */ C(b, {
|
|
97
107
|
columns: 4,
|
|
98
|
-
children: Array.from({ length: 4 }).map((e, t) => /* @__PURE__ */
|
|
99
|
-
}) : /* @__PURE__ */
|
|
108
|
+
children: Array.from({ length: 4 }).map((e, t) => /* @__PURE__ */ C(y, {}, t))
|
|
109
|
+
}) : /* @__PURE__ */ w(b, {
|
|
100
110
|
columns: 4,
|
|
101
111
|
children: [
|
|
102
|
-
/* @__PURE__ */
|
|
103
|
-
label:
|
|
104
|
-
value:
|
|
105
|
-
icon: /* @__PURE__ */
|
|
106
|
-
subtitle: `${
|
|
112
|
+
/* @__PURE__ */ C(v, {
|
|
113
|
+
label: j("movethewheels.fleet.metrics.totalVehicles", "Total Vehicles"),
|
|
114
|
+
value: P.totalVehicles,
|
|
115
|
+
icon: /* @__PURE__ */ C(r, { size: 20 }),
|
|
116
|
+
subtitle: `${P.vehiclesByStatus.available} ${j("movethewheels.fleet.metrics.available", "available")}`,
|
|
107
117
|
onClick: () => Q("fleet/vehicles")
|
|
108
118
|
}),
|
|
109
|
-
/* @__PURE__ */
|
|
110
|
-
label:
|
|
111
|
-
value:
|
|
112
|
-
icon: /* @__PURE__ */
|
|
113
|
-
subtitle: `${
|
|
119
|
+
/* @__PURE__ */ C(v, {
|
|
120
|
+
label: j("movethewheels.fleet.metrics.totalDrivers", "Total Drivers"),
|
|
121
|
+
value: P.totalDrivers,
|
|
122
|
+
icon: /* @__PURE__ */ C(i, { size: 20 }),
|
|
123
|
+
subtitle: `${P.driversByStatus.available} ${j("movethewheels.fleet.metrics.available", "available")}`,
|
|
114
124
|
onClick: () => Q("fleet/drivers")
|
|
115
125
|
}),
|
|
116
|
-
/* @__PURE__ */
|
|
126
|
+
/* @__PURE__ */ C(v, {
|
|
117
127
|
treatment: "glass",
|
|
118
128
|
glow: !0,
|
|
119
|
-
label:
|
|
120
|
-
value: `${
|
|
121
|
-
icon: /* @__PURE__ */
|
|
122
|
-
changeType:
|
|
129
|
+
label: j("movethewheels.fleet.metrics.utilization", "Fleet Utilization"),
|
|
130
|
+
value: `${P.utilization.toFixed(0)}%`,
|
|
131
|
+
icon: /* @__PURE__ */ C(r, { size: 20 }),
|
|
132
|
+
changeType: P.utilization >= 70 ? "positive" : "neutral"
|
|
123
133
|
}),
|
|
124
|
-
/* @__PURE__ */
|
|
125
|
-
label:
|
|
126
|
-
value:
|
|
127
|
-
icon: /* @__PURE__ */
|
|
128
|
-
subtitle:
|
|
129
|
-
changeType:
|
|
134
|
+
/* @__PURE__ */ C(v, {
|
|
135
|
+
label: j("movethewheels.fleet.metrics.avgDriverRating", "Avg Driver Rating"),
|
|
136
|
+
value: P.avgDriverRating.toFixed(1),
|
|
137
|
+
icon: /* @__PURE__ */ C(n, { size: 20 }),
|
|
138
|
+
subtitle: j("movethewheels.fleet.metrics.outOfFive", "out of 5"),
|
|
139
|
+
changeType: P.avgDriverRating >= 4.5 ? "positive" : "neutral"
|
|
130
140
|
})
|
|
131
141
|
]
|
|
132
142
|
}),
|
|
133
|
-
/* @__PURE__ */
|
|
143
|
+
/* @__PURE__ */ w("div", {
|
|
134
144
|
className: "grid grid-cols-1 lg:grid-cols-2 gap-6",
|
|
135
|
-
children: [/* @__PURE__ */
|
|
136
|
-
title:
|
|
137
|
-
actions: /* @__PURE__ */
|
|
145
|
+
children: [/* @__PURE__ */ C(_, {
|
|
146
|
+
title: j("movethewheels.fleet.vehicles.title", "Vehicles"),
|
|
147
|
+
actions: /* @__PURE__ */ w(u, {
|
|
138
148
|
variant: "ghost",
|
|
139
149
|
size: "sm",
|
|
140
150
|
onClick: () => Q("fleet/vehicles"),
|
|
141
151
|
children: [
|
|
142
|
-
|
|
152
|
+
j("movethewheels.fleet.common.viewAll", "View all"),
|
|
143
153
|
" ",
|
|
144
|
-
/* @__PURE__ */
|
|
154
|
+
/* @__PURE__ */ C(e, { size: 16 })
|
|
145
155
|
]
|
|
146
156
|
}),
|
|
147
|
-
children: /* @__PURE__ */
|
|
157
|
+
children: /* @__PURE__ */ C(d, { children: /* @__PURE__ */ C(f, {
|
|
148
158
|
className: "p-0",
|
|
149
|
-
children: /* @__PURE__ */
|
|
159
|
+
children: /* @__PURE__ */ C("div", {
|
|
150
160
|
className: "divide-y",
|
|
151
|
-
children:
|
|
161
|
+
children: R.slice(0, 5).map((e) => /* @__PURE__ */ C("div", {
|
|
152
162
|
role: "button",
|
|
153
163
|
tabIndex: 0,
|
|
154
164
|
"aria-label": `View vehicle ${e.vehicleNumber}`,
|
|
155
165
|
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",
|
|
156
166
|
onClick: () => Q(`fleet/vehicles/${e.id}`),
|
|
157
167
|
onKeyDown: (t) => $(t, () => Q(`fleet/vehicles/${e.id}`)),
|
|
158
|
-
children: /* @__PURE__ */
|
|
168
|
+
children: /* @__PURE__ */ w("div", {
|
|
159
169
|
className: "flex items-center justify-between",
|
|
160
|
-
children: [/* @__PURE__ */
|
|
170
|
+
children: [/* @__PURE__ */ w("div", {
|
|
161
171
|
className: "flex items-center gap-3",
|
|
162
|
-
children: [/* @__PURE__ */
|
|
172
|
+
children: [/* @__PURE__ */ C("div", {
|
|
163
173
|
className: "w-10 h-10 rounded-lg bg-action-primary-bg/10 flex items-center justify-center",
|
|
164
|
-
children: /* @__PURE__ */
|
|
174
|
+
children: /* @__PURE__ */ C(r, {
|
|
165
175
|
size: 20,
|
|
166
176
|
className: "text-primary"
|
|
167
177
|
})
|
|
168
|
-
}), /* @__PURE__ */
|
|
178
|
+
}), /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ w("div", {
|
|
169
179
|
className: "flex items-center gap-2",
|
|
170
|
-
children: [/* @__PURE__ */
|
|
180
|
+
children: [/* @__PURE__ */ C("span", {
|
|
171
181
|
className: "font-medium",
|
|
172
182
|
children: e.vehicleNumber
|
|
173
|
-
}), /* @__PURE__ */
|
|
183
|
+
}), /* @__PURE__ */ C(re, {
|
|
174
184
|
type: e.type,
|
|
175
185
|
size: "sm"
|
|
176
186
|
})]
|
|
177
|
-
}), /* @__PURE__ */
|
|
187
|
+
}), /* @__PURE__ */ w("p", {
|
|
178
188
|
className: "text-sm text-text-secondary",
|
|
179
189
|
children: [
|
|
180
190
|
e.make,
|
|
@@ -185,24 +195,24 @@ function N() {
|
|
|
185
195
|
")"
|
|
186
196
|
]
|
|
187
197
|
})] })]
|
|
188
|
-
}), /* @__PURE__ */
|
|
198
|
+
}), /* @__PURE__ */ w("div", {
|
|
189
199
|
className: "text-right",
|
|
190
|
-
children: [/* @__PURE__ */
|
|
200
|
+
children: [/* @__PURE__ */ C(x, {
|
|
191
201
|
status: e.status,
|
|
192
202
|
type: "vehicle",
|
|
193
203
|
size: "sm"
|
|
194
|
-
}), e.fuelLevel !== void 0 && /* @__PURE__ */
|
|
204
|
+
}), e.fuelLevel !== void 0 && /* @__PURE__ */ w("div", {
|
|
195
205
|
className: "mt-2 flex items-center gap-2",
|
|
196
206
|
children: [
|
|
197
|
-
/* @__PURE__ */
|
|
207
|
+
/* @__PURE__ */ C(t, {
|
|
198
208
|
size: 12,
|
|
199
209
|
className: "text-text-secondary"
|
|
200
210
|
}),
|
|
201
|
-
/* @__PURE__ */
|
|
211
|
+
/* @__PURE__ */ C(h, {
|
|
202
212
|
value: e.fuelLevel,
|
|
203
213
|
className: "w-16 h-2"
|
|
204
214
|
}),
|
|
205
|
-
/* @__PURE__ */
|
|
215
|
+
/* @__PURE__ */ w("span", {
|
|
206
216
|
className: "text-xs text-text-secondary",
|
|
207
217
|
children: [e.fuelLevel, "%"]
|
|
208
218
|
})
|
|
@@ -213,58 +223,58 @@ function N() {
|
|
|
213
223
|
}, e.id))
|
|
214
224
|
})
|
|
215
225
|
}) })
|
|
216
|
-
}), /* @__PURE__ */
|
|
217
|
-
title:
|
|
218
|
-
actions: /* @__PURE__ */
|
|
226
|
+
}), /* @__PURE__ */ C(_, {
|
|
227
|
+
title: j("movethewheels.fleet.drivers.title", "Drivers"),
|
|
228
|
+
actions: /* @__PURE__ */ w(u, {
|
|
219
229
|
variant: "ghost",
|
|
220
230
|
size: "sm",
|
|
221
231
|
onClick: () => Q("fleet/drivers"),
|
|
222
232
|
children: [
|
|
223
|
-
|
|
233
|
+
j("movethewheels.fleet.common.viewAll", "View all"),
|
|
224
234
|
" ",
|
|
225
|
-
/* @__PURE__ */
|
|
235
|
+
/* @__PURE__ */ C(e, { size: 16 })
|
|
226
236
|
]
|
|
227
237
|
}),
|
|
228
|
-
children: /* @__PURE__ */
|
|
238
|
+
children: /* @__PURE__ */ C(d, { children: /* @__PURE__ */ C(f, {
|
|
229
239
|
className: "p-0",
|
|
230
|
-
children: /* @__PURE__ */
|
|
240
|
+
children: /* @__PURE__ */ C("div", {
|
|
231
241
|
className: "divide-y",
|
|
232
|
-
children:
|
|
242
|
+
children: H.slice(0, 5).map((e) => /* @__PURE__ */ C("div", {
|
|
233
243
|
role: "button",
|
|
234
244
|
tabIndex: 0,
|
|
235
245
|
"aria-label": `View driver ${e.fullName}`,
|
|
236
246
|
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",
|
|
237
247
|
onClick: () => Q(`fleet/drivers/${e.id}`),
|
|
238
248
|
onKeyDown: (t) => $(t, () => Q(`fleet/drivers/${e.id}`)),
|
|
239
|
-
children: /* @__PURE__ */
|
|
249
|
+
children: /* @__PURE__ */ w("div", {
|
|
240
250
|
className: "flex items-center justify-between",
|
|
241
|
-
children: [/* @__PURE__ */
|
|
251
|
+
children: [/* @__PURE__ */ w("div", {
|
|
242
252
|
className: "flex items-center gap-3",
|
|
243
|
-
children: [/* @__PURE__ */
|
|
253
|
+
children: [/* @__PURE__ */ C(l, { children: /* @__PURE__ */ C(ne, { children: e.fullName.split(" ").map((e) => e[0]).join("") }) }), /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("p", {
|
|
244
254
|
className: "font-medium",
|
|
245
255
|
children: e.fullName
|
|
246
|
-
}), /* @__PURE__ */
|
|
256
|
+
}), /* @__PURE__ */ w("p", {
|
|
247
257
|
className: "text-sm text-text-secondary",
|
|
248
258
|
children: [
|
|
249
259
|
e.employeeId,
|
|
250
260
|
" - ",
|
|
251
261
|
e.completedOrders,
|
|
252
262
|
" ",
|
|
253
|
-
|
|
263
|
+
j("movethewheels.fleet.drivers.deliveries", "deliveries")
|
|
254
264
|
]
|
|
255
265
|
})] })]
|
|
256
|
-
}), /* @__PURE__ */
|
|
266
|
+
}), /* @__PURE__ */ w("div", {
|
|
257
267
|
className: "text-right",
|
|
258
|
-
children: [/* @__PURE__ */
|
|
268
|
+
children: [/* @__PURE__ */ C(x, {
|
|
259
269
|
status: e.status,
|
|
260
270
|
type: "driver",
|
|
261
271
|
size: "sm"
|
|
262
|
-
}), /* @__PURE__ */
|
|
272
|
+
}), /* @__PURE__ */ w("div", {
|
|
263
273
|
className: "mt-1 flex items-center gap-1 justify-end",
|
|
264
|
-
children: [/* @__PURE__ */
|
|
274
|
+
children: [/* @__PURE__ */ C(n, {
|
|
265
275
|
size: 12,
|
|
266
276
|
className: "text-status-warning-text fill-current"
|
|
267
|
-
}), /* @__PURE__ */
|
|
277
|
+
}), /* @__PURE__ */ C("span", {
|
|
268
278
|
className: "text-sm font-medium",
|
|
269
279
|
children: e.ratings.overall.toFixed(1)
|
|
270
280
|
})]
|
|
@@ -276,76 +286,76 @@ function N() {
|
|
|
276
286
|
}) })
|
|
277
287
|
})]
|
|
278
288
|
}),
|
|
279
|
-
/* @__PURE__ */
|
|
289
|
+
/* @__PURE__ */ w("div", {
|
|
280
290
|
className: "grid grid-cols-1 md:grid-cols-2 gap-6",
|
|
281
|
-
children: [/* @__PURE__ */ D
|
|
291
|
+
children: [/* @__PURE__ */ w(D, {
|
|
282
292
|
className: "space-y-4",
|
|
283
|
-
children: [/* @__PURE__ */
|
|
293
|
+
children: [/* @__PURE__ */ C("h2", {
|
|
284
294
|
className: "text-base font-semibold text-text-primary",
|
|
285
|
-
children:
|
|
286
|
-
}), /* @__PURE__ */
|
|
295
|
+
children: j("movethewheels.fleet.status.vehicleTitle", "Vehicle Status")
|
|
296
|
+
}), /* @__PURE__ */ C("div", {
|
|
287
297
|
className: "space-y-4",
|
|
288
|
-
children: Object.entries(
|
|
298
|
+
children: Object.entries(P.vehiclesByStatus).map(([e, t]) => /* @__PURE__ */ w("div", {
|
|
289
299
|
className: "flex items-center justify-between",
|
|
290
|
-
children: [/* @__PURE__ */
|
|
300
|
+
children: [/* @__PURE__ */ C("div", {
|
|
291
301
|
className: "flex items-center gap-3",
|
|
292
|
-
children: /* @__PURE__ */
|
|
302
|
+
children: /* @__PURE__ */ C(x, {
|
|
293
303
|
status: e,
|
|
294
304
|
type: "vehicle"
|
|
295
305
|
})
|
|
296
|
-
}), /* @__PURE__ */
|
|
306
|
+
}), /* @__PURE__ */ w("div", {
|
|
297
307
|
className: "flex items-center gap-3",
|
|
298
|
-
children: [/* @__PURE__ */
|
|
308
|
+
children: [/* @__PURE__ */ C("span", {
|
|
299
309
|
className: "font-medium",
|
|
300
310
|
children: t
|
|
301
|
-
}), /* @__PURE__ */
|
|
302
|
-
value: t /
|
|
311
|
+
}), /* @__PURE__ */ C(h, {
|
|
312
|
+
value: t / P.totalVehicles * 100,
|
|
303
313
|
className: "w-24 h-2"
|
|
304
314
|
})]
|
|
305
315
|
})]
|
|
306
316
|
}, e))
|
|
307
317
|
})]
|
|
308
|
-
}), /* @__PURE__ */
|
|
318
|
+
}), /* @__PURE__ */ w(d, { children: [/* @__PURE__ */ C(p, { children: /* @__PURE__ */ C(m, { children: j("movethewheels.fleet.status.driverTitle", "Driver Status") }) }), /* @__PURE__ */ C(f, { children: /* @__PURE__ */ C("div", {
|
|
309
319
|
className: "space-y-4",
|
|
310
|
-
children: Object.entries(
|
|
320
|
+
children: Object.entries(P.driversByStatus).map(([e, t]) => /* @__PURE__ */ w("div", {
|
|
311
321
|
className: "flex items-center justify-between",
|
|
312
|
-
children: [/* @__PURE__ */
|
|
322
|
+
children: [/* @__PURE__ */ C("div", {
|
|
313
323
|
className: "flex items-center gap-3",
|
|
314
|
-
children: /* @__PURE__ */
|
|
324
|
+
children: /* @__PURE__ */ C(x, {
|
|
315
325
|
status: e,
|
|
316
326
|
type: "driver"
|
|
317
327
|
})
|
|
318
|
-
}), /* @__PURE__ */
|
|
328
|
+
}), /* @__PURE__ */ w("div", {
|
|
319
329
|
className: "flex items-center gap-3",
|
|
320
|
-
children: [/* @__PURE__ */
|
|
330
|
+
children: [/* @__PURE__ */ C("span", {
|
|
321
331
|
className: "font-medium",
|
|
322
332
|
children: t
|
|
323
|
-
}), /* @__PURE__ */
|
|
324
|
-
value: t /
|
|
333
|
+
}), /* @__PURE__ */ C(h, {
|
|
334
|
+
value: t / P.totalDrivers * 100,
|
|
325
335
|
className: "w-24 h-2"
|
|
326
336
|
})]
|
|
327
337
|
})]
|
|
328
338
|
}, e))
|
|
329
339
|
}) })] })]
|
|
330
340
|
}),
|
|
331
|
-
|
|
341
|
+
P.vehiclesByStatus.maintenance > 0 && /* @__PURE__ */ w(d, {
|
|
332
342
|
className: "border-status-warning-border",
|
|
333
|
-
children: [/* @__PURE__ */
|
|
343
|
+
children: [/* @__PURE__ */ C(p, { children: /* @__PURE__ */ w(m, {
|
|
334
344
|
className: "flex items-center gap-2 text-status-warning-text",
|
|
335
|
-
children: [/* @__PURE__ */
|
|
336
|
-
}) }), /* @__PURE__ */
|
|
345
|
+
children: [/* @__PURE__ */ C(ee, { size: 18 }), j("movethewheels.fleet.maintenance.title", "Maintenance Required")]
|
|
346
|
+
}) }), /* @__PURE__ */ C(f, { children: /* @__PURE__ */ C("div", {
|
|
337
347
|
className: "space-y-3",
|
|
338
|
-
children:
|
|
348
|
+
children: R.filter((e) => e.status === "maintenance").map((e) => /* @__PURE__ */ w("div", {
|
|
339
349
|
className: "flex items-center justify-between p-3 bg-status-warning-bg/10 rounded-lg",
|
|
340
|
-
children: [/* @__PURE__ */
|
|
350
|
+
children: [/* @__PURE__ */ w("div", {
|
|
341
351
|
className: "flex items-center gap-3",
|
|
342
|
-
children: [/* @__PURE__ */
|
|
352
|
+
children: [/* @__PURE__ */ C(r, {
|
|
343
353
|
size: 20,
|
|
344
354
|
className: "text-status-warning-text"
|
|
345
|
-
}), /* @__PURE__ */
|
|
355
|
+
}), /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("p", {
|
|
346
356
|
className: "font-medium",
|
|
347
357
|
children: e.vehicleNumber
|
|
348
|
-
}), /* @__PURE__ */
|
|
358
|
+
}), /* @__PURE__ */ w("p", {
|
|
349
359
|
className: "text-sm text-text-secondary",
|
|
350
360
|
children: [
|
|
351
361
|
e.make,
|
|
@@ -353,11 +363,11 @@ function N() {
|
|
|
353
363
|
e.model
|
|
354
364
|
]
|
|
355
365
|
})] })]
|
|
356
|
-
}), /* @__PURE__ */
|
|
366
|
+
}), /* @__PURE__ */ C(u, {
|
|
357
367
|
variant: "outline",
|
|
358
368
|
size: "sm",
|
|
359
369
|
onClick: () => Q(`fleet/vehicles/${e.id}`),
|
|
360
|
-
children:
|
|
370
|
+
children: j("movethewheels.fleet.maintenance.viewDetails", "View Details")
|
|
361
371
|
})]
|
|
362
372
|
}, e.id))
|
|
363
373
|
}) })]
|
|
@@ -366,4 +376,4 @@ function N() {
|
|
|
366
376
|
});
|
|
367
377
|
}
|
|
368
378
|
//#endregion
|
|
369
|
-
export {
|
|
379
|
+
export { A as default };
|