@burdenoff/microfe-movethewheels 2026.1031.3 → 2026.1031.5
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/MoveTheWheelsRoot.js +136 -127
- package/dist/MoveTheWheelsRoutes.js +143 -135
- package/dist/components/DocumentsCard.js +11 -11
- package/dist/components/ProofOfDeliveryCard.js +13 -13
- package/dist/components/ShipmentRiskDialog.js +24 -24
- package/dist/components/ShippingQuoteResults.js +46 -46
- package/dist/components/TrackingAlertList.js +17 -17
- package/dist/generated/tracking-quality-operations.d.ts +56 -0
- package/dist/hooks/useOrderDispatch.js +17 -17
- package/dist/movethewheels/pages/SettingsPage.d.ts +1 -0
- package/dist/movethewheels/providers/ModuleSettingsProvider.d.ts +17 -0
- package/dist/movethewheels/utils/formatters.d.ts +23 -3
- package/dist/movethewheels/utils/moduleSettings.d.ts +52 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/bell.js +11 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/key-round.js +14 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/plug.js +22 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/rotate-ccw.js +11 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/settings.js +13 -0
- package/dist/pages/AnalyticsPage.js +27 -27
- package/dist/pages/CreateOrderPage.js +340 -317
- package/dist/pages/CustomerDetailsPage.js +246 -246
- package/dist/pages/CustomersPage.js +19 -19
- package/dist/pages/DashboardPage.js +24 -24
- package/dist/pages/DeliveryCapturePage.js +74 -74
- package/dist/pages/DriverDetailsPage.js +337 -337
- package/dist/pages/DriversPage.js +26 -26
- package/dist/pages/FinancePage.js +26 -26
- package/dist/pages/InventoryPage.js +28 -28
- package/dist/pages/LiveTrackingPage.js +108 -108
- package/dist/pages/MarketplacePage.js +44 -44
- package/dist/pages/OrderDetailsPage.js +306 -306
- package/dist/pages/OrdersListPage.js +27 -27
- package/dist/pages/ProductDetailsPage.js +89 -89
- package/dist/pages/ProductsPage.js +73 -73
- package/dist/pages/RouteDetailsPage.js +282 -285
- package/dist/pages/RoutesPage.js +78 -78
- package/dist/pages/SettingsPage.js +459 -0
- package/dist/pages/TrackingPage.js +41 -41
- package/dist/pages/VehicleDetailsPage.js +207 -207
- package/dist/pages/VehiclesPage.js +17 -16
- package/dist/pages/WarehouseDetailsPage.js +132 -132
- package/dist/providers/ModuleSettingsProvider.js +74 -0
- package/dist/utils/formatters.js +53 -26
- package/dist/utils/moduleSettings.js +132 -0
- package/package.json +3 -2
- package/src/generated/tracking-quality-operations.ts +62 -0
- package/src/movethewheels/MoveTheWheelsRoot.tsx +18 -5
- package/src/movethewheels/MoveTheWheelsRoutes.tsx +19 -4
- package/src/movethewheels/pages/CreateOrderPage.tsx +38 -6
- package/src/movethewheels/pages/ProductsPage.tsx +2 -2
- package/src/movethewheels/pages/RouteDetailsPage.tsx +3 -6
- package/src/movethewheels/pages/RoutesPage.tsx +2 -2
- package/src/movethewheels/pages/SettingsPage.tsx +516 -0
- package/src/movethewheels/pages/VehicleDetailsPage.tsx +4 -2
- package/src/movethewheels/pages/VehiclesPage.tsx +2 -1
- package/src/movethewheels/providers/ModuleSettingsProvider.tsx +133 -0
- package/src/movethewheels/utils/formatters.ts +69 -10
- package/src/movethewheels/utils/moduleSettings.ts +224 -0
- package/dist/movethewheels/pages/AIAssistantPage.d.ts +0 -22
- package/dist/node_modules/lucide-react/dist/esm/icons/message-circle.js +0 -8
- package/dist/node_modules/lucide-react/dist/esm/icons/wallet.js +0 -11
- package/dist/pages/AIAssistantPage.js +0 -81
- package/src/movethewheels/pages/AIAssistantPage.tsx +0 -123
|
@@ -13,27 +13,27 @@ import { UserX as l } from "../node_modules/lucide-react/dist/esm/icons/user-x.j
|
|
|
13
13
|
import { Users as u } from "../node_modules/lucide-react/dist/esm/icons/users.js";
|
|
14
14
|
import { joinPath as d } from "../utils/navigation.js";
|
|
15
15
|
import { useMoveTheWheels as ne } from "../providers/MoveTheWheelsProvider.js";
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import { DocumentsCard as
|
|
24
|
-
import { useDebouncedValue as
|
|
25
|
-
import { EntityCombobox as
|
|
26
|
-
import { useRefetchOnLeaveEdit as
|
|
27
|
-
import { driverLicenseExpiryInput as
|
|
28
|
-
import { useEffect as
|
|
29
|
-
import { useLocation as
|
|
30
|
-
import { Fragment as
|
|
31
|
-
import { EmphasisPanel as
|
|
16
|
+
import { formatCurrency as f, formatDate as p } from "../utils/formatters.js";
|
|
17
|
+
import { toApiDriverStatus as m, useDriver as re, useFleet as h, useVehicle as ie, useVehicles as ae } from "../hooks/useFleet.js";
|
|
18
|
+
import { Button as g, Card as _, CardContent as v, CardHeader as y, CardTitle as b, Input as x, Label as S, Select as C, SelectContent as oe, SelectItem as w, SelectTrigger as T, SelectValue as E, Textarea as D } from "../components/ui.js";
|
|
19
|
+
import { ErrorState as O, LoadingState as k, PageLayout as se } from "../components/PageLayout.js";
|
|
20
|
+
import { DRIVER_STATUS_LABELS as A } from "../constants/index.js";
|
|
21
|
+
import { StatusBadge as j } from "../components/StatusBadge.js";
|
|
22
|
+
import { FormError as M } from "../components/FormError.js";
|
|
23
|
+
import { DocumentsCard as N } from "../components/DocumentsCard.js";
|
|
24
|
+
import { useDebouncedValue as ce } from "../hooks/useDebouncedValue.js";
|
|
25
|
+
import { EntityCombobox as le } from "../components/EntityCombobox.js";
|
|
26
|
+
import { useRefetchOnLeaveEdit as P } from "../hooks/useRefetchOnLeaveEdit.js";
|
|
27
|
+
import { driverLicenseExpiryInput as ue, driverLicenseExpiryUpdate as de, parseDriverLicenseExpiry as fe } from "../utils/driverLicenseExpiry.js";
|
|
28
|
+
import { useEffect as pe, useState as F } from "react";
|
|
29
|
+
import { useLocation as I, useParams as me } from "react-router";
|
|
30
|
+
import { Fragment as he, jsx as L, jsxs as R } from "react/jsx-runtime";
|
|
31
|
+
import { EmphasisPanel as ge, NextSteps as z, PagePurpose as B, ResponsiveDialog as V, ResponsiveDialogContent as H, ResponsiveDialogDescription as U, ResponsiveDialogFooter as W, ResponsiveDialogHeader as _e, ResponsiveDialogTitle as ve } from "@burdenoff/fe-libs/ui";
|
|
32
32
|
//#region src/movethewheels/pages/DriverDetailsPage.tsx
|
|
33
|
-
var
|
|
33
|
+
var ye = Object.entries(A).map(([e, t]) => ({
|
|
34
34
|
value: e,
|
|
35
35
|
label: t
|
|
36
|
-
})),
|
|
36
|
+
})), be = (e) => e ? e.toISOString().slice(0, 10) : "", xe = (e) => e ? `${e}T12:00:00.000Z` : void 0, Se = {
|
|
37
37
|
employeeId: "",
|
|
38
38
|
firstName: "",
|
|
39
39
|
lastName: "",
|
|
@@ -53,66 +53,66 @@ var ve = Object.entries(k).map(([e, t]) => ({
|
|
|
53
53
|
payCurrency: "",
|
|
54
54
|
onLeaveUntil: ""
|
|
55
55
|
};
|
|
56
|
-
function
|
|
57
|
-
let { basePath: r, navigate: i } = ne(), { createDriver: o, updateDriver: s, deleteDriver:
|
|
56
|
+
function G({ editId: t }) {
|
|
57
|
+
let { basePath: r, navigate: i } = ne(), { createDriver: o, updateDriver: s, deleteDriver: f } = h(), { driver: O, refetch: k } = re(t), A = !!t, [j, N] = F(Se), [P, I] = F(!1), [me, z] = F(null), [G, K] = F(!1), [q, Ce] = F(""), [J, Y] = F(!1), [we, X] = F(null), [Te, Z] = F(!1), [Q, Ee] = F(!1), [De, Oe] = F(null), [ke, Ae] = F(""), { vehicles: je, isLoading: Me, isLoadingMore: Ne, hasMore: Pe, totalVehicles: Fe, loadMore: Ie } = ae({
|
|
58
58
|
limit: 20,
|
|
59
|
-
search:
|
|
60
|
-
}), { vehicle: Le, isLoading: Re } =
|
|
61
|
-
|
|
62
|
-
if (!t || !
|
|
63
|
-
let [e, ...n] =
|
|
64
|
-
|
|
65
|
-
employeeId:
|
|
59
|
+
search: ce(ke) || void 0
|
|
60
|
+
}), { vehicle: Le, isLoading: Re } = ie(j.vehicleId || void 0);
|
|
61
|
+
pe(() => {
|
|
62
|
+
if (!t || !O) return;
|
|
63
|
+
let [e, ...n] = O.fullName.trim().split(/\s+/);
|
|
64
|
+
N({
|
|
65
|
+
employeeId: O.employeeId || "",
|
|
66
66
|
firstName: e || "",
|
|
67
67
|
lastName: n.join(" "),
|
|
68
|
-
email:
|
|
69
|
-
phone:
|
|
70
|
-
licenseNumber:
|
|
71
|
-
licenseClass:
|
|
72
|
-
licenseExpiry:
|
|
73
|
-
status:
|
|
74
|
-
vehicleId:
|
|
75
|
-
vehicleIds:
|
|
76
|
-
rating:
|
|
77
|
-
notes:
|
|
78
|
-
hireDate:
|
|
79
|
-
baseSalary:
|
|
80
|
-
bonusYtd:
|
|
81
|
-
payCurrency:
|
|
82
|
-
onLeaveUntil:
|
|
68
|
+
email: O.email || "",
|
|
69
|
+
phone: O.phone || "",
|
|
70
|
+
licenseNumber: O.licenseNumber || "",
|
|
71
|
+
licenseClass: O.licenseType || "",
|
|
72
|
+
licenseExpiry: ue(O.licenseExpiry),
|
|
73
|
+
status: O.status,
|
|
74
|
+
vehicleId: O.assignedVehicle || "",
|
|
75
|
+
vehicleIds: O.vehicleIds,
|
|
76
|
+
rating: O.rating ? String(O.rating) : "",
|
|
77
|
+
notes: O.notes || "",
|
|
78
|
+
hireDate: be(O.hireDate),
|
|
79
|
+
baseSalary: O.baseSalary === void 0 ? "" : String(O.baseSalary),
|
|
80
|
+
bonusYtd: O.bonusYtd === void 0 ? "" : String(O.bonusYtd),
|
|
81
|
+
payCurrency: O.payCurrency || "",
|
|
82
|
+
onLeaveUntil: be(O.onLeaveUntil)
|
|
83
83
|
});
|
|
84
|
-
}, [t,
|
|
84
|
+
}, [t, O]);
|
|
85
85
|
let ze = () => i?.(d(r, "fleet/drivers")), $ = (e = !0) => ({
|
|
86
|
-
firstName:
|
|
87
|
-
lastName:
|
|
88
|
-
email:
|
|
89
|
-
phone:
|
|
90
|
-
licenseNumber:
|
|
91
|
-
licenseClass:
|
|
92
|
-
licenseExpiry: A ?
|
|
93
|
-
status:
|
|
94
|
-
vehicleId:
|
|
95
|
-
vehicleIds:
|
|
96
|
-
rating:
|
|
97
|
-
notes:
|
|
98
|
-
hireDate:
|
|
99
|
-
baseSalary:
|
|
100
|
-
bonusYtd:
|
|
101
|
-
payCurrency:
|
|
102
|
-
...e ? { onLeaveUntil:
|
|
86
|
+
firstName: j.firstName.trim(),
|
|
87
|
+
lastName: j.lastName.trim(),
|
|
88
|
+
email: j.email.trim() || void 0,
|
|
89
|
+
phone: j.phone.trim() || void 0,
|
|
90
|
+
licenseNumber: j.licenseNumber.trim() || void 0,
|
|
91
|
+
licenseClass: j.licenseClass.trim() || void 0,
|
|
92
|
+
licenseExpiry: A ? de(j.licenseExpiry, O?.licenseExpiry) : fe(j.licenseExpiry),
|
|
93
|
+
status: m(j.status),
|
|
94
|
+
vehicleId: j.vehicleId || null,
|
|
95
|
+
vehicleIds: j.vehicleIds,
|
|
96
|
+
rating: j.rating.trim() ? Number(j.rating) : void 0,
|
|
97
|
+
notes: j.notes.trim() || void 0,
|
|
98
|
+
hireDate: xe(j.hireDate),
|
|
99
|
+
baseSalary: j.baseSalary.trim() ? Number(j.baseSalary) : void 0,
|
|
100
|
+
bonusYtd: j.bonusYtd.trim() ? Number(j.bonusYtd) : void 0,
|
|
101
|
+
payCurrency: j.payCurrency.trim() || void 0,
|
|
102
|
+
...e ? { onLeaveUntil: xe(j.onLeaveUntil) ?? null } : {}
|
|
103
103
|
}), Be = () => ({
|
|
104
|
-
employeeId:
|
|
104
|
+
employeeId: j.employeeId.trim(),
|
|
105
105
|
...$(!1)
|
|
106
106
|
}), Ve = async (e) => {
|
|
107
|
-
if (e.preventDefault(), !
|
|
108
|
-
|
|
107
|
+
if (e.preventDefault(), !j.employeeId.trim() || !j.firstName.trim() || !j.lastName.trim()) {
|
|
108
|
+
z("Employee ID, first name and last name are required.");
|
|
109
109
|
return;
|
|
110
110
|
}
|
|
111
|
-
if (!
|
|
112
|
-
|
|
111
|
+
if (!j.phone.trim()) {
|
|
112
|
+
z("Phone is required so this driver can be reached.");
|
|
113
113
|
return;
|
|
114
114
|
}
|
|
115
|
-
|
|
115
|
+
I(!0), z(null);
|
|
116
116
|
try {
|
|
117
117
|
if (t) {
|
|
118
118
|
let e = await s(t, $());
|
|
@@ -122,108 +122,108 @@ function K({ editId: t }) {
|
|
|
122
122
|
i?.(d(r, `fleet/drivers/${e.id}`));
|
|
123
123
|
}
|
|
124
124
|
} catch (e) {
|
|
125
|
-
console.error("Failed to save driver:", e),
|
|
125
|
+
console.error("Failed to save driver:", e), z(e instanceof Error ? e.message : "Failed to save driver. Please try again."), I(!1);
|
|
126
126
|
}
|
|
127
127
|
}, He = async () => {
|
|
128
|
-
if (!t || !
|
|
128
|
+
if (!t || !q.trim()) {
|
|
129
129
|
X("A reason is required to dismiss a driver.");
|
|
130
130
|
return;
|
|
131
131
|
}
|
|
132
|
-
|
|
132
|
+
Y(!0), X(null);
|
|
133
133
|
try {
|
|
134
134
|
await s(t, {
|
|
135
135
|
...$(),
|
|
136
136
|
terminatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
137
|
-
terminationReason:
|
|
138
|
-
}),
|
|
137
|
+
terminationReason: q.trim()
|
|
138
|
+
}), K(!1), await k(), i?.(d(r, `fleet/drivers/${t}`));
|
|
139
139
|
} catch (e) {
|
|
140
140
|
X(e instanceof Error ? e.message : "Failed to dismiss driver.");
|
|
141
141
|
} finally {
|
|
142
|
-
|
|
142
|
+
Y(!1);
|
|
143
143
|
}
|
|
144
144
|
}, Ue = async () => {
|
|
145
145
|
if (t) {
|
|
146
146
|
Ee(!0), Oe(null);
|
|
147
147
|
try {
|
|
148
|
-
await
|
|
148
|
+
await f(t), Z(!1), i?.(d(r, "fleet/drivers"));
|
|
149
149
|
} catch (e) {
|
|
150
150
|
Oe(e instanceof Error ? e.message : "Failed to delete driver.");
|
|
151
151
|
} finally {
|
|
152
152
|
Ee(!1);
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
|
-
}, We = A && !!
|
|
156
|
-
return /* @__PURE__ */
|
|
155
|
+
}, We = A && !!O?.terminatedAt;
|
|
156
|
+
return /* @__PURE__ */ R(se, {
|
|
157
157
|
title: A ? "Edit Driver" : "Add Driver",
|
|
158
158
|
subtitle: "Add a driver to your workforce",
|
|
159
|
-
icon: /* @__PURE__ */
|
|
160
|
-
headerActions: /* @__PURE__ */
|
|
159
|
+
icon: /* @__PURE__ */ L(u, { size: 24 }),
|
|
160
|
+
headerActions: /* @__PURE__ */ R("div", {
|
|
161
161
|
className: "flex gap-2",
|
|
162
|
-
children: [/* @__PURE__ */
|
|
162
|
+
children: [/* @__PURE__ */ R(g, {
|
|
163
163
|
variant: "outline",
|
|
164
164
|
onClick: ze,
|
|
165
|
-
disabled:
|
|
166
|
-
children: [/* @__PURE__ */
|
|
167
|
-
}), /* @__PURE__ */
|
|
165
|
+
disabled: P,
|
|
166
|
+
children: [/* @__PURE__ */ L(e, { size: 16 }), " Cancel"]
|
|
167
|
+
}), /* @__PURE__ */ R(g, {
|
|
168
168
|
onClick: Ve,
|
|
169
|
-
disabled:
|
|
169
|
+
disabled: P,
|
|
170
170
|
children: [
|
|
171
|
-
/* @__PURE__ */
|
|
171
|
+
/* @__PURE__ */ L(a, { size: 16 }),
|
|
172
172
|
" ",
|
|
173
|
-
A ?
|
|
173
|
+
A ? P ? "Saving..." : "Save Changes" : P ? "Saving..." : "Add Driver"
|
|
174
174
|
]
|
|
175
175
|
})]
|
|
176
176
|
}),
|
|
177
177
|
children: [
|
|
178
|
-
/* @__PURE__ */
|
|
179
|
-
icon: /* @__PURE__ */
|
|
178
|
+
/* @__PURE__ */ L(B, {
|
|
179
|
+
icon: /* @__PURE__ */ L(u, { size: 18 }),
|
|
180
180
|
children: "Add a driver so they can be assigned to orders and routes. An employee ID, name and phone get them on the roster — add licensing, a vehicle and HR details to keep the record complete."
|
|
181
181
|
}),
|
|
182
|
-
We &&
|
|
182
|
+
We && O?.terminatedAt && /* @__PURE__ */ R("div", {
|
|
183
183
|
className: "rounded-card border border-status-error-border bg-status-error-bg-subtle p-4 text-sm text-status-error-text",
|
|
184
|
-
children: [/* @__PURE__ */
|
|
184
|
+
children: [/* @__PURE__ */ R("p", {
|
|
185
185
|
className: "font-medium",
|
|
186
186
|
children: [
|
|
187
187
|
"This driver was dismissed on ",
|
|
188
|
-
|
|
188
|
+
p(O.terminatedAt, "full"),
|
|
189
189
|
"."
|
|
190
190
|
]
|
|
191
|
-
}),
|
|
191
|
+
}), O.terminationReason && /* @__PURE__ */ R("p", {
|
|
192
192
|
className: "mt-1",
|
|
193
|
-
children: ["Reason: ",
|
|
193
|
+
children: ["Reason: ", O.terminationReason]
|
|
194
194
|
})]
|
|
195
195
|
}),
|
|
196
|
-
/* @__PURE__ */
|
|
196
|
+
/* @__PURE__ */ R("form", {
|
|
197
197
|
onSubmit: Ve,
|
|
198
198
|
className: "max-w-3xl space-y-6",
|
|
199
199
|
children: [
|
|
200
|
-
/* @__PURE__ */
|
|
201
|
-
/* @__PURE__ */
|
|
200
|
+
/* @__PURE__ */ L(M, { message: me }),
|
|
201
|
+
/* @__PURE__ */ R(ge, { children: [/* @__PURE__ */ L("h2", {
|
|
202
202
|
className: "text-base font-semibold text-text-primary mb-4",
|
|
203
203
|
children: "Driver Details"
|
|
204
|
-
}), /* @__PURE__ */
|
|
204
|
+
}), /* @__PURE__ */ R("div", {
|
|
205
205
|
className: "space-y-4",
|
|
206
206
|
children: [
|
|
207
|
-
/* @__PURE__ */
|
|
207
|
+
/* @__PURE__ */ R("div", {
|
|
208
208
|
className: "grid grid-cols-1 md:grid-cols-3 gap-4",
|
|
209
209
|
children: [
|
|
210
|
-
/* @__PURE__ */
|
|
210
|
+
/* @__PURE__ */ R("div", {
|
|
211
211
|
className: "space-y-2",
|
|
212
|
-
children: [/* @__PURE__ */
|
|
212
|
+
children: [/* @__PURE__ */ R(S, {
|
|
213
213
|
htmlFor: "employeeId",
|
|
214
214
|
children: [
|
|
215
215
|
"Employee ID ",
|
|
216
216
|
A ? "(immutable)" : "",
|
|
217
217
|
" ",
|
|
218
|
-
/* @__PURE__ */
|
|
218
|
+
/* @__PURE__ */ L("span", {
|
|
219
219
|
className: "text-status-error-text",
|
|
220
220
|
children: !A && "*"
|
|
221
221
|
})
|
|
222
222
|
]
|
|
223
|
-
}), /* @__PURE__ */
|
|
223
|
+
}), /* @__PURE__ */ L(x, {
|
|
224
224
|
id: "employeeId",
|
|
225
|
-
value:
|
|
226
|
-
onChange: (e) =>
|
|
225
|
+
value: j.employeeId,
|
|
226
|
+
onChange: (e) => N((t) => ({
|
|
227
227
|
...t,
|
|
228
228
|
employeeId: e.target.value
|
|
229
229
|
})),
|
|
@@ -232,18 +232,18 @@ function K({ editId: t }) {
|
|
|
232
232
|
disabled: A
|
|
233
233
|
})]
|
|
234
234
|
}),
|
|
235
|
-
/* @__PURE__ */
|
|
235
|
+
/* @__PURE__ */ R("div", {
|
|
236
236
|
className: "space-y-2",
|
|
237
|
-
children: [/* @__PURE__ */
|
|
237
|
+
children: [/* @__PURE__ */ R(S, {
|
|
238
238
|
htmlFor: "firstName",
|
|
239
|
-
children: ["First Name ", /* @__PURE__ */
|
|
239
|
+
children: ["First Name ", /* @__PURE__ */ L("span", {
|
|
240
240
|
className: "text-status-error-text",
|
|
241
241
|
children: "*"
|
|
242
242
|
})]
|
|
243
|
-
}), /* @__PURE__ */
|
|
243
|
+
}), /* @__PURE__ */ L(x, {
|
|
244
244
|
id: "firstName",
|
|
245
|
-
value:
|
|
246
|
-
onChange: (e) =>
|
|
245
|
+
value: j.firstName,
|
|
246
|
+
onChange: (e) => N((t) => ({
|
|
247
247
|
...t,
|
|
248
248
|
firstName: e.target.value
|
|
249
249
|
})),
|
|
@@ -251,18 +251,18 @@ function K({ editId: t }) {
|
|
|
251
251
|
required: !0
|
|
252
252
|
})]
|
|
253
253
|
}),
|
|
254
|
-
/* @__PURE__ */
|
|
254
|
+
/* @__PURE__ */ R("div", {
|
|
255
255
|
className: "space-y-2",
|
|
256
|
-
children: [/* @__PURE__ */
|
|
256
|
+
children: [/* @__PURE__ */ R(S, {
|
|
257
257
|
htmlFor: "lastName",
|
|
258
|
-
children: ["Last Name ", /* @__PURE__ */
|
|
258
|
+
children: ["Last Name ", /* @__PURE__ */ L("span", {
|
|
259
259
|
className: "text-status-error-text",
|
|
260
260
|
children: "*"
|
|
261
261
|
})]
|
|
262
|
-
}), /* @__PURE__ */
|
|
262
|
+
}), /* @__PURE__ */ L(x, {
|
|
263
263
|
id: "lastName",
|
|
264
|
-
value:
|
|
265
|
-
onChange: (e) =>
|
|
264
|
+
value: j.lastName,
|
|
265
|
+
onChange: (e) => N((t) => ({
|
|
266
266
|
...t,
|
|
267
267
|
lastName: e.target.value
|
|
268
268
|
})),
|
|
@@ -272,37 +272,37 @@ function K({ editId: t }) {
|
|
|
272
272
|
})
|
|
273
273
|
]
|
|
274
274
|
}),
|
|
275
|
-
/* @__PURE__ */
|
|
275
|
+
/* @__PURE__ */ R("div", {
|
|
276
276
|
className: "grid grid-cols-1 md:grid-cols-3 gap-4",
|
|
277
277
|
children: [
|
|
278
|
-
/* @__PURE__ */
|
|
278
|
+
/* @__PURE__ */ R("div", {
|
|
279
279
|
className: "space-y-2",
|
|
280
|
-
children: [/* @__PURE__ */
|
|
280
|
+
children: [/* @__PURE__ */ L(S, {
|
|
281
281
|
htmlFor: "email",
|
|
282
282
|
children: "Email"
|
|
283
|
-
}), /* @__PURE__ */
|
|
283
|
+
}), /* @__PURE__ */ L(x, {
|
|
284
284
|
id: "email",
|
|
285
285
|
type: "email",
|
|
286
|
-
value:
|
|
287
|
-
onChange: (e) =>
|
|
286
|
+
value: j.email,
|
|
287
|
+
onChange: (e) => N((t) => ({
|
|
288
288
|
...t,
|
|
289
289
|
email: e.target.value
|
|
290
290
|
})),
|
|
291
291
|
placeholder: "jane.doe@example.com"
|
|
292
292
|
})]
|
|
293
293
|
}),
|
|
294
|
-
/* @__PURE__ */
|
|
294
|
+
/* @__PURE__ */ R("div", {
|
|
295
295
|
className: "space-y-2",
|
|
296
|
-
children: [/* @__PURE__ */
|
|
296
|
+
children: [/* @__PURE__ */ R(S, {
|
|
297
297
|
htmlFor: "phone",
|
|
298
|
-
children: ["Phone ", /* @__PURE__ */
|
|
298
|
+
children: ["Phone ", /* @__PURE__ */ L("span", {
|
|
299
299
|
className: "text-status-error-text",
|
|
300
300
|
children: "*"
|
|
301
301
|
})]
|
|
302
|
-
}), /* @__PURE__ */
|
|
302
|
+
}), /* @__PURE__ */ L(x, {
|
|
303
303
|
id: "phone",
|
|
304
|
-
value:
|
|
305
|
-
onChange: (e) =>
|
|
304
|
+
value: j.phone,
|
|
305
|
+
onChange: (e) => N((t) => ({
|
|
306
306
|
...t,
|
|
307
307
|
phone: e.target.value
|
|
308
308
|
})),
|
|
@@ -310,21 +310,21 @@ function K({ editId: t }) {
|
|
|
310
310
|
required: !0
|
|
311
311
|
})]
|
|
312
312
|
}),
|
|
313
|
-
/* @__PURE__ */
|
|
313
|
+
/* @__PURE__ */ R("div", {
|
|
314
314
|
className: "space-y-2",
|
|
315
|
-
children: [/* @__PURE__ */
|
|
315
|
+
children: [/* @__PURE__ */ L(S, {
|
|
316
316
|
htmlFor: "status",
|
|
317
317
|
children: "Status"
|
|
318
|
-
}), /* @__PURE__ */
|
|
319
|
-
value:
|
|
320
|
-
onValueChange: (e) =>
|
|
318
|
+
}), /* @__PURE__ */ R(C, {
|
|
319
|
+
value: j.status,
|
|
320
|
+
onValueChange: (e) => N((t) => ({
|
|
321
321
|
...t,
|
|
322
322
|
status: e
|
|
323
323
|
})),
|
|
324
|
-
children: [/* @__PURE__ */
|
|
324
|
+
children: [/* @__PURE__ */ L(T, {
|
|
325
325
|
id: "status",
|
|
326
|
-
children: /* @__PURE__ */
|
|
327
|
-
}), /* @__PURE__ */
|
|
326
|
+
children: /* @__PURE__ */ L(E, {})
|
|
327
|
+
}), /* @__PURE__ */ L(oe, { children: ye.map((e) => /* @__PURE__ */ L(w, {
|
|
328
328
|
value: e.value,
|
|
329
329
|
children: e.label
|
|
330
330
|
}, e.value)) })]
|
|
@@ -332,71 +332,71 @@ function K({ editId: t }) {
|
|
|
332
332
|
})
|
|
333
333
|
]
|
|
334
334
|
}),
|
|
335
|
-
/* @__PURE__ */
|
|
335
|
+
/* @__PURE__ */ R("div", {
|
|
336
336
|
className: "grid grid-cols-1 md:grid-cols-3 gap-4",
|
|
337
337
|
children: [
|
|
338
|
-
/* @__PURE__ */
|
|
338
|
+
/* @__PURE__ */ R("div", {
|
|
339
339
|
className: "space-y-2",
|
|
340
|
-
children: [/* @__PURE__ */
|
|
340
|
+
children: [/* @__PURE__ */ L(S, {
|
|
341
341
|
htmlFor: "licenseNumber",
|
|
342
342
|
children: "License Number"
|
|
343
|
-
}), /* @__PURE__ */
|
|
343
|
+
}), /* @__PURE__ */ L(x, {
|
|
344
344
|
id: "licenseNumber",
|
|
345
|
-
value:
|
|
346
|
-
onChange: (e) =>
|
|
345
|
+
value: j.licenseNumber,
|
|
346
|
+
onChange: (e) => N((t) => ({
|
|
347
347
|
...t,
|
|
348
348
|
licenseNumber: e.target.value
|
|
349
349
|
})),
|
|
350
350
|
placeholder: "D1234567"
|
|
351
351
|
})]
|
|
352
352
|
}),
|
|
353
|
-
/* @__PURE__ */
|
|
353
|
+
/* @__PURE__ */ R("div", {
|
|
354
354
|
className: "space-y-2",
|
|
355
|
-
children: [/* @__PURE__ */
|
|
355
|
+
children: [/* @__PURE__ */ L(S, {
|
|
356
356
|
htmlFor: "licenseClass",
|
|
357
357
|
children: "License Class"
|
|
358
|
-
}), /* @__PURE__ */
|
|
358
|
+
}), /* @__PURE__ */ L(x, {
|
|
359
359
|
id: "licenseClass",
|
|
360
|
-
value:
|
|
361
|
-
onChange: (e) =>
|
|
360
|
+
value: j.licenseClass,
|
|
361
|
+
onChange: (e) => N((t) => ({
|
|
362
362
|
...t,
|
|
363
363
|
licenseClass: e.target.value
|
|
364
364
|
})),
|
|
365
365
|
placeholder: "Class A"
|
|
366
366
|
})]
|
|
367
367
|
}),
|
|
368
|
-
/* @__PURE__ */
|
|
368
|
+
/* @__PURE__ */ R("div", {
|
|
369
369
|
className: "space-y-2 md:col-span-3",
|
|
370
370
|
children: [
|
|
371
|
-
/* @__PURE__ */
|
|
371
|
+
/* @__PURE__ */ R("div", {
|
|
372
372
|
className: "flex items-center justify-between gap-2",
|
|
373
|
-
children: [/* @__PURE__ */
|
|
373
|
+
children: [/* @__PURE__ */ L(S, {
|
|
374
374
|
htmlFor: "licenseExpiry",
|
|
375
375
|
children: "Licence expiry (UTC)"
|
|
376
|
-
}),
|
|
376
|
+
}), j.licenseExpiry && /* @__PURE__ */ L(g, {
|
|
377
377
|
type: "button",
|
|
378
378
|
variant: "ghost",
|
|
379
379
|
size: "sm",
|
|
380
380
|
"aria-label": "Clear recorded licence expiry",
|
|
381
|
-
onClick: () =>
|
|
381
|
+
onClick: () => N((e) => ({
|
|
382
382
|
...e,
|
|
383
383
|
licenseExpiry: ""
|
|
384
384
|
})),
|
|
385
385
|
children: "Clear"
|
|
386
386
|
})]
|
|
387
387
|
}),
|
|
388
|
-
/* @__PURE__ */
|
|
388
|
+
/* @__PURE__ */ L(x, {
|
|
389
389
|
id: "licenseExpiry",
|
|
390
390
|
type: "datetime-local",
|
|
391
391
|
step: "0.001",
|
|
392
392
|
"aria-describedby": "licenseExpiryHelp",
|
|
393
|
-
value:
|
|
394
|
-
onChange: (e) =>
|
|
393
|
+
value: j.licenseExpiry,
|
|
394
|
+
onChange: (e) => N((t) => ({
|
|
395
395
|
...t,
|
|
396
396
|
licenseExpiry: e.target.value
|
|
397
397
|
}))
|
|
398
398
|
}),
|
|
399
|
-
/* @__PURE__ */
|
|
399
|
+
/* @__PURE__ */ L("p", {
|
|
400
400
|
id: "licenseExpiryHelp",
|
|
401
401
|
className: "text-xs text-text-secondary",
|
|
402
402
|
children: "Enter the recorded UTC time. Blank means expiry not recorded; clearing removes it. A recorded expiry does not certify legal driving eligibility."
|
|
@@ -405,28 +405,28 @@ function K({ editId: t }) {
|
|
|
405
405
|
})
|
|
406
406
|
]
|
|
407
407
|
}),
|
|
408
|
-
/* @__PURE__ */
|
|
408
|
+
/* @__PURE__ */ R("div", {
|
|
409
409
|
className: "grid grid-cols-1 md:grid-cols-2 gap-4",
|
|
410
|
-
children: [/* @__PURE__ */
|
|
410
|
+
children: [/* @__PURE__ */ R("div", {
|
|
411
411
|
className: "space-y-2",
|
|
412
|
-
children: [/* @__PURE__ */
|
|
412
|
+
children: [/* @__PURE__ */ L(S, {
|
|
413
413
|
htmlFor: "vehicleSearch",
|
|
414
414
|
children: "Search vehicles"
|
|
415
|
-
}), /* @__PURE__ */
|
|
415
|
+
}), /* @__PURE__ */ L(x, {
|
|
416
416
|
id: "vehicleSearch",
|
|
417
417
|
value: ke,
|
|
418
418
|
onChange: (e) => Ae(e.target.value),
|
|
419
419
|
placeholder: "Vehicle number or type"
|
|
420
420
|
})]
|
|
421
|
-
}), /* @__PURE__ */
|
|
421
|
+
}), /* @__PURE__ */ R("div", {
|
|
422
422
|
className: "space-y-2",
|
|
423
|
-
children: [/* @__PURE__ */
|
|
423
|
+
children: [/* @__PURE__ */ L(S, {
|
|
424
424
|
htmlFor: "vehicle",
|
|
425
425
|
children: "Assigned Vehicle"
|
|
426
|
-
}), /* @__PURE__ */
|
|
426
|
+
}), /* @__PURE__ */ L(le, {
|
|
427
427
|
id: "vehicle",
|
|
428
|
-
value:
|
|
429
|
-
onChange: (e) =>
|
|
428
|
+
value: j.vehicleId,
|
|
429
|
+
onChange: (e) => N((t) => ({
|
|
430
430
|
...t,
|
|
431
431
|
vehicleId: e,
|
|
432
432
|
vehicleIds: e ? [e] : []
|
|
@@ -435,8 +435,8 @@ function K({ editId: t }) {
|
|
|
435
435
|
loading: Me,
|
|
436
436
|
getId: (e) => e.id,
|
|
437
437
|
getLabel: (e) => `${e.vehicleNumber} (${e.type})`,
|
|
438
|
-
renderOption: (e) => /* @__PURE__ */
|
|
439
|
-
/* @__PURE__ */
|
|
438
|
+
renderOption: (e) => /* @__PURE__ */ R(he, { children: [
|
|
439
|
+
/* @__PURE__ */ L(te, {
|
|
440
440
|
size: 14,
|
|
441
441
|
className: "mr-2 inline text-text-secondary"
|
|
442
442
|
}),
|
|
@@ -456,65 +456,65 @@ function K({ editId: t }) {
|
|
|
456
456
|
})]
|
|
457
457
|
})]
|
|
458
458
|
}),
|
|
459
|
-
/* @__PURE__ */
|
|
459
|
+
/* @__PURE__ */ R("div", {
|
|
460
460
|
className: "grid grid-cols-1 md:grid-cols-3 gap-4",
|
|
461
461
|
children: [
|
|
462
|
-
/* @__PURE__ */
|
|
462
|
+
/* @__PURE__ */ R("div", {
|
|
463
463
|
className: "space-y-2",
|
|
464
|
-
children: [/* @__PURE__ */
|
|
464
|
+
children: [/* @__PURE__ */ L(S, {
|
|
465
465
|
htmlFor: "rating",
|
|
466
466
|
children: "Rating (0–5)"
|
|
467
|
-
}), /* @__PURE__ */
|
|
467
|
+
}), /* @__PURE__ */ L(x, {
|
|
468
468
|
id: "rating",
|
|
469
469
|
type: "number",
|
|
470
470
|
min: 0,
|
|
471
471
|
max: 5,
|
|
472
472
|
step: .1,
|
|
473
|
-
value:
|
|
474
|
-
onChange: (e) =>
|
|
473
|
+
value: j.rating,
|
|
474
|
+
onChange: (e) => N((t) => ({
|
|
475
475
|
...t,
|
|
476
476
|
rating: e.target.value
|
|
477
477
|
})),
|
|
478
478
|
placeholder: "4.8"
|
|
479
479
|
})]
|
|
480
480
|
}),
|
|
481
|
-
/* @__PURE__ */
|
|
481
|
+
/* @__PURE__ */ R("div", {
|
|
482
482
|
className: "space-y-2",
|
|
483
|
-
children: [/* @__PURE__ */
|
|
483
|
+
children: [/* @__PURE__ */ L(S, {
|
|
484
484
|
htmlFor: "hireDate",
|
|
485
485
|
children: "Hire Date"
|
|
486
|
-
}), /* @__PURE__ */
|
|
486
|
+
}), /* @__PURE__ */ L(x, {
|
|
487
487
|
id: "hireDate",
|
|
488
488
|
type: "date",
|
|
489
|
-
value:
|
|
490
|
-
onChange: (e) =>
|
|
489
|
+
value: j.hireDate,
|
|
490
|
+
onChange: (e) => N((t) => ({
|
|
491
491
|
...t,
|
|
492
492
|
hireDate: e.target.value
|
|
493
493
|
}))
|
|
494
494
|
})]
|
|
495
495
|
}),
|
|
496
|
-
/* @__PURE__ */
|
|
496
|
+
/* @__PURE__ */ R("div", {
|
|
497
497
|
className: "space-y-2",
|
|
498
|
-
children: [/* @__PURE__ */
|
|
498
|
+
children: [/* @__PURE__ */ R("div", {
|
|
499
499
|
className: "flex items-center justify-between gap-2",
|
|
500
|
-
children: [/* @__PURE__ */
|
|
500
|
+
children: [/* @__PURE__ */ L(S, {
|
|
501
501
|
htmlFor: "onLeaveUntil",
|
|
502
502
|
children: "On Leave Until"
|
|
503
|
-
}),
|
|
503
|
+
}), j.onLeaveUntil && /* @__PURE__ */ L(g, {
|
|
504
504
|
type: "button",
|
|
505
505
|
variant: "ghost",
|
|
506
506
|
size: "sm",
|
|
507
|
-
onClick: () =>
|
|
507
|
+
onClick: () => N((e) => ({
|
|
508
508
|
...e,
|
|
509
509
|
onLeaveUntil: ""
|
|
510
510
|
})),
|
|
511
511
|
children: "Clear"
|
|
512
512
|
})]
|
|
513
|
-
}), /* @__PURE__ */
|
|
513
|
+
}), /* @__PURE__ */ L(x, {
|
|
514
514
|
id: "onLeaveUntil",
|
|
515
515
|
type: "date",
|
|
516
|
-
value:
|
|
517
|
-
onChange: (e) =>
|
|
516
|
+
value: j.onLeaveUntil,
|
|
517
|
+
onChange: (e) => N((t) => ({
|
|
518
518
|
...t,
|
|
519
519
|
onLeaveUntil: e.target.value
|
|
520
520
|
}))
|
|
@@ -524,57 +524,57 @@ function K({ editId: t }) {
|
|
|
524
524
|
})
|
|
525
525
|
]
|
|
526
526
|
})] }),
|
|
527
|
-
/* @__PURE__ */
|
|
527
|
+
/* @__PURE__ */ R(_, { children: [/* @__PURE__ */ L(y, { children: /* @__PURE__ */ R(b, {
|
|
528
528
|
className: "flex items-center gap-2",
|
|
529
|
-
children: [/* @__PURE__ */
|
|
530
|
-
}) }), /* @__PURE__ */
|
|
529
|
+
children: [/* @__PURE__ */ L(n, { size: 18 }), " Compensation"]
|
|
530
|
+
}) }), /* @__PURE__ */ L(v, { children: /* @__PURE__ */ R("div", {
|
|
531
531
|
className: "grid grid-cols-1 md:grid-cols-3 gap-4",
|
|
532
532
|
children: [
|
|
533
|
-
/* @__PURE__ */
|
|
533
|
+
/* @__PURE__ */ R("div", {
|
|
534
534
|
className: "space-y-2",
|
|
535
|
-
children: [/* @__PURE__ */
|
|
535
|
+
children: [/* @__PURE__ */ L(S, {
|
|
536
536
|
htmlFor: "baseSalary",
|
|
537
537
|
children: "Base Salary (annual)"
|
|
538
|
-
}), /* @__PURE__ */
|
|
538
|
+
}), /* @__PURE__ */ L(x, {
|
|
539
539
|
id: "baseSalary",
|
|
540
540
|
type: "number",
|
|
541
541
|
min: 0,
|
|
542
542
|
step: .01,
|
|
543
|
-
value:
|
|
544
|
-
onChange: (e) =>
|
|
543
|
+
value: j.baseSalary,
|
|
544
|
+
onChange: (e) => N((t) => ({
|
|
545
545
|
...t,
|
|
546
546
|
baseSalary: e.target.value
|
|
547
547
|
})),
|
|
548
548
|
placeholder: "55000"
|
|
549
549
|
})]
|
|
550
550
|
}),
|
|
551
|
-
/* @__PURE__ */
|
|
551
|
+
/* @__PURE__ */ R("div", {
|
|
552
552
|
className: "space-y-2",
|
|
553
|
-
children: [/* @__PURE__ */
|
|
553
|
+
children: [/* @__PURE__ */ L(S, {
|
|
554
554
|
htmlFor: "bonusYtd",
|
|
555
555
|
children: "Bonus (YTD)"
|
|
556
|
-
}), /* @__PURE__ */
|
|
556
|
+
}), /* @__PURE__ */ L(x, {
|
|
557
557
|
id: "bonusYtd",
|
|
558
558
|
type: "number",
|
|
559
559
|
min: 0,
|
|
560
560
|
step: .01,
|
|
561
|
-
value:
|
|
562
|
-
onChange: (e) =>
|
|
561
|
+
value: j.bonusYtd,
|
|
562
|
+
onChange: (e) => N((t) => ({
|
|
563
563
|
...t,
|
|
564
564
|
bonusYtd: e.target.value
|
|
565
565
|
})),
|
|
566
566
|
placeholder: "1200"
|
|
567
567
|
})]
|
|
568
568
|
}),
|
|
569
|
-
/* @__PURE__ */
|
|
569
|
+
/* @__PURE__ */ R("div", {
|
|
570
570
|
className: "space-y-2",
|
|
571
|
-
children: [/* @__PURE__ */
|
|
571
|
+
children: [/* @__PURE__ */ L(S, {
|
|
572
572
|
htmlFor: "payCurrency",
|
|
573
573
|
children: "Currency"
|
|
574
|
-
}), /* @__PURE__ */
|
|
574
|
+
}), /* @__PURE__ */ L(x, {
|
|
575
575
|
id: "payCurrency",
|
|
576
|
-
value:
|
|
577
|
-
onChange: (e) =>
|
|
576
|
+
value: j.payCurrency,
|
|
577
|
+
onChange: (e) => N((t) => ({
|
|
578
578
|
...t,
|
|
579
579
|
payCurrency: e.target.value
|
|
580
580
|
})),
|
|
@@ -584,71 +584,71 @@ function K({ editId: t }) {
|
|
|
584
584
|
})
|
|
585
585
|
]
|
|
586
586
|
}) })] }),
|
|
587
|
-
/* @__PURE__ */
|
|
587
|
+
/* @__PURE__ */ R(_, { children: [/* @__PURE__ */ L(y, { children: /* @__PURE__ */ R(b, {
|
|
588
588
|
className: "flex items-center gap-2",
|
|
589
|
-
children: [/* @__PURE__ */
|
|
590
|
-
}) }), /* @__PURE__ */
|
|
591
|
-
value:
|
|
592
|
-
onChange: (e) =>
|
|
589
|
+
children: [/* @__PURE__ */ L(ee, { size: 18 }), " HR Notes"]
|
|
590
|
+
}) }), /* @__PURE__ */ L(v, { children: /* @__PURE__ */ L(D, {
|
|
591
|
+
value: j.notes,
|
|
592
|
+
onChange: (e) => N((t) => ({
|
|
593
593
|
...t,
|
|
594
594
|
notes: e.target.value
|
|
595
595
|
})),
|
|
596
596
|
placeholder: "Performance notes, disciplinary history, anything worth tracking for this driver...",
|
|
597
597
|
rows: 4
|
|
598
598
|
}) })] }),
|
|
599
|
-
A && !We && /* @__PURE__ */
|
|
599
|
+
A && !We && /* @__PURE__ */ R(_, {
|
|
600
600
|
className: "border-status-error-border",
|
|
601
|
-
children: [/* @__PURE__ */
|
|
601
|
+
children: [/* @__PURE__ */ L(y, { children: /* @__PURE__ */ R(b, {
|
|
602
602
|
className: "flex items-center gap-2 text-status-error-text",
|
|
603
|
-
children: [/* @__PURE__ */
|
|
604
|
-
}) }), /* @__PURE__ */
|
|
603
|
+
children: [/* @__PURE__ */ L(l, { size: 18 }), " Dismiss Driver"]
|
|
604
|
+
}) }), /* @__PURE__ */ R(v, { children: [/* @__PURE__ */ L("p", {
|
|
605
605
|
className: "mb-3 text-sm text-text-secondary",
|
|
606
606
|
children: "Dismissing a driver marks them as no longer employed. Their delivery and route history stays visible; they can no longer be assigned new work. This cannot be undone from here."
|
|
607
|
-
}), /* @__PURE__ */
|
|
607
|
+
}), /* @__PURE__ */ R(g, {
|
|
608
608
|
type: "button",
|
|
609
609
|
variant: "outline",
|
|
610
610
|
className: "border-status-error-border text-status-error-text hover:bg-status-error-bg-subtle",
|
|
611
|
-
onClick: () =>
|
|
612
|
-
children: [/* @__PURE__ */
|
|
611
|
+
onClick: () => K(!0),
|
|
612
|
+
children: [/* @__PURE__ */ L(l, { size: 16 }), " Dismiss this driver"]
|
|
613
613
|
})] })]
|
|
614
614
|
}),
|
|
615
|
-
A && /* @__PURE__ */
|
|
615
|
+
A && /* @__PURE__ */ R(_, {
|
|
616
616
|
className: "border-status-error-border",
|
|
617
|
-
children: [/* @__PURE__ */
|
|
617
|
+
children: [/* @__PURE__ */ L(y, { children: /* @__PURE__ */ R(b, {
|
|
618
618
|
className: "flex items-center gap-2 text-status-error-text",
|
|
619
|
-
children: [/* @__PURE__ */
|
|
620
|
-
}) }), /* @__PURE__ */
|
|
619
|
+
children: [/* @__PURE__ */ L(c, { size: 18 }), " Delete Driver"]
|
|
620
|
+
}) }), /* @__PURE__ */ R(v, { children: [/* @__PURE__ */ L("p", {
|
|
621
621
|
className: "mb-3 text-sm text-text-secondary",
|
|
622
622
|
children: "Removes this driver record, for example one entered by mistake, and unlinks them from any vehicle. To keep delivery history for someone who has left, dismiss them instead. This cannot be undone from here."
|
|
623
|
-
}), /* @__PURE__ */
|
|
623
|
+
}), /* @__PURE__ */ R(g, {
|
|
624
624
|
type: "button",
|
|
625
625
|
variant: "outline",
|
|
626
626
|
className: "border-status-error-border text-status-error-text hover:bg-status-error-bg-subtle",
|
|
627
627
|
onClick: () => Z(!0),
|
|
628
|
-
children: [/* @__PURE__ */
|
|
628
|
+
children: [/* @__PURE__ */ L(c, { size: 16 }), " Delete this driver"]
|
|
629
629
|
})] })]
|
|
630
630
|
})
|
|
631
631
|
]
|
|
632
632
|
}),
|
|
633
|
-
/* @__PURE__ */
|
|
633
|
+
/* @__PURE__ */ L(V, {
|
|
634
634
|
open: Te,
|
|
635
635
|
onOpenChange: Z,
|
|
636
|
-
children: /* @__PURE__ */
|
|
637
|
-
/* @__PURE__ */
|
|
636
|
+
children: /* @__PURE__ */ R(H, { children: [
|
|
637
|
+
/* @__PURE__ */ R(_e, { children: [/* @__PURE__ */ L(ve, { children: "Delete this driver?" }), /* @__PURE__ */ R(U, { children: [
|
|
638
638
|
"This removes ",
|
|
639
|
-
`${
|
|
639
|
+
`${j.firstName} ${j.lastName}`.trim() || "this driver",
|
|
640
640
|
" and unlinks them from any vehicle. It cannot be undone from here."
|
|
641
641
|
] })] }),
|
|
642
|
-
/* @__PURE__ */
|
|
642
|
+
/* @__PURE__ */ L("div", {
|
|
643
643
|
className: "px-1",
|
|
644
|
-
children: /* @__PURE__ */
|
|
644
|
+
children: /* @__PURE__ */ L(M, { message: De })
|
|
645
645
|
}),
|
|
646
|
-
/* @__PURE__ */
|
|
646
|
+
/* @__PURE__ */ R(W, { children: [/* @__PURE__ */ L(g, {
|
|
647
647
|
variant: "outline",
|
|
648
648
|
onClick: () => Z(!1),
|
|
649
649
|
disabled: Q,
|
|
650
650
|
children: "Cancel"
|
|
651
|
-
}), /* @__PURE__ */
|
|
651
|
+
}), /* @__PURE__ */ L(g, {
|
|
652
652
|
className: "bg-status-error-text text-text-inverse hover:opacity-90",
|
|
653
653
|
onClick: Ue,
|
|
654
654
|
disabled: Q,
|
|
@@ -656,82 +656,82 @@ function K({ editId: t }) {
|
|
|
656
656
|
})] })
|
|
657
657
|
] })
|
|
658
658
|
}),
|
|
659
|
-
/* @__PURE__ */
|
|
660
|
-
open:
|
|
661
|
-
onOpenChange:
|
|
662
|
-
children: /* @__PURE__ */
|
|
663
|
-
/* @__PURE__ */
|
|
664
|
-
/* @__PURE__ */
|
|
659
|
+
/* @__PURE__ */ L(V, {
|
|
660
|
+
open: G,
|
|
661
|
+
onOpenChange: K,
|
|
662
|
+
children: /* @__PURE__ */ R(H, { children: [
|
|
663
|
+
/* @__PURE__ */ R(_e, { children: [/* @__PURE__ */ L(ve, { children: "Dismiss this driver?" }), /* @__PURE__ */ L(U, { children: "This records the driver as dismissed and requires a reason. It cannot be undone from here." })] }),
|
|
664
|
+
/* @__PURE__ */ R("div", {
|
|
665
665
|
className: "space-y-2 px-1",
|
|
666
666
|
children: [
|
|
667
|
-
/* @__PURE__ */
|
|
667
|
+
/* @__PURE__ */ R(S, {
|
|
668
668
|
htmlFor: "dismissReason",
|
|
669
|
-
children: ["Reason ", /* @__PURE__ */
|
|
669
|
+
children: ["Reason ", /* @__PURE__ */ L("span", {
|
|
670
670
|
className: "text-status-error-text",
|
|
671
671
|
children: "*"
|
|
672
672
|
})]
|
|
673
673
|
}),
|
|
674
|
-
/* @__PURE__ */
|
|
674
|
+
/* @__PURE__ */ L(D, {
|
|
675
675
|
id: "dismissReason",
|
|
676
|
-
value:
|
|
677
|
-
onChange: (e) =>
|
|
676
|
+
value: q,
|
|
677
|
+
onChange: (e) => Ce(e.target.value),
|
|
678
678
|
placeholder: "e.g. Repeated policy violations, voluntary resignation, performance...",
|
|
679
679
|
rows: 3
|
|
680
680
|
}),
|
|
681
|
-
/* @__PURE__ */
|
|
681
|
+
/* @__PURE__ */ L(M, { message: we })
|
|
682
682
|
]
|
|
683
683
|
}),
|
|
684
|
-
/* @__PURE__ */
|
|
684
|
+
/* @__PURE__ */ R(W, { children: [/* @__PURE__ */ L(g, {
|
|
685
685
|
variant: "outline",
|
|
686
|
-
onClick: () =>
|
|
687
|
-
disabled:
|
|
686
|
+
onClick: () => K(!1),
|
|
687
|
+
disabled: J,
|
|
688
688
|
children: "Cancel"
|
|
689
|
-
}), /* @__PURE__ */
|
|
689
|
+
}), /* @__PURE__ */ L(g, {
|
|
690
690
|
className: "bg-status-error-text text-text-inverse hover:opacity-90",
|
|
691
691
|
onClick: He,
|
|
692
|
-
disabled:
|
|
693
|
-
children:
|
|
692
|
+
disabled: J,
|
|
693
|
+
children: J ? "Dismissing..." : "Confirm dismissal"
|
|
694
694
|
})] })
|
|
695
695
|
] })
|
|
696
696
|
})
|
|
697
697
|
]
|
|
698
698
|
});
|
|
699
699
|
}
|
|
700
|
-
function
|
|
701
|
-
let { driverId: a } =
|
|
702
|
-
|
|
703
|
-
let { vehicle:
|
|
704
|
-
if (!a) return /* @__PURE__ */
|
|
705
|
-
if (c) return /* @__PURE__ */
|
|
706
|
-
if (
|
|
707
|
-
if (
|
|
700
|
+
function K() {
|
|
701
|
+
let { driverId: a } = me(), c = I().pathname.endsWith("/edit"), { basePath: l, navigate: m } = ne(), { driver: h, isLoading: ae, error: x, refetch: S } = re(a);
|
|
702
|
+
P(c, S);
|
|
703
|
+
let { vehicle: C } = ie(h?.assignedVehicle), oe = () => m?.(d(l, "fleet/drivers")), w = (e) => m?.(d(l, e));
|
|
704
|
+
if (!a) return /* @__PURE__ */ L(G, {});
|
|
705
|
+
if (c) return /* @__PURE__ */ L(G, { editId: a });
|
|
706
|
+
if (ae) return /* @__PURE__ */ L(k, { message: "Loading driver details..." });
|
|
707
|
+
if (x || !h) return /* @__PURE__ */ L(O, {
|
|
708
708
|
title: "Driver not found",
|
|
709
|
-
onRetry:
|
|
709
|
+
onRetry: S
|
|
710
710
|
});
|
|
711
|
-
let
|
|
712
|
-
return /* @__PURE__ */
|
|
713
|
-
title:
|
|
714
|
-
subtitle: `Employee ID: ${
|
|
715
|
-
icon: /* @__PURE__ */
|
|
716
|
-
headerActions: /* @__PURE__ */
|
|
711
|
+
let T = !!h.terminatedAt, E = h.onLeaveUntil && h.onLeaveUntil.getTime() > (/* @__PURE__ */ new Date()).getTime() ? h.onLeaveUntil : void 0, D = h.baseSalary !== void 0 || h.bonusYtd !== void 0;
|
|
712
|
+
return /* @__PURE__ */ R(se, {
|
|
713
|
+
title: h.fullName,
|
|
714
|
+
subtitle: `Employee ID: ${h.employeeId}`,
|
|
715
|
+
icon: /* @__PURE__ */ L(u, { size: 24 }),
|
|
716
|
+
headerActions: /* @__PURE__ */ R("div", {
|
|
717
717
|
className: "flex gap-2",
|
|
718
|
-
children: [/* @__PURE__ */
|
|
718
|
+
children: [/* @__PURE__ */ R(g, {
|
|
719
719
|
variant: "outline",
|
|
720
|
-
onClick:
|
|
721
|
-
children: [/* @__PURE__ */
|
|
722
|
-
}), /* @__PURE__ */
|
|
723
|
-
onClick: () =>
|
|
724
|
-
children: [/* @__PURE__ */
|
|
720
|
+
onClick: oe,
|
|
721
|
+
children: [/* @__PURE__ */ L(e, { size: 16 }), " Back"]
|
|
722
|
+
}), /* @__PURE__ */ R(g, {
|
|
723
|
+
onClick: () => m?.(d(l, "fleet/drivers/" + a + "/edit")),
|
|
724
|
+
children: [/* @__PURE__ */ L(o, { size: 16 }), " Edit"]
|
|
725
725
|
})]
|
|
726
726
|
}),
|
|
727
|
-
headerContent: /* @__PURE__ */
|
|
727
|
+
headerContent: /* @__PURE__ */ R("div", {
|
|
728
728
|
className: "flex flex-wrap items-center gap-4",
|
|
729
729
|
children: [
|
|
730
|
-
/* @__PURE__ */
|
|
731
|
-
status:
|
|
730
|
+
/* @__PURE__ */ L(j, {
|
|
731
|
+
status: h.status,
|
|
732
732
|
type: "driver"
|
|
733
733
|
}),
|
|
734
|
-
|
|
734
|
+
T && /* @__PURE__ */ L(j, {
|
|
735
735
|
status: "dismissed",
|
|
736
736
|
label: "Dismissed",
|
|
737
737
|
customColors: {
|
|
@@ -739,168 +739,168 @@ function q() {
|
|
|
739
739
|
text: "text-status-error-text"
|
|
740
740
|
}
|
|
741
741
|
}),
|
|
742
|
-
|
|
742
|
+
E && !T && /* @__PURE__ */ L(j, {
|
|
743
743
|
status: "on_leave",
|
|
744
|
-
label: `On leave until ${
|
|
744
|
+
label: `On leave until ${p(E, "short")}`,
|
|
745
745
|
customColors: {
|
|
746
746
|
bg: "bg-status-warning-bg-subtle",
|
|
747
747
|
text: "text-status-warning-text"
|
|
748
748
|
}
|
|
749
749
|
}),
|
|
750
|
-
|
|
750
|
+
h.rating !== void 0 && /* @__PURE__ */ R("div", {
|
|
751
751
|
className: "flex items-center gap-1",
|
|
752
|
-
children: [/* @__PURE__ */
|
|
752
|
+
children: [/* @__PURE__ */ L(s, {
|
|
753
753
|
size: 16,
|
|
754
754
|
className: "text-status-warning-text fill-current"
|
|
755
|
-
}), /* @__PURE__ */
|
|
755
|
+
}), /* @__PURE__ */ L("span", {
|
|
756
756
|
className: "font-medium",
|
|
757
|
-
children:
|
|
757
|
+
children: h.rating.toFixed(1)
|
|
758
758
|
})]
|
|
759
759
|
})
|
|
760
760
|
]
|
|
761
761
|
}),
|
|
762
762
|
children: [
|
|
763
|
-
/* @__PURE__ */
|
|
764
|
-
icon: /* @__PURE__ */
|
|
763
|
+
/* @__PURE__ */ L(B, {
|
|
764
|
+
icon: /* @__PURE__ */ L(u, { size: 18 }),
|
|
765
765
|
children: "Review the recorded licensing, assigned vehicle, documents and HR facts before assignment. These records do not certify legal driving eligibility or duty-hours availability."
|
|
766
766
|
}),
|
|
767
|
-
/* @__PURE__ */
|
|
767
|
+
/* @__PURE__ */ L(z, {
|
|
768
768
|
storageKey: "movethewheels-driver-details",
|
|
769
769
|
steps: [
|
|
770
770
|
{
|
|
771
771
|
id: "assign",
|
|
772
772
|
label: "Assign to an order",
|
|
773
773
|
description: "Hand a pending delivery to this driver.",
|
|
774
|
-
icon: /* @__PURE__ */
|
|
775
|
-
onClick: () =>
|
|
774
|
+
icon: /* @__PURE__ */ L(i, { size: 16 }),
|
|
775
|
+
onClick: () => w("orders")
|
|
776
776
|
},
|
|
777
777
|
{
|
|
778
778
|
id: "routes",
|
|
779
779
|
label: "Plan their route",
|
|
780
780
|
description: "Batch nearby drop-offs into an optimized itinerary.",
|
|
781
|
-
icon: /* @__PURE__ */
|
|
782
|
-
onClick: () =>
|
|
781
|
+
icon: /* @__PURE__ */ L(t, { size: 16 }),
|
|
782
|
+
onClick: () => w("routes")
|
|
783
783
|
},
|
|
784
784
|
{
|
|
785
785
|
id: "edit",
|
|
786
786
|
label: "Update driver record",
|
|
787
787
|
description: "Refresh documents, license or HR details.",
|
|
788
|
-
icon: /* @__PURE__ */
|
|
788
|
+
icon: /* @__PURE__ */ L(o, { size: 16 }),
|
|
789
789
|
onClick: () => {}
|
|
790
790
|
}
|
|
791
791
|
]
|
|
792
792
|
}),
|
|
793
|
-
|
|
793
|
+
T && /* @__PURE__ */ R("div", {
|
|
794
794
|
className: "rounded-card border border-status-error-border bg-status-error-bg-subtle p-4 text-sm text-status-error-text",
|
|
795
|
-
children: [/* @__PURE__ */
|
|
795
|
+
children: [/* @__PURE__ */ R("p", {
|
|
796
796
|
className: "font-medium",
|
|
797
|
-
children: ["Dismissed ",
|
|
798
|
-
}),
|
|
797
|
+
children: ["Dismissed ", h.terminatedAt && p(h.terminatedAt, "full")]
|
|
798
|
+
}), h.terminationReason && /* @__PURE__ */ R("p", {
|
|
799
799
|
className: "mt-1",
|
|
800
|
-
children: ["Reason: ",
|
|
800
|
+
children: ["Reason: ", h.terminationReason]
|
|
801
801
|
})]
|
|
802
802
|
}),
|
|
803
|
-
/* @__PURE__ */
|
|
803
|
+
/* @__PURE__ */ R("div", {
|
|
804
804
|
className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
|
|
805
|
-
children: [/* @__PURE__ */
|
|
805
|
+
children: [/* @__PURE__ */ R("div", {
|
|
806
806
|
className: "lg:col-span-2 space-y-6",
|
|
807
807
|
children: [
|
|
808
|
-
/* @__PURE__ */
|
|
808
|
+
/* @__PURE__ */ R(_, { children: [/* @__PURE__ */ L(y, { children: /* @__PURE__ */ R(b, {
|
|
809
809
|
className: "flex items-center gap-2",
|
|
810
|
-
children: [/* @__PURE__ */
|
|
811
|
-
}) }), /* @__PURE__ */
|
|
810
|
+
children: [/* @__PURE__ */ L(r, { size: 18 }), " License"]
|
|
811
|
+
}) }), /* @__PURE__ */ L(v, { children: /* @__PURE__ */ L("div", {
|
|
812
812
|
className: "flex items-center justify-between p-3 border rounded-lg",
|
|
813
|
-
children: /* @__PURE__ */
|
|
814
|
-
/* @__PURE__ */
|
|
813
|
+
children: /* @__PURE__ */ R("div", { children: [
|
|
814
|
+
/* @__PURE__ */ L("p", {
|
|
815
815
|
className: "font-medium",
|
|
816
816
|
children: "Driver's License"
|
|
817
817
|
}),
|
|
818
|
-
/* @__PURE__ */
|
|
818
|
+
/* @__PURE__ */ R("p", {
|
|
819
819
|
className: "text-sm text-text-secondary",
|
|
820
|
-
children: [
|
|
820
|
+
children: [h.licenseNumber || "—", h.licenseType ? ` - ${h.licenseType}` : ""]
|
|
821
821
|
}),
|
|
822
|
-
/* @__PURE__ */
|
|
822
|
+
/* @__PURE__ */ L("p", {
|
|
823
823
|
className: "text-sm text-text-secondary break-all",
|
|
824
|
-
children:
|
|
824
|
+
children: h.licenseExpiry ? `Recorded expiry (UTC): ${h.licenseExpiry.toISOString()}` : "Expiry not recorded"
|
|
825
825
|
})
|
|
826
826
|
] })
|
|
827
827
|
}) })] }),
|
|
828
|
-
|
|
828
|
+
h.notes && /* @__PURE__ */ R(_, { children: [/* @__PURE__ */ L(y, { children: /* @__PURE__ */ R(b, {
|
|
829
829
|
className: "flex items-center gap-2",
|
|
830
|
-
children: [/* @__PURE__ */
|
|
831
|
-
}) }), /* @__PURE__ */
|
|
830
|
+
children: [/* @__PURE__ */ L(ee, { size: 18 }), " HR Notes"]
|
|
831
|
+
}) }), /* @__PURE__ */ L(v, { children: /* @__PURE__ */ L("p", {
|
|
832
832
|
className: "text-sm whitespace-pre-wrap",
|
|
833
|
-
children:
|
|
833
|
+
children: h.notes
|
|
834
834
|
}) })] }),
|
|
835
|
-
/* @__PURE__ */
|
|
835
|
+
/* @__PURE__ */ L(N, {
|
|
836
836
|
entityType: "driver",
|
|
837
|
-
entityId:
|
|
837
|
+
entityId: h.id
|
|
838
838
|
})
|
|
839
839
|
]
|
|
840
|
-
}), /* @__PURE__ */
|
|
840
|
+
}), /* @__PURE__ */ R("div", {
|
|
841
841
|
className: "space-y-6",
|
|
842
842
|
children: [
|
|
843
|
-
/* @__PURE__ */
|
|
843
|
+
/* @__PURE__ */ R(_, { children: [/* @__PURE__ */ L(y, { children: /* @__PURE__ */ R(b, {
|
|
844
844
|
className: "flex items-center gap-2",
|
|
845
|
-
children: [/* @__PURE__ */
|
|
846
|
-
}) }), /* @__PURE__ */
|
|
845
|
+
children: [/* @__PURE__ */ L(te, { size: 18 }), " Assigned Vehicle"]
|
|
846
|
+
}) }), /* @__PURE__ */ L(v, { children: h.assignedVehicle ? C ? /* @__PURE__ */ R("button", {
|
|
847
847
|
type: "button",
|
|
848
848
|
className: "text-sm font-medium text-primary hover:underline",
|
|
849
|
-
onClick: () =>
|
|
849
|
+
onClick: () => w(`fleet/vehicles/${C.id}`),
|
|
850
850
|
children: [
|
|
851
|
-
|
|
851
|
+
C.vehicleNumber,
|
|
852
852
|
" (",
|
|
853
|
-
|
|
853
|
+
C.type,
|
|
854
854
|
")"
|
|
855
855
|
]
|
|
856
|
-
}) : /* @__PURE__ */
|
|
856
|
+
}) : /* @__PURE__ */ L("p", {
|
|
857
857
|
className: "text-sm text-text-secondary",
|
|
858
858
|
children: "Loading…"
|
|
859
|
-
}) : /* @__PURE__ */
|
|
859
|
+
}) : /* @__PURE__ */ L("p", {
|
|
860
860
|
className: "text-sm text-text-secondary",
|
|
861
861
|
children: "No vehicle assigned"
|
|
862
862
|
}) })] }),
|
|
863
|
-
/* @__PURE__ */
|
|
863
|
+
/* @__PURE__ */ R(_, { children: [/* @__PURE__ */ L(y, { children: /* @__PURE__ */ L(b, { children: "Record" }) }), /* @__PURE__ */ L(v, {
|
|
864
864
|
className: "space-y-4",
|
|
865
|
-
children: /* @__PURE__ */
|
|
865
|
+
children: /* @__PURE__ */ R("div", { children: [/* @__PURE__ */ L("p", {
|
|
866
866
|
className: "text-sm text-text-secondary",
|
|
867
867
|
children: "Hire Date"
|
|
868
|
-
}), /* @__PURE__ */
|
|
868
|
+
}), /* @__PURE__ */ L("p", {
|
|
869
869
|
className: "font-medium",
|
|
870
|
-
children:
|
|
870
|
+
children: h.hireDate ? p(h.hireDate) : "Not recorded"
|
|
871
871
|
})] })
|
|
872
872
|
})] }),
|
|
873
|
-
/* @__PURE__ */
|
|
873
|
+
/* @__PURE__ */ R(_, { children: [/* @__PURE__ */ L(y, { children: /* @__PURE__ */ R(b, {
|
|
874
874
|
className: "flex items-center gap-2",
|
|
875
|
-
children: [/* @__PURE__ */
|
|
876
|
-
}) }), /* @__PURE__ */
|
|
875
|
+
children: [/* @__PURE__ */ L(n, { size: 18 }), " Compensation"]
|
|
876
|
+
}) }), /* @__PURE__ */ L(v, {
|
|
877
877
|
className: "space-y-3",
|
|
878
|
-
children:
|
|
878
|
+
children: D ? /* @__PURE__ */ R(he, { children: [h.baseSalary !== void 0 && /* @__PURE__ */ R("div", { children: [/* @__PURE__ */ L("p", {
|
|
879
879
|
className: "text-sm text-text-secondary",
|
|
880
880
|
children: "Base Salary"
|
|
881
|
-
}), /* @__PURE__ */
|
|
881
|
+
}), /* @__PURE__ */ R("p", {
|
|
882
882
|
className: "font-medium",
|
|
883
|
-
children: [
|
|
884
|
-
})] }),
|
|
883
|
+
children: [f(h.baseSalary, h.payCurrency || void 0), "/year"]
|
|
884
|
+
})] }), h.bonusYtd !== void 0 && /* @__PURE__ */ R("div", { children: [/* @__PURE__ */ L("p", {
|
|
885
885
|
className: "text-sm text-text-secondary",
|
|
886
886
|
children: "Bonus (YTD)"
|
|
887
|
-
}), /* @__PURE__ */
|
|
887
|
+
}), /* @__PURE__ */ L("p", {
|
|
888
888
|
className: "font-medium",
|
|
889
|
-
children:
|
|
890
|
-
})] })] }) : /* @__PURE__ */
|
|
889
|
+
children: f(h.bonusYtd, h.payCurrency || void 0)
|
|
890
|
+
})] })] }) : /* @__PURE__ */ L("p", {
|
|
891
891
|
className: "text-sm text-text-secondary",
|
|
892
892
|
children: "Not recorded"
|
|
893
893
|
})
|
|
894
894
|
})] }),
|
|
895
|
-
|
|
895
|
+
h.currentLocation && /* @__PURE__ */ R(_, { children: [/* @__PURE__ */ L(y, { children: /* @__PURE__ */ R(b, {
|
|
896
896
|
className: "flex items-center gap-2",
|
|
897
|
-
children: [/* @__PURE__ */
|
|
898
|
-
}) }), /* @__PURE__ */
|
|
897
|
+
children: [/* @__PURE__ */ L(i, { size: 18 }), " Current Location"]
|
|
898
|
+
}) }), /* @__PURE__ */ R(v, { children: [/* @__PURE__ */ L("p", {
|
|
899
899
|
className: "text-sm",
|
|
900
|
-
children:
|
|
901
|
-
}), /* @__PURE__ */
|
|
900
|
+
children: h.currentLocation.address || "Location updating..."
|
|
901
|
+
}), /* @__PURE__ */ L("p", {
|
|
902
902
|
className: "text-xs text-text-secondary mt-1",
|
|
903
|
-
children:
|
|
903
|
+
children: h.currentLocation.timestamp ? `Updated ${p(h.currentLocation.timestamp, "relative")}` : "Update time not recorded"
|
|
904
904
|
})] })] })
|
|
905
905
|
]
|
|
906
906
|
})]
|
|
@@ -909,4 +909,4 @@ function q() {
|
|
|
909
909
|
});
|
|
910
910
|
}
|
|
911
911
|
//#endregion
|
|
912
|
-
export {
|
|
912
|
+
export { K as default };
|