@burdenoff/microfe-movethewheels 2026.930.1 → 2026.930.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/hooks/useRefetchOnLeaveEdit.js +10 -0
- package/dist/movethewheels/hooks/useRefetchOnLeaveEdit.d.ts +7 -0
- package/dist/pages/DriverDetailsPage.js +238 -235
- package/dist/pages/ProductDetailsPage.js +22 -19
- package/dist/pages/RouteDetailsPage.js +274 -271
- package/dist/pages/VehicleDetailsPage.js +28 -25
- package/package.json +1 -1
- package/src/movethewheels/hooks/useRefetchOnLeaveEdit.ts +18 -0
- package/src/movethewheels/pages/DriverDetailsPage.tsx +2 -0
- package/src/movethewheels/pages/ProductDetailsPage.tsx +2 -0
- package/src/movethewheels/pages/RouteDetailsPage.tsx +2 -0
- package/src/movethewheels/pages/VehicleDetailsPage.tsx +2 -0
|
@@ -7,13 +7,13 @@ import { Save as a } from "../node_modules/lucide-react/dist/esm/icons/save.js";
|
|
|
7
7
|
import { SquarePen as o } from "../node_modules/lucide-react/dist/esm/icons/square-pen.js";
|
|
8
8
|
import { Star as s } from "../node_modules/lucide-react/dist/esm/icons/star.js";
|
|
9
9
|
import { StickyNote as ee } from "../node_modules/lucide-react/dist/esm/icons/sticky-note.js";
|
|
10
|
-
import { Truck as
|
|
11
|
-
import { UserX as
|
|
12
|
-
import { Users as
|
|
13
|
-
import { joinPath as
|
|
14
|
-
import { useMoveTheWheels as
|
|
15
|
-
import { toApiDriverStatus as
|
|
16
|
-
import { Button as
|
|
10
|
+
import { Truck as te } from "../node_modules/lucide-react/dist/esm/icons/truck.js";
|
|
11
|
+
import { UserX as c } from "../node_modules/lucide-react/dist/esm/icons/user-x.js";
|
|
12
|
+
import { Users as l } from "../node_modules/lucide-react/dist/esm/icons/users.js";
|
|
13
|
+
import { joinPath as u } from "../utils/navigation.js";
|
|
14
|
+
import { useMoveTheWheels as ne } from "../providers/MoveTheWheelsProvider.js";
|
|
15
|
+
import { toApiDriverStatus as d, useDriver as f, useFleet as p, useVehicle as m, useVehicles as h } from "../hooks/useFleet.js";
|
|
16
|
+
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 w, SelectItem as T, SelectTrigger as E, SelectValue as D, Textarea as O } from "../components/ui.js";
|
|
17
17
|
import { ErrorState as k, LoadingState as A, PageLayout as j } from "../components/PageLayout.js";
|
|
18
18
|
import { DRIVER_STATUS_LABELS as M } from "../constants/index.js";
|
|
19
19
|
import { StatusBadge as N } from "../components/StatusBadge.js";
|
|
@@ -22,15 +22,16 @@ import { formatCurrency as F, formatDate as I } from "../utils/formatters.js";
|
|
|
22
22
|
import { DocumentsCard as L } from "../components/DocumentsCard.js";
|
|
23
23
|
import { useDebouncedValue as re } from "../hooks/useDebouncedValue.js";
|
|
24
24
|
import { EntityCombobox as ie } from "../components/EntityCombobox.js";
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
25
|
+
import { useRefetchOnLeaveEdit as R } from "../hooks/useRefetchOnLeaveEdit.js";
|
|
26
|
+
import { useEffect as ae, useState as z } from "react";
|
|
27
|
+
import { useLocation as B, useParams as V } from "react-router";
|
|
28
|
+
import { Fragment as H, jsx as U, jsxs as W } from "react/jsx-runtime";
|
|
29
|
+
import { EmphasisPanel as oe, NextSteps as G, PagePurpose as K, ResponsiveDialog as se, ResponsiveDialogContent as ce, ResponsiveDialogDescription as le, ResponsiveDialogFooter as ue, ResponsiveDialogHeader as de, ResponsiveDialogTitle as fe } from "@burdenoff/fe-libs/ui";
|
|
29
30
|
//#region src/movethewheels/pages/DriverDetailsPage.tsx
|
|
30
|
-
var
|
|
31
|
+
var pe = Object.entries(M).map(([e, t]) => ({
|
|
31
32
|
value: e,
|
|
32
33
|
label: t
|
|
33
|
-
})),
|
|
34
|
+
})), q = (e) => e ? e.toISOString().slice(0, 10) : "", J = (e) => e ? `${e}T12:00:00.000Z` : void 0, me = {
|
|
34
35
|
employeeId: "",
|
|
35
36
|
firstName: "",
|
|
36
37
|
lastName: "",
|
|
@@ -50,11 +51,11 @@ var me = Object.entries(M).map(([e, t]) => ({
|
|
|
50
51
|
payCurrency: "",
|
|
51
52
|
onLeaveUntil: ""
|
|
52
53
|
};
|
|
53
|
-
function
|
|
54
|
-
let { basePath: r, navigate: i } =
|
|
54
|
+
function Y({ editId: t }) {
|
|
55
|
+
let { basePath: r, navigate: i } = ne(), { createDriver: o, updateDriver: s } = p(), { driver: k, refetch: A } = f(t), M = !!t, [N, F] = z(me), [L, R] = z(!1), [B, V] = z(null), [G, Y] = z(!1), [X, he] = z(""), [Z, ge] = z(!1), [_e, Q] = z(null), [ve, ye] = z(""), { vehicles: be, isLoading: xe, isLoadingMore: Se, hasMore: Ce, totalVehicles: we, loadMore: Te } = h({
|
|
55
56
|
limit: 20,
|
|
56
|
-
search: re(
|
|
57
|
-
}), { vehicle: Ee, isLoading: De } =
|
|
57
|
+
search: re(ve) || void 0
|
|
58
|
+
}), { vehicle: Ee, isLoading: De } = m(N.vehicleId || void 0);
|
|
58
59
|
ae(() => {
|
|
59
60
|
if (!t || !k) return;
|
|
60
61
|
let [e, ...n] = k.fullName.trim().split(/\s+/);
|
|
@@ -66,147 +67,147 @@ function q({ editId: t }) {
|
|
|
66
67
|
phone: k.phone || "",
|
|
67
68
|
licenseNumber: k.licenseNumber || "",
|
|
68
69
|
licenseClass: k.licenseType || "",
|
|
69
|
-
licenseExpiry:
|
|
70
|
+
licenseExpiry: q(k.licenseExpiry),
|
|
70
71
|
status: k.status,
|
|
71
72
|
vehicleId: k.assignedVehicle || "",
|
|
72
73
|
vehicleIds: k.vehicleIds,
|
|
73
74
|
rating: k.rating ? String(k.rating) : "",
|
|
74
75
|
notes: k.notes || "",
|
|
75
|
-
hireDate:
|
|
76
|
+
hireDate: q(k.hireDate),
|
|
76
77
|
baseSalary: k.baseSalary === void 0 ? "" : String(k.baseSalary),
|
|
77
78
|
bonusYtd: k.bonusYtd === void 0 ? "" : String(k.bonusYtd),
|
|
78
79
|
payCurrency: k.payCurrency || "",
|
|
79
|
-
onLeaveUntil:
|
|
80
|
+
onLeaveUntil: q(k.onLeaveUntil)
|
|
80
81
|
});
|
|
81
82
|
}, [t, k]);
|
|
82
|
-
let Oe = () => i?.(
|
|
83
|
+
let Oe = () => i?.(u(r, "fleet/drivers")), $ = (e = !0) => ({
|
|
83
84
|
firstName: N.firstName.trim(),
|
|
84
85
|
lastName: N.lastName.trim(),
|
|
85
86
|
email: N.email.trim() || void 0,
|
|
86
87
|
phone: N.phone.trim() || void 0,
|
|
87
88
|
licenseNumber: N.licenseNumber.trim() || void 0,
|
|
88
89
|
licenseClass: N.licenseClass.trim() || void 0,
|
|
89
|
-
licenseExpiry:
|
|
90
|
-
status:
|
|
90
|
+
licenseExpiry: J(N.licenseExpiry),
|
|
91
|
+
status: d(N.status),
|
|
91
92
|
vehicleId: N.vehicleId || null,
|
|
92
93
|
vehicleIds: N.vehicleIds,
|
|
93
94
|
rating: N.rating.trim() ? Number(N.rating) : void 0,
|
|
94
95
|
notes: N.notes.trim() || void 0,
|
|
95
|
-
hireDate:
|
|
96
|
+
hireDate: J(N.hireDate),
|
|
96
97
|
baseSalary: N.baseSalary.trim() ? Number(N.baseSalary) : void 0,
|
|
97
98
|
bonusYtd: N.bonusYtd.trim() ? Number(N.bonusYtd) : void 0,
|
|
98
99
|
payCurrency: N.payCurrency.trim() || void 0,
|
|
99
|
-
...e ? { onLeaveUntil:
|
|
100
|
+
...e ? { onLeaveUntil: J(N.onLeaveUntil) ?? null } : {}
|
|
100
101
|
}), ke = () => ({
|
|
101
102
|
employeeId: N.employeeId.trim(),
|
|
102
103
|
...$(!1)
|
|
103
104
|
}), Ae = async (e) => {
|
|
104
105
|
if (e.preventDefault(), !N.employeeId.trim() || !N.firstName.trim() || !N.lastName.trim()) {
|
|
105
|
-
|
|
106
|
+
V("Employee ID, first name and last name are required.");
|
|
106
107
|
return;
|
|
107
108
|
}
|
|
108
109
|
if (!N.phone.trim()) {
|
|
109
|
-
|
|
110
|
+
V("Phone is required so this driver can be reached.");
|
|
110
111
|
return;
|
|
111
112
|
}
|
|
112
|
-
|
|
113
|
+
R(!0), V(null);
|
|
113
114
|
try {
|
|
114
115
|
if (t) {
|
|
115
116
|
let e = await s(t, $());
|
|
116
|
-
i?.(
|
|
117
|
+
i?.(u(r, `fleet/drivers/${e.id}`));
|
|
117
118
|
} else {
|
|
118
119
|
let e = await o(ke());
|
|
119
|
-
i?.(
|
|
120
|
+
i?.(u(r, `fleet/drivers/${e.id}`));
|
|
120
121
|
}
|
|
121
122
|
} catch (e) {
|
|
122
|
-
console.error("Failed to save driver:", e),
|
|
123
|
+
console.error("Failed to save driver:", e), V(e instanceof Error ? e.message : "Failed to save driver. Please try again."), R(!1);
|
|
123
124
|
}
|
|
124
125
|
}, je = async () => {
|
|
125
|
-
if (!t || !
|
|
126
|
-
|
|
126
|
+
if (!t || !X.trim()) {
|
|
127
|
+
Q("A reason is required to dismiss a driver.");
|
|
127
128
|
return;
|
|
128
129
|
}
|
|
129
|
-
|
|
130
|
+
ge(!0), Q(null);
|
|
130
131
|
try {
|
|
131
132
|
await s(t, {
|
|
132
133
|
...$(),
|
|
133
134
|
terminatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
134
|
-
terminationReason:
|
|
135
|
-
}),
|
|
135
|
+
terminationReason: X.trim()
|
|
136
|
+
}), Y(!1), await A(), i?.(u(r, `fleet/drivers/${t}`));
|
|
136
137
|
} catch (e) {
|
|
137
|
-
|
|
138
|
+
Q(e instanceof Error ? e.message : "Failed to dismiss driver.");
|
|
138
139
|
} finally {
|
|
139
|
-
|
|
140
|
+
ge(!1);
|
|
140
141
|
}
|
|
141
142
|
}, Me = M && !!k?.terminatedAt;
|
|
142
|
-
return /* @__PURE__ */
|
|
143
|
+
return /* @__PURE__ */ W(j, {
|
|
143
144
|
title: M ? "Edit Driver" : "Add Driver",
|
|
144
145
|
subtitle: "Add a driver to your workforce",
|
|
145
|
-
icon: /* @__PURE__ */
|
|
146
|
-
headerActions: /* @__PURE__ */
|
|
146
|
+
icon: /* @__PURE__ */ U(l, { size: 24 }),
|
|
147
|
+
headerActions: /* @__PURE__ */ W("div", {
|
|
147
148
|
className: "flex gap-2",
|
|
148
|
-
children: [/* @__PURE__ */
|
|
149
|
+
children: [/* @__PURE__ */ W(g, {
|
|
149
150
|
variant: "outline",
|
|
150
151
|
onClick: Oe,
|
|
151
152
|
disabled: L,
|
|
152
|
-
children: [/* @__PURE__ */
|
|
153
|
-
}), /* @__PURE__ */
|
|
153
|
+
children: [/* @__PURE__ */ U(e, { size: 16 }), " Cancel"]
|
|
154
|
+
}), /* @__PURE__ */ W(g, {
|
|
154
155
|
onClick: Ae,
|
|
155
156
|
disabled: L,
|
|
156
157
|
children: [
|
|
157
|
-
/* @__PURE__ */
|
|
158
|
+
/* @__PURE__ */ U(a, { size: 16 }),
|
|
158
159
|
" ",
|
|
159
160
|
M ? L ? "Saving..." : "Save Changes" : L ? "Saving..." : "Add Driver"
|
|
160
161
|
]
|
|
161
162
|
})]
|
|
162
163
|
}),
|
|
163
164
|
children: [
|
|
164
|
-
/* @__PURE__ */
|
|
165
|
-
icon: /* @__PURE__ */
|
|
165
|
+
/* @__PURE__ */ U(K, {
|
|
166
|
+
icon: /* @__PURE__ */ U(l, { size: 18 }),
|
|
166
167
|
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."
|
|
167
168
|
}),
|
|
168
|
-
Me && k?.terminatedAt && /* @__PURE__ */
|
|
169
|
+
Me && k?.terminatedAt && /* @__PURE__ */ W("div", {
|
|
169
170
|
className: "rounded-card border border-status-error-border bg-status-error-bg-subtle p-4 text-sm text-status-error-text",
|
|
170
|
-
children: [/* @__PURE__ */
|
|
171
|
+
children: [/* @__PURE__ */ W("p", {
|
|
171
172
|
className: "font-medium",
|
|
172
173
|
children: [
|
|
173
174
|
"This driver was dismissed on ",
|
|
174
175
|
I(k.terminatedAt, "full"),
|
|
175
176
|
"."
|
|
176
177
|
]
|
|
177
|
-
}), k.terminationReason && /* @__PURE__ */
|
|
178
|
+
}), k.terminationReason && /* @__PURE__ */ W("p", {
|
|
178
179
|
className: "mt-1",
|
|
179
180
|
children: ["Reason: ", k.terminationReason]
|
|
180
181
|
})]
|
|
181
182
|
}),
|
|
182
|
-
/* @__PURE__ */
|
|
183
|
+
/* @__PURE__ */ W("form", {
|
|
183
184
|
onSubmit: Ae,
|
|
184
185
|
className: "max-w-3xl space-y-6",
|
|
185
186
|
children: [
|
|
186
|
-
/* @__PURE__ */
|
|
187
|
-
/* @__PURE__ */
|
|
187
|
+
/* @__PURE__ */ U(P, { message: B }),
|
|
188
|
+
/* @__PURE__ */ W(oe, { children: [/* @__PURE__ */ U("h2", {
|
|
188
189
|
className: "text-base font-semibold text-text-primary mb-4",
|
|
189
190
|
children: "Driver Details"
|
|
190
|
-
}), /* @__PURE__ */
|
|
191
|
+
}), /* @__PURE__ */ W("div", {
|
|
191
192
|
className: "space-y-4",
|
|
192
193
|
children: [
|
|
193
|
-
/* @__PURE__ */
|
|
194
|
+
/* @__PURE__ */ W("div", {
|
|
194
195
|
className: "grid grid-cols-1 md:grid-cols-3 gap-4",
|
|
195
196
|
children: [
|
|
196
|
-
/* @__PURE__ */
|
|
197
|
+
/* @__PURE__ */ W("div", {
|
|
197
198
|
className: "space-y-2",
|
|
198
|
-
children: [/* @__PURE__ */
|
|
199
|
+
children: [/* @__PURE__ */ W(S, {
|
|
199
200
|
htmlFor: "employeeId",
|
|
200
201
|
children: [
|
|
201
202
|
"Employee ID ",
|
|
202
203
|
M ? "(immutable)" : "",
|
|
203
204
|
" ",
|
|
204
|
-
/* @__PURE__ */
|
|
205
|
+
/* @__PURE__ */ U("span", {
|
|
205
206
|
className: "text-status-error-text",
|
|
206
207
|
children: !M && "*"
|
|
207
208
|
})
|
|
208
209
|
]
|
|
209
|
-
}), /* @__PURE__ */
|
|
210
|
+
}), /* @__PURE__ */ U(x, {
|
|
210
211
|
id: "employeeId",
|
|
211
212
|
value: N.employeeId,
|
|
212
213
|
onChange: (e) => F((t) => ({
|
|
@@ -218,15 +219,15 @@ function q({ editId: t }) {
|
|
|
218
219
|
disabled: M
|
|
219
220
|
})]
|
|
220
221
|
}),
|
|
221
|
-
/* @__PURE__ */
|
|
222
|
+
/* @__PURE__ */ W("div", {
|
|
222
223
|
className: "space-y-2",
|
|
223
|
-
children: [/* @__PURE__ */
|
|
224
|
+
children: [/* @__PURE__ */ W(S, {
|
|
224
225
|
htmlFor: "firstName",
|
|
225
|
-
children: ["First Name ", /* @__PURE__ */
|
|
226
|
+
children: ["First Name ", /* @__PURE__ */ U("span", {
|
|
226
227
|
className: "text-status-error-text",
|
|
227
228
|
children: "*"
|
|
228
229
|
})]
|
|
229
|
-
}), /* @__PURE__ */
|
|
230
|
+
}), /* @__PURE__ */ U(x, {
|
|
230
231
|
id: "firstName",
|
|
231
232
|
value: N.firstName,
|
|
232
233
|
onChange: (e) => F((t) => ({
|
|
@@ -237,15 +238,15 @@ function q({ editId: t }) {
|
|
|
237
238
|
required: !0
|
|
238
239
|
})]
|
|
239
240
|
}),
|
|
240
|
-
/* @__PURE__ */
|
|
241
|
+
/* @__PURE__ */ W("div", {
|
|
241
242
|
className: "space-y-2",
|
|
242
|
-
children: [/* @__PURE__ */
|
|
243
|
+
children: [/* @__PURE__ */ W(S, {
|
|
243
244
|
htmlFor: "lastName",
|
|
244
|
-
children: ["Last Name ", /* @__PURE__ */
|
|
245
|
+
children: ["Last Name ", /* @__PURE__ */ U("span", {
|
|
245
246
|
className: "text-status-error-text",
|
|
246
247
|
children: "*"
|
|
247
248
|
})]
|
|
248
|
-
}), /* @__PURE__ */
|
|
249
|
+
}), /* @__PURE__ */ U(x, {
|
|
249
250
|
id: "lastName",
|
|
250
251
|
value: N.lastName,
|
|
251
252
|
onChange: (e) => F((t) => ({
|
|
@@ -258,15 +259,15 @@ function q({ editId: t }) {
|
|
|
258
259
|
})
|
|
259
260
|
]
|
|
260
261
|
}),
|
|
261
|
-
/* @__PURE__ */
|
|
262
|
+
/* @__PURE__ */ W("div", {
|
|
262
263
|
className: "grid grid-cols-1 md:grid-cols-3 gap-4",
|
|
263
264
|
children: [
|
|
264
|
-
/* @__PURE__ */
|
|
265
|
+
/* @__PURE__ */ W("div", {
|
|
265
266
|
className: "space-y-2",
|
|
266
|
-
children: [/* @__PURE__ */
|
|
267
|
+
children: [/* @__PURE__ */ U(S, {
|
|
267
268
|
htmlFor: "email",
|
|
268
269
|
children: "Email"
|
|
269
|
-
}), /* @__PURE__ */
|
|
270
|
+
}), /* @__PURE__ */ U(x, {
|
|
270
271
|
id: "email",
|
|
271
272
|
type: "email",
|
|
272
273
|
value: N.email,
|
|
@@ -277,15 +278,15 @@ function q({ editId: t }) {
|
|
|
277
278
|
placeholder: "jane.doe@example.com"
|
|
278
279
|
})]
|
|
279
280
|
}),
|
|
280
|
-
/* @__PURE__ */
|
|
281
|
+
/* @__PURE__ */ W("div", {
|
|
281
282
|
className: "space-y-2",
|
|
282
|
-
children: [/* @__PURE__ */
|
|
283
|
+
children: [/* @__PURE__ */ W(S, {
|
|
283
284
|
htmlFor: "phone",
|
|
284
|
-
children: ["Phone ", /* @__PURE__ */
|
|
285
|
+
children: ["Phone ", /* @__PURE__ */ U("span", {
|
|
285
286
|
className: "text-status-error-text",
|
|
286
287
|
children: "*"
|
|
287
288
|
})]
|
|
288
|
-
}), /* @__PURE__ */
|
|
289
|
+
}), /* @__PURE__ */ U(x, {
|
|
289
290
|
id: "phone",
|
|
290
291
|
value: N.phone,
|
|
291
292
|
onChange: (e) => F((t) => ({
|
|
@@ -296,21 +297,21 @@ function q({ editId: t }) {
|
|
|
296
297
|
required: !0
|
|
297
298
|
})]
|
|
298
299
|
}),
|
|
299
|
-
/* @__PURE__ */
|
|
300
|
+
/* @__PURE__ */ W("div", {
|
|
300
301
|
className: "space-y-2",
|
|
301
|
-
children: [/* @__PURE__ */
|
|
302
|
+
children: [/* @__PURE__ */ U(S, {
|
|
302
303
|
htmlFor: "status",
|
|
303
304
|
children: "Status"
|
|
304
|
-
}), /* @__PURE__ */
|
|
305
|
+
}), /* @__PURE__ */ W(C, {
|
|
305
306
|
value: N.status,
|
|
306
307
|
onValueChange: (e) => F((t) => ({
|
|
307
308
|
...t,
|
|
308
309
|
status: e
|
|
309
310
|
})),
|
|
310
|
-
children: [/* @__PURE__ */
|
|
311
|
+
children: [/* @__PURE__ */ U(E, {
|
|
311
312
|
id: "status",
|
|
312
|
-
children: /* @__PURE__ */
|
|
313
|
-
}), /* @__PURE__ */
|
|
313
|
+
children: /* @__PURE__ */ U(D, {})
|
|
314
|
+
}), /* @__PURE__ */ U(w, { children: pe.map((e) => /* @__PURE__ */ U(T, {
|
|
314
315
|
value: e.value,
|
|
315
316
|
children: e.label
|
|
316
317
|
}, e.value)) })]
|
|
@@ -318,15 +319,15 @@ function q({ editId: t }) {
|
|
|
318
319
|
})
|
|
319
320
|
]
|
|
320
321
|
}),
|
|
321
|
-
/* @__PURE__ */
|
|
322
|
+
/* @__PURE__ */ W("div", {
|
|
322
323
|
className: "grid grid-cols-1 md:grid-cols-3 gap-4",
|
|
323
324
|
children: [
|
|
324
|
-
/* @__PURE__ */
|
|
325
|
+
/* @__PURE__ */ W("div", {
|
|
325
326
|
className: "space-y-2",
|
|
326
|
-
children: [/* @__PURE__ */
|
|
327
|
+
children: [/* @__PURE__ */ U(S, {
|
|
327
328
|
htmlFor: "licenseNumber",
|
|
328
329
|
children: "License Number"
|
|
329
|
-
}), /* @__PURE__ */
|
|
330
|
+
}), /* @__PURE__ */ U(x, {
|
|
330
331
|
id: "licenseNumber",
|
|
331
332
|
value: N.licenseNumber,
|
|
332
333
|
onChange: (e) => F((t) => ({
|
|
@@ -336,12 +337,12 @@ function q({ editId: t }) {
|
|
|
336
337
|
placeholder: "D1234567"
|
|
337
338
|
})]
|
|
338
339
|
}),
|
|
339
|
-
/* @__PURE__ */
|
|
340
|
+
/* @__PURE__ */ W("div", {
|
|
340
341
|
className: "space-y-2",
|
|
341
|
-
children: [/* @__PURE__ */
|
|
342
|
+
children: [/* @__PURE__ */ U(S, {
|
|
342
343
|
htmlFor: "licenseClass",
|
|
343
344
|
children: "License Class"
|
|
344
|
-
}), /* @__PURE__ */
|
|
345
|
+
}), /* @__PURE__ */ U(x, {
|
|
345
346
|
id: "licenseClass",
|
|
346
347
|
value: N.licenseClass,
|
|
347
348
|
onChange: (e) => F((t) => ({
|
|
@@ -351,12 +352,12 @@ function q({ editId: t }) {
|
|
|
351
352
|
placeholder: "Class A"
|
|
352
353
|
})]
|
|
353
354
|
}),
|
|
354
|
-
/* @__PURE__ */
|
|
355
|
+
/* @__PURE__ */ W("div", {
|
|
355
356
|
className: "space-y-2",
|
|
356
|
-
children: [/* @__PURE__ */
|
|
357
|
+
children: [/* @__PURE__ */ U(S, {
|
|
357
358
|
htmlFor: "licenseExpiry",
|
|
358
359
|
children: "License Expiry"
|
|
359
|
-
}), /* @__PURE__ */
|
|
360
|
+
}), /* @__PURE__ */ U(x, {
|
|
360
361
|
id: "licenseExpiry",
|
|
361
362
|
type: "date",
|
|
362
363
|
value: N.licenseExpiry,
|
|
@@ -368,25 +369,25 @@ function q({ editId: t }) {
|
|
|
368
369
|
})
|
|
369
370
|
]
|
|
370
371
|
}),
|
|
371
|
-
/* @__PURE__ */
|
|
372
|
+
/* @__PURE__ */ W("div", {
|
|
372
373
|
className: "grid grid-cols-1 md:grid-cols-2 gap-4",
|
|
373
|
-
children: [/* @__PURE__ */
|
|
374
|
+
children: [/* @__PURE__ */ W("div", {
|
|
374
375
|
className: "space-y-2",
|
|
375
|
-
children: [/* @__PURE__ */
|
|
376
|
+
children: [/* @__PURE__ */ U(S, {
|
|
376
377
|
htmlFor: "vehicleSearch",
|
|
377
378
|
children: "Search vehicles"
|
|
378
|
-
}), /* @__PURE__ */
|
|
379
|
+
}), /* @__PURE__ */ U(x, {
|
|
379
380
|
id: "vehicleSearch",
|
|
380
|
-
value:
|
|
381
|
+
value: ve,
|
|
381
382
|
onChange: (e) => ye(e.target.value),
|
|
382
383
|
placeholder: "Vehicle number or type"
|
|
383
384
|
})]
|
|
384
|
-
}), /* @__PURE__ */
|
|
385
|
+
}), /* @__PURE__ */ W("div", {
|
|
385
386
|
className: "space-y-2",
|
|
386
|
-
children: [/* @__PURE__ */
|
|
387
|
+
children: [/* @__PURE__ */ U(S, {
|
|
387
388
|
htmlFor: "vehicle",
|
|
388
389
|
children: "Assigned Vehicle"
|
|
389
|
-
}), /* @__PURE__ */
|
|
390
|
+
}), /* @__PURE__ */ U(ie, {
|
|
390
391
|
id: "vehicle",
|
|
391
392
|
value: N.vehicleId,
|
|
392
393
|
onChange: (e) => F((t) => ({
|
|
@@ -398,8 +399,8 @@ function q({ editId: t }) {
|
|
|
398
399
|
loading: xe,
|
|
399
400
|
getId: (e) => e.id,
|
|
400
401
|
getLabel: (e) => `${e.vehicleNumber} (${e.type})`,
|
|
401
|
-
renderOption: (e) => /* @__PURE__ */ H
|
|
402
|
-
/* @__PURE__ */
|
|
402
|
+
renderOption: (e) => /* @__PURE__ */ W(H, { children: [
|
|
403
|
+
/* @__PURE__ */ U(te, {
|
|
403
404
|
size: 14,
|
|
404
405
|
className: "mr-2 inline text-text-secondary"
|
|
405
406
|
}),
|
|
@@ -419,15 +420,15 @@ function q({ editId: t }) {
|
|
|
419
420
|
})]
|
|
420
421
|
})]
|
|
421
422
|
}),
|
|
422
|
-
/* @__PURE__ */
|
|
423
|
+
/* @__PURE__ */ W("div", {
|
|
423
424
|
className: "grid grid-cols-1 md:grid-cols-3 gap-4",
|
|
424
425
|
children: [
|
|
425
|
-
/* @__PURE__ */
|
|
426
|
+
/* @__PURE__ */ W("div", {
|
|
426
427
|
className: "space-y-2",
|
|
427
|
-
children: [/* @__PURE__ */
|
|
428
|
+
children: [/* @__PURE__ */ U(S, {
|
|
428
429
|
htmlFor: "rating",
|
|
429
430
|
children: "Rating (0–5)"
|
|
430
|
-
}), /* @__PURE__ */
|
|
431
|
+
}), /* @__PURE__ */ U(x, {
|
|
431
432
|
id: "rating",
|
|
432
433
|
type: "number",
|
|
433
434
|
min: 0,
|
|
@@ -441,12 +442,12 @@ function q({ editId: t }) {
|
|
|
441
442
|
placeholder: "4.8"
|
|
442
443
|
})]
|
|
443
444
|
}),
|
|
444
|
-
/* @__PURE__ */
|
|
445
|
+
/* @__PURE__ */ W("div", {
|
|
445
446
|
className: "space-y-2",
|
|
446
|
-
children: [/* @__PURE__ */
|
|
447
|
+
children: [/* @__PURE__ */ U(S, {
|
|
447
448
|
htmlFor: "hireDate",
|
|
448
449
|
children: "Hire Date"
|
|
449
|
-
}), /* @__PURE__ */
|
|
450
|
+
}), /* @__PURE__ */ U(x, {
|
|
450
451
|
id: "hireDate",
|
|
451
452
|
type: "date",
|
|
452
453
|
value: N.hireDate,
|
|
@@ -456,14 +457,14 @@ function q({ editId: t }) {
|
|
|
456
457
|
}))
|
|
457
458
|
})]
|
|
458
459
|
}),
|
|
459
|
-
/* @__PURE__ */
|
|
460
|
+
/* @__PURE__ */ W("div", {
|
|
460
461
|
className: "space-y-2",
|
|
461
|
-
children: [/* @__PURE__ */
|
|
462
|
+
children: [/* @__PURE__ */ W("div", {
|
|
462
463
|
className: "flex items-center justify-between gap-2",
|
|
463
|
-
children: [/* @__PURE__ */
|
|
464
|
+
children: [/* @__PURE__ */ U(S, {
|
|
464
465
|
htmlFor: "onLeaveUntil",
|
|
465
466
|
children: "On Leave Until"
|
|
466
|
-
}), N.onLeaveUntil && /* @__PURE__ */
|
|
467
|
+
}), N.onLeaveUntil && /* @__PURE__ */ U(g, {
|
|
467
468
|
type: "button",
|
|
468
469
|
variant: "ghost",
|
|
469
470
|
size: "sm",
|
|
@@ -473,7 +474,7 @@ function q({ editId: t }) {
|
|
|
473
474
|
})),
|
|
474
475
|
children: "Clear"
|
|
475
476
|
})]
|
|
476
|
-
}), /* @__PURE__ */
|
|
477
|
+
}), /* @__PURE__ */ U(x, {
|
|
477
478
|
id: "onLeaveUntil",
|
|
478
479
|
type: "date",
|
|
479
480
|
value: N.onLeaveUntil,
|
|
@@ -487,18 +488,18 @@ function q({ editId: t }) {
|
|
|
487
488
|
})
|
|
488
489
|
]
|
|
489
490
|
})] }),
|
|
490
|
-
/* @__PURE__ */
|
|
491
|
+
/* @__PURE__ */ W(_, { children: [/* @__PURE__ */ U(y, { children: /* @__PURE__ */ W(b, {
|
|
491
492
|
className: "flex items-center gap-2",
|
|
492
|
-
children: [/* @__PURE__ */
|
|
493
|
-
}) }), /* @__PURE__ */
|
|
493
|
+
children: [/* @__PURE__ */ U(n, { size: 18 }), " Compensation"]
|
|
494
|
+
}) }), /* @__PURE__ */ U(v, { children: /* @__PURE__ */ W("div", {
|
|
494
495
|
className: "grid grid-cols-1 md:grid-cols-3 gap-4",
|
|
495
496
|
children: [
|
|
496
|
-
/* @__PURE__ */
|
|
497
|
+
/* @__PURE__ */ W("div", {
|
|
497
498
|
className: "space-y-2",
|
|
498
|
-
children: [/* @__PURE__ */
|
|
499
|
+
children: [/* @__PURE__ */ U(S, {
|
|
499
500
|
htmlFor: "baseSalary",
|
|
500
501
|
children: "Base Salary (annual)"
|
|
501
|
-
}), /* @__PURE__ */
|
|
502
|
+
}), /* @__PURE__ */ U(x, {
|
|
502
503
|
id: "baseSalary",
|
|
503
504
|
type: "number",
|
|
504
505
|
min: 0,
|
|
@@ -511,12 +512,12 @@ function q({ editId: t }) {
|
|
|
511
512
|
placeholder: "55000"
|
|
512
513
|
})]
|
|
513
514
|
}),
|
|
514
|
-
/* @__PURE__ */
|
|
515
|
+
/* @__PURE__ */ W("div", {
|
|
515
516
|
className: "space-y-2",
|
|
516
|
-
children: [/* @__PURE__ */
|
|
517
|
+
children: [/* @__PURE__ */ U(S, {
|
|
517
518
|
htmlFor: "bonusYtd",
|
|
518
519
|
children: "Bonus (YTD)"
|
|
519
|
-
}), /* @__PURE__ */
|
|
520
|
+
}), /* @__PURE__ */ U(x, {
|
|
520
521
|
id: "bonusYtd",
|
|
521
522
|
type: "number",
|
|
522
523
|
min: 0,
|
|
@@ -529,12 +530,12 @@ function q({ editId: t }) {
|
|
|
529
530
|
placeholder: "1200"
|
|
530
531
|
})]
|
|
531
532
|
}),
|
|
532
|
-
/* @__PURE__ */
|
|
533
|
+
/* @__PURE__ */ W("div", {
|
|
533
534
|
className: "space-y-2",
|
|
534
|
-
children: [/* @__PURE__ */
|
|
535
|
+
children: [/* @__PURE__ */ U(S, {
|
|
535
536
|
htmlFor: "payCurrency",
|
|
536
537
|
children: "Currency"
|
|
537
|
-
}), /* @__PURE__ */
|
|
538
|
+
}), /* @__PURE__ */ U(x, {
|
|
538
539
|
id: "payCurrency",
|
|
539
540
|
value: N.payCurrency,
|
|
540
541
|
onChange: (e) => F((t) => ({
|
|
@@ -547,10 +548,10 @@ function q({ editId: t }) {
|
|
|
547
548
|
})
|
|
548
549
|
]
|
|
549
550
|
}) })] }),
|
|
550
|
-
/* @__PURE__ */
|
|
551
|
+
/* @__PURE__ */ W(_, { children: [/* @__PURE__ */ U(y, { children: /* @__PURE__ */ W(b, {
|
|
551
552
|
className: "flex items-center gap-2",
|
|
552
|
-
children: [/* @__PURE__ */
|
|
553
|
-
}) }), /* @__PURE__ */
|
|
553
|
+
children: [/* @__PURE__ */ U(ee, { size: 18 }), " HR Notes"]
|
|
554
|
+
}) }), /* @__PURE__ */ U(v, { children: /* @__PURE__ */ U(O, {
|
|
554
555
|
value: N.notes,
|
|
555
556
|
onChange: (e) => F((t) => ({
|
|
556
557
|
...t,
|
|
@@ -559,98 +560,100 @@ function q({ editId: t }) {
|
|
|
559
560
|
placeholder: "Performance notes, disciplinary history, anything worth tracking for this driver...",
|
|
560
561
|
rows: 4
|
|
561
562
|
}) })] }),
|
|
562
|
-
M && !Me && /* @__PURE__ */
|
|
563
|
+
M && !Me && /* @__PURE__ */ W(_, {
|
|
563
564
|
className: "border-status-error-border",
|
|
564
|
-
children: [/* @__PURE__ */
|
|
565
|
+
children: [/* @__PURE__ */ U(y, { children: /* @__PURE__ */ W(b, {
|
|
565
566
|
className: "flex items-center gap-2 text-status-error-text",
|
|
566
|
-
children: [/* @__PURE__ */
|
|
567
|
-
}) }), /* @__PURE__ */
|
|
567
|
+
children: [/* @__PURE__ */ U(c, { size: 18 }), " Dismiss Driver"]
|
|
568
|
+
}) }), /* @__PURE__ */ W(v, { children: [/* @__PURE__ */ U("p", {
|
|
568
569
|
className: "mb-3 text-sm text-text-secondary",
|
|
569
570
|
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."
|
|
570
|
-
}), /* @__PURE__ */
|
|
571
|
+
}), /* @__PURE__ */ W(g, {
|
|
571
572
|
type: "button",
|
|
572
573
|
variant: "outline",
|
|
573
574
|
className: "border-status-error-border text-status-error-text hover:bg-status-error-bg-subtle",
|
|
574
|
-
onClick: () =>
|
|
575
|
-
children: [/* @__PURE__ */
|
|
575
|
+
onClick: () => Y(!0),
|
|
576
|
+
children: [/* @__PURE__ */ U(c, { size: 16 }), " Dismiss this driver"]
|
|
576
577
|
})] })]
|
|
577
578
|
})
|
|
578
579
|
]
|
|
579
580
|
}),
|
|
580
|
-
/* @__PURE__ */
|
|
581
|
-
open:
|
|
582
|
-
onOpenChange:
|
|
583
|
-
children: /* @__PURE__ */
|
|
584
|
-
/* @__PURE__ */
|
|
585
|
-
/* @__PURE__ */
|
|
581
|
+
/* @__PURE__ */ U(se, {
|
|
582
|
+
open: G,
|
|
583
|
+
onOpenChange: Y,
|
|
584
|
+
children: /* @__PURE__ */ W(ce, { children: [
|
|
585
|
+
/* @__PURE__ */ W(de, { children: [/* @__PURE__ */ U(fe, { children: "Dismiss this driver?" }), /* @__PURE__ */ U(le, { children: "This records the driver as dismissed and requires a reason. It cannot be undone from here." })] }),
|
|
586
|
+
/* @__PURE__ */ W("div", {
|
|
586
587
|
className: "space-y-2 px-1",
|
|
587
588
|
children: [
|
|
588
|
-
/* @__PURE__ */
|
|
589
|
+
/* @__PURE__ */ W(S, {
|
|
589
590
|
htmlFor: "dismissReason",
|
|
590
|
-
children: ["Reason ", /* @__PURE__ */
|
|
591
|
+
children: ["Reason ", /* @__PURE__ */ U("span", {
|
|
591
592
|
className: "text-status-error-text",
|
|
592
593
|
children: "*"
|
|
593
594
|
})]
|
|
594
595
|
}),
|
|
595
|
-
/* @__PURE__ */
|
|
596
|
+
/* @__PURE__ */ U(O, {
|
|
596
597
|
id: "dismissReason",
|
|
597
|
-
value:
|
|
598
|
-
onChange: (e) =>
|
|
598
|
+
value: X,
|
|
599
|
+
onChange: (e) => he(e.target.value),
|
|
599
600
|
placeholder: "e.g. Repeated policy violations, voluntary resignation, performance...",
|
|
600
601
|
rows: 3
|
|
601
602
|
}),
|
|
602
|
-
/* @__PURE__ */
|
|
603
|
+
/* @__PURE__ */ U(P, { message: _e })
|
|
603
604
|
]
|
|
604
605
|
}),
|
|
605
|
-
/* @__PURE__ */
|
|
606
|
+
/* @__PURE__ */ W(ue, { children: [/* @__PURE__ */ U(g, {
|
|
606
607
|
variant: "outline",
|
|
607
|
-
onClick: () =>
|
|
608
|
-
disabled:
|
|
608
|
+
onClick: () => Y(!1),
|
|
609
|
+
disabled: Z,
|
|
609
610
|
children: "Cancel"
|
|
610
|
-
}), /* @__PURE__ */
|
|
611
|
+
}), /* @__PURE__ */ U(g, {
|
|
611
612
|
className: "bg-status-error-text text-text-inverse hover:opacity-90",
|
|
612
613
|
onClick: je,
|
|
613
|
-
disabled:
|
|
614
|
-
children:
|
|
614
|
+
disabled: Z,
|
|
615
|
+
children: Z ? "Dismissing..." : "Confirm dismissal"
|
|
615
616
|
})] })
|
|
616
617
|
] })
|
|
617
618
|
})
|
|
618
619
|
]
|
|
619
620
|
});
|
|
620
621
|
}
|
|
621
|
-
function
|
|
622
|
-
let { driverId: a } =
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
if (
|
|
626
|
-
if (
|
|
622
|
+
function X() {
|
|
623
|
+
let { driverId: a } = V(), c = B().pathname.endsWith("/edit"), { basePath: d, navigate: p } = ne(), { driver: h, isLoading: x, error: S, refetch: C } = f(a);
|
|
624
|
+
R(c, C);
|
|
625
|
+
let { vehicle: w } = m(h?.assignedVehicle), T = () => p?.(u(d, "fleet/drivers")), E = (e) => p?.(u(d, e));
|
|
626
|
+
if (!a) return /* @__PURE__ */ U(Y, {});
|
|
627
|
+
if (c) return /* @__PURE__ */ U(Y, { editId: a });
|
|
628
|
+
if (x) return /* @__PURE__ */ U(A, { message: "Loading driver details..." });
|
|
629
|
+
if (S || !h) return /* @__PURE__ */ U(k, {
|
|
627
630
|
title: "Driver not found",
|
|
628
|
-
onRetry:
|
|
631
|
+
onRetry: C
|
|
629
632
|
});
|
|
630
|
-
let D = !!
|
|
631
|
-
return /* @__PURE__ */
|
|
632
|
-
title:
|
|
633
|
-
subtitle: `Employee ID: ${
|
|
634
|
-
icon: /* @__PURE__ */
|
|
635
|
-
headerActions: /* @__PURE__ */
|
|
633
|
+
let D = !!h.terminatedAt, O = h.onLeaveUntil && h.onLeaveUntil.getTime() > (/* @__PURE__ */ new Date()).getTime() ? h.onLeaveUntil : void 0, M = h.baseSalary !== void 0 || h.bonusYtd !== void 0;
|
|
634
|
+
return /* @__PURE__ */ W(j, {
|
|
635
|
+
title: h.fullName,
|
|
636
|
+
subtitle: `Employee ID: ${h.employeeId}`,
|
|
637
|
+
icon: /* @__PURE__ */ U(l, { size: 24 }),
|
|
638
|
+
headerActions: /* @__PURE__ */ W("div", {
|
|
636
639
|
className: "flex gap-2",
|
|
637
|
-
children: [/* @__PURE__ */
|
|
640
|
+
children: [/* @__PURE__ */ W(g, {
|
|
638
641
|
variant: "outline",
|
|
639
642
|
onClick: T,
|
|
640
|
-
children: [/* @__PURE__ */
|
|
641
|
-
}), /* @__PURE__ */
|
|
642
|
-
onClick: () =>
|
|
643
|
-
children: [/* @__PURE__ */
|
|
643
|
+
children: [/* @__PURE__ */ U(e, { size: 16 }), " Back"]
|
|
644
|
+
}), /* @__PURE__ */ W(g, {
|
|
645
|
+
onClick: () => p?.(u(d, "fleet/drivers/" + a + "/edit")),
|
|
646
|
+
children: [/* @__PURE__ */ U(o, { size: 16 }), " Edit"]
|
|
644
647
|
})]
|
|
645
648
|
}),
|
|
646
|
-
headerContent: /* @__PURE__ */
|
|
649
|
+
headerContent: /* @__PURE__ */ W("div", {
|
|
647
650
|
className: "flex flex-wrap items-center gap-4",
|
|
648
651
|
children: [
|
|
649
|
-
/* @__PURE__ */
|
|
650
|
-
status:
|
|
652
|
+
/* @__PURE__ */ U(N, {
|
|
653
|
+
status: h.status,
|
|
651
654
|
type: "driver"
|
|
652
655
|
}),
|
|
653
|
-
D && /* @__PURE__ */
|
|
656
|
+
D && /* @__PURE__ */ U(N, {
|
|
654
657
|
status: "dismissed",
|
|
655
658
|
label: "Dismissed",
|
|
656
659
|
customColors: {
|
|
@@ -658,7 +661,7 @@ function J() {
|
|
|
658
661
|
text: "text-status-error-text"
|
|
659
662
|
}
|
|
660
663
|
}),
|
|
661
|
-
O && !D && /* @__PURE__ */
|
|
664
|
+
O && !D && /* @__PURE__ */ U(N, {
|
|
662
665
|
status: "on_leave",
|
|
663
666
|
label: `On leave until ${I(O, "short")}`,
|
|
664
667
|
customColors: {
|
|
@@ -666,103 +669,103 @@ function J() {
|
|
|
666
669
|
text: "text-status-warning-text"
|
|
667
670
|
}
|
|
668
671
|
}),
|
|
669
|
-
|
|
672
|
+
h.rating !== void 0 && /* @__PURE__ */ W("div", {
|
|
670
673
|
className: "flex items-center gap-1",
|
|
671
|
-
children: [/* @__PURE__ */
|
|
674
|
+
children: [/* @__PURE__ */ U(s, {
|
|
672
675
|
size: 16,
|
|
673
676
|
className: "text-status-warning-text fill-current"
|
|
674
|
-
}), /* @__PURE__ */
|
|
677
|
+
}), /* @__PURE__ */ U("span", {
|
|
675
678
|
className: "font-medium",
|
|
676
|
-
children:
|
|
679
|
+
children: h.rating.toFixed(1)
|
|
677
680
|
})]
|
|
678
681
|
})
|
|
679
682
|
]
|
|
680
683
|
}),
|
|
681
684
|
children: [
|
|
682
|
-
/* @__PURE__ */
|
|
683
|
-
icon: /* @__PURE__ */
|
|
685
|
+
/* @__PURE__ */ U(K, {
|
|
686
|
+
icon: /* @__PURE__ */ U(l, { size: 18 }),
|
|
684
687
|
children: "A driver's full profile — licensing, assigned vehicle, documents and HR record. Use it to confirm someone is road-ready and compliant before assigning them an order or route."
|
|
685
688
|
}),
|
|
686
|
-
/* @__PURE__ */
|
|
689
|
+
/* @__PURE__ */ U(G, {
|
|
687
690
|
storageKey: "movethewheels-driver-details",
|
|
688
691
|
steps: [
|
|
689
692
|
{
|
|
690
693
|
id: "assign",
|
|
691
694
|
label: "Assign to an order",
|
|
692
695
|
description: "Hand a pending delivery to this driver.",
|
|
693
|
-
icon: /* @__PURE__ */
|
|
696
|
+
icon: /* @__PURE__ */ U(i, { size: 16 }),
|
|
694
697
|
onClick: () => E("orders")
|
|
695
698
|
},
|
|
696
699
|
{
|
|
697
700
|
id: "routes",
|
|
698
701
|
label: "Plan their route",
|
|
699
702
|
description: "Batch nearby drop-offs into an optimized itinerary.",
|
|
700
|
-
icon: /* @__PURE__ */
|
|
703
|
+
icon: /* @__PURE__ */ U(t, { size: 16 }),
|
|
701
704
|
onClick: () => E("routes")
|
|
702
705
|
},
|
|
703
706
|
{
|
|
704
707
|
id: "edit",
|
|
705
708
|
label: "Update driver record",
|
|
706
709
|
description: "Refresh documents, license or HR details.",
|
|
707
|
-
icon: /* @__PURE__ */
|
|
710
|
+
icon: /* @__PURE__ */ U(o, { size: 16 }),
|
|
708
711
|
onClick: () => {}
|
|
709
712
|
}
|
|
710
713
|
]
|
|
711
714
|
}),
|
|
712
|
-
D && /* @__PURE__ */
|
|
715
|
+
D && /* @__PURE__ */ W("div", {
|
|
713
716
|
className: "rounded-card border border-status-error-border bg-status-error-bg-subtle p-4 text-sm text-status-error-text",
|
|
714
|
-
children: [/* @__PURE__ */
|
|
717
|
+
children: [/* @__PURE__ */ W("p", {
|
|
715
718
|
className: "font-medium",
|
|
716
|
-
children: ["Dismissed ",
|
|
717
|
-
}),
|
|
719
|
+
children: ["Dismissed ", h.terminatedAt && I(h.terminatedAt, "full")]
|
|
720
|
+
}), h.terminationReason && /* @__PURE__ */ W("p", {
|
|
718
721
|
className: "mt-1",
|
|
719
|
-
children: ["Reason: ",
|
|
722
|
+
children: ["Reason: ", h.terminationReason]
|
|
720
723
|
})]
|
|
721
724
|
}),
|
|
722
|
-
/* @__PURE__ */
|
|
725
|
+
/* @__PURE__ */ W("div", {
|
|
723
726
|
className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
|
|
724
|
-
children: [/* @__PURE__ */
|
|
727
|
+
children: [/* @__PURE__ */ W("div", {
|
|
725
728
|
className: "lg:col-span-2 space-y-6",
|
|
726
729
|
children: [
|
|
727
|
-
/* @__PURE__ */
|
|
730
|
+
/* @__PURE__ */ W(_, { children: [/* @__PURE__ */ U(y, { children: /* @__PURE__ */ W(b, {
|
|
728
731
|
className: "flex items-center gap-2",
|
|
729
|
-
children: [/* @__PURE__ */
|
|
730
|
-
}) }), /* @__PURE__ */
|
|
732
|
+
children: [/* @__PURE__ */ U(r, { size: 18 }), " License"]
|
|
733
|
+
}) }), /* @__PURE__ */ U(v, { children: /* @__PURE__ */ U("div", {
|
|
731
734
|
className: "flex items-center justify-between p-3 border rounded-lg",
|
|
732
|
-
children: /* @__PURE__ */
|
|
733
|
-
/* @__PURE__ */
|
|
735
|
+
children: /* @__PURE__ */ W("div", { children: [
|
|
736
|
+
/* @__PURE__ */ U("p", {
|
|
734
737
|
className: "font-medium",
|
|
735
738
|
children: "Driver's License"
|
|
736
739
|
}),
|
|
737
|
-
/* @__PURE__ */
|
|
740
|
+
/* @__PURE__ */ W("p", {
|
|
738
741
|
className: "text-sm text-text-secondary",
|
|
739
|
-
children: [
|
|
742
|
+
children: [h.licenseNumber || "—", h.licenseType ? ` - ${h.licenseType}` : ""]
|
|
740
743
|
}),
|
|
741
|
-
/* @__PURE__ */
|
|
744
|
+
/* @__PURE__ */ U("p", {
|
|
742
745
|
className: "text-sm text-text-secondary",
|
|
743
|
-
children:
|
|
746
|
+
children: h.licenseExpiry ? `Expires: ${I(h.licenseExpiry)}` : "Expiry not recorded"
|
|
744
747
|
})
|
|
745
748
|
] })
|
|
746
749
|
}) })] }),
|
|
747
|
-
|
|
750
|
+
h.notes && /* @__PURE__ */ W(_, { children: [/* @__PURE__ */ U(y, { children: /* @__PURE__ */ W(b, {
|
|
748
751
|
className: "flex items-center gap-2",
|
|
749
|
-
children: [/* @__PURE__ */
|
|
750
|
-
}) }), /* @__PURE__ */
|
|
752
|
+
children: [/* @__PURE__ */ U(ee, { size: 18 }), " HR Notes"]
|
|
753
|
+
}) }), /* @__PURE__ */ U(v, { children: /* @__PURE__ */ U("p", {
|
|
751
754
|
className: "text-sm whitespace-pre-wrap",
|
|
752
|
-
children:
|
|
755
|
+
children: h.notes
|
|
753
756
|
}) })] }),
|
|
754
|
-
/* @__PURE__ */
|
|
757
|
+
/* @__PURE__ */ U(L, {
|
|
755
758
|
entityType: "driver",
|
|
756
|
-
entityId:
|
|
759
|
+
entityId: h.id
|
|
757
760
|
})
|
|
758
761
|
]
|
|
759
|
-
}), /* @__PURE__ */
|
|
762
|
+
}), /* @__PURE__ */ W("div", {
|
|
760
763
|
className: "space-y-6",
|
|
761
764
|
children: [
|
|
762
|
-
/* @__PURE__ */
|
|
765
|
+
/* @__PURE__ */ W(_, { children: [/* @__PURE__ */ U(y, { children: /* @__PURE__ */ W(b, {
|
|
763
766
|
className: "flex items-center gap-2",
|
|
764
|
-
children: [/* @__PURE__ */
|
|
765
|
-
}) }), /* @__PURE__ */
|
|
767
|
+
children: [/* @__PURE__ */ U(te, { size: 18 }), " Assigned Vehicle"]
|
|
768
|
+
}) }), /* @__PURE__ */ U(v, { children: h.assignedVehicle ? w ? /* @__PURE__ */ W("button", {
|
|
766
769
|
type: "button",
|
|
767
770
|
className: "text-sm font-medium text-primary hover:underline",
|
|
768
771
|
onClick: () => E(`fleet/vehicles/${w.id}`),
|
|
@@ -772,54 +775,54 @@ function J() {
|
|
|
772
775
|
w.type,
|
|
773
776
|
")"
|
|
774
777
|
]
|
|
775
|
-
}) : /* @__PURE__ */
|
|
778
|
+
}) : /* @__PURE__ */ U("p", {
|
|
776
779
|
className: "text-sm text-text-secondary",
|
|
777
780
|
children: "Loading…"
|
|
778
|
-
}) : /* @__PURE__ */
|
|
781
|
+
}) : /* @__PURE__ */ U("p", {
|
|
779
782
|
className: "text-sm text-text-secondary",
|
|
780
783
|
children: "No vehicle assigned"
|
|
781
784
|
}) })] }),
|
|
782
|
-
/* @__PURE__ */
|
|
785
|
+
/* @__PURE__ */ W(_, { children: [/* @__PURE__ */ U(y, { children: /* @__PURE__ */ U(b, { children: "Record" }) }), /* @__PURE__ */ U(v, {
|
|
783
786
|
className: "space-y-4",
|
|
784
|
-
children: /* @__PURE__ */
|
|
787
|
+
children: /* @__PURE__ */ W("div", { children: [/* @__PURE__ */ U("p", {
|
|
785
788
|
className: "text-sm text-text-secondary",
|
|
786
789
|
children: "Hire Date"
|
|
787
|
-
}), /* @__PURE__ */
|
|
790
|
+
}), /* @__PURE__ */ U("p", {
|
|
788
791
|
className: "font-medium",
|
|
789
|
-
children:
|
|
792
|
+
children: h.hireDate ? I(h.hireDate) : "Not recorded"
|
|
790
793
|
})] })
|
|
791
794
|
})] }),
|
|
792
|
-
/* @__PURE__ */
|
|
795
|
+
/* @__PURE__ */ W(_, { children: [/* @__PURE__ */ U(y, { children: /* @__PURE__ */ W(b, {
|
|
793
796
|
className: "flex items-center gap-2",
|
|
794
|
-
children: [/* @__PURE__ */
|
|
795
|
-
}) }), /* @__PURE__ */
|
|
797
|
+
children: [/* @__PURE__ */ U(n, { size: 18 }), " Compensation"]
|
|
798
|
+
}) }), /* @__PURE__ */ U(v, {
|
|
796
799
|
className: "space-y-3",
|
|
797
|
-
children: M ? /* @__PURE__ */ H
|
|
800
|
+
children: M ? /* @__PURE__ */ W(H, { children: [h.baseSalary !== void 0 && /* @__PURE__ */ W("div", { children: [/* @__PURE__ */ U("p", {
|
|
798
801
|
className: "text-sm text-text-secondary",
|
|
799
802
|
children: "Base Salary"
|
|
800
|
-
}), /* @__PURE__ */
|
|
803
|
+
}), /* @__PURE__ */ W("p", {
|
|
801
804
|
className: "font-medium",
|
|
802
|
-
children: [F(
|
|
803
|
-
})] }),
|
|
805
|
+
children: [F(h.baseSalary, h.payCurrency || void 0), "/year"]
|
|
806
|
+
})] }), h.bonusYtd !== void 0 && /* @__PURE__ */ W("div", { children: [/* @__PURE__ */ U("p", {
|
|
804
807
|
className: "text-sm text-text-secondary",
|
|
805
808
|
children: "Bonus (YTD)"
|
|
806
|
-
}), /* @__PURE__ */
|
|
809
|
+
}), /* @__PURE__ */ U("p", {
|
|
807
810
|
className: "font-medium",
|
|
808
|
-
children: F(
|
|
809
|
-
})] })] }) : /* @__PURE__ */
|
|
811
|
+
children: F(h.bonusYtd, h.payCurrency || void 0)
|
|
812
|
+
})] })] }) : /* @__PURE__ */ U("p", {
|
|
810
813
|
className: "text-sm text-text-secondary",
|
|
811
814
|
children: "Not recorded"
|
|
812
815
|
})
|
|
813
816
|
})] }),
|
|
814
|
-
|
|
817
|
+
h.currentLocation && /* @__PURE__ */ W(_, { children: [/* @__PURE__ */ U(y, { children: /* @__PURE__ */ W(b, {
|
|
815
818
|
className: "flex items-center gap-2",
|
|
816
|
-
children: [/* @__PURE__ */
|
|
817
|
-
}) }), /* @__PURE__ */
|
|
819
|
+
children: [/* @__PURE__ */ U(i, { size: 18 }), " Current Location"]
|
|
820
|
+
}) }), /* @__PURE__ */ W(v, { children: [/* @__PURE__ */ U("p", {
|
|
818
821
|
className: "text-sm",
|
|
819
|
-
children:
|
|
820
|
-
}), /* @__PURE__ */
|
|
822
|
+
children: h.currentLocation.address || "Location updating..."
|
|
823
|
+
}), /* @__PURE__ */ U("p", {
|
|
821
824
|
className: "text-xs text-text-secondary mt-1",
|
|
822
|
-
children:
|
|
825
|
+
children: h.currentLocation.timestamp ? `Updated ${I(h.currentLocation.timestamp, "relative")}` : "Update time not recorded"
|
|
823
826
|
})] })] })
|
|
824
827
|
]
|
|
825
828
|
})]
|
|
@@ -828,4 +831,4 @@ function J() {
|
|
|
828
831
|
});
|
|
829
832
|
}
|
|
830
833
|
//#endregion
|
|
831
|
-
export {
|
|
834
|
+
export { X as default };
|