@burdenoff/microfe-movethewheels 2026.929.4 → 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/components/CustomerPicker.js +52 -48
- package/dist/components/EntityCombobox.js +25 -23
- package/dist/components/OrderItemRow.js +123 -78
- package/dist/hooks/useCustomers.js +52 -17
- package/dist/hooks/useFleet.js +126 -44
- package/dist/hooks/useInventory.js +43 -7
- package/dist/hooks/useMultiModalShipments.js +30 -26
- package/dist/hooks/useRefetchOnLeaveEdit.js +10 -0
- package/dist/hooks/useRoutes.js +55 -15
- package/dist/movethewheels/components/CustomerPicker.d.ts +5 -1
- package/dist/movethewheels/components/EntityCombobox.d.ts +6 -3
- package/dist/movethewheels/components/OrderItemRow.d.ts +7 -1
- package/dist/movethewheels/hooks/useCustomers.d.ts +3 -0
- package/dist/movethewheels/hooks/useFleet.d.ts +6 -0
- package/dist/movethewheels/hooks/useInventory.d.ts +2 -0
- package/dist/movethewheels/hooks/useMultiModalShipments.d.ts +1 -0
- package/dist/movethewheels/hooks/useRefetchOnLeaveEdit.d.ts +7 -0
- package/dist/movethewheels/hooks/useRoutes.d.ts +3 -0
- package/dist/movethewheels/utils/orderValidation.d.ts +11 -0
- package/dist/pages/CreateOrderPage.js +349 -297
- package/dist/pages/DriverDetailsPage.js +258 -251
- package/dist/pages/DriversPage.js +3 -1
- package/dist/pages/MultiModalShipmentPage.js +139 -125
- package/dist/pages/OrderDetailsPage.js +132 -140
- package/dist/pages/ProductDetailsPage.js +22 -19
- package/dist/pages/RouteDetailsPage.js +284 -281
- package/dist/pages/TrackingPage.js +2 -1
- package/dist/pages/VehicleDetailsPage.js +28 -25
- package/dist/utils/orderValidation.js +18 -0
- package/package.json +1 -1
- package/src/movethewheels/components/CustomerPicker.tsx +12 -0
- package/src/movethewheels/components/EntityCombobox.tsx +30 -11
- package/src/movethewheels/components/OrderItemRow.tsx +44 -0
- package/src/movethewheels/hooks/useCustomers.ts +38 -0
- package/src/movethewheels/hooks/useFleet.ts +125 -5
- package/src/movethewheels/hooks/useInventory.ts +42 -0
- package/src/movethewheels/hooks/useMultiModalShipments.ts +9 -7
- package/src/movethewheels/hooks/useRefetchOnLeaveEdit.ts +18 -0
- package/src/movethewheels/hooks/useRoutes.ts +51 -0
- package/src/movethewheels/pages/CreateOrderPage.tsx +66 -2
- package/src/movethewheels/pages/DriverDetailsPage.tsx +14 -1
- package/src/movethewheels/pages/DriversPage.tsx +7 -1
- package/src/movethewheels/pages/MultiModalShipmentPage.tsx +15 -1
- package/src/movethewheels/pages/OrderDetailsPage.tsx +25 -25
- package/src/movethewheels/pages/ProductDetailsPage.tsx +2 -0
- package/src/movethewheels/pages/RouteDetailsPage.tsx +10 -4
- package/src/movethewheels/pages/TrackingPage.tsx +7 -2
- package/src/movethewheels/pages/VehicleDetailsPage.tsx +2 -0
- package/src/movethewheels/utils/orderValidation.ts +53 -0
|
@@ -7,30 +7,31 @@ 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
|
|
17
|
-
import { ErrorState as
|
|
18
|
-
import { DRIVER_STATUS_LABELS as
|
|
19
|
-
import { StatusBadge as
|
|
20
|
-
import { FormError as
|
|
21
|
-
import { formatCurrency as
|
|
22
|
-
import { DocumentsCard as
|
|
23
|
-
import { useDebouncedValue as
|
|
24
|
-
import { EntityCombobox as
|
|
25
|
-
import {
|
|
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
|
+
import { ErrorState as k, LoadingState as A, PageLayout as j } from "../components/PageLayout.js";
|
|
18
|
+
import { DRIVER_STATUS_LABELS as M } from "../constants/index.js";
|
|
19
|
+
import { StatusBadge as N } from "../components/StatusBadge.js";
|
|
20
|
+
import { FormError as P } from "../components/FormError.js";
|
|
21
|
+
import { formatCurrency as F, formatDate as I } from "../utils/formatters.js";
|
|
22
|
+
import { DocumentsCard as L } from "../components/DocumentsCard.js";
|
|
23
|
+
import { useDebouncedValue as re } from "../hooks/useDebouncedValue.js";
|
|
24
|
+
import { EntityCombobox as ie } from "../components/EntityCombobox.js";
|
|
25
|
+
import { useRefetchOnLeaveEdit as R } from "../hooks/useRefetchOnLeaveEdit.js";
|
|
26
|
+
import { useEffect as ae, useState as z } from "react";
|
|
26
27
|
import { useLocation as B, useParams as V } from "react-router";
|
|
27
28
|
import { Fragment as H, jsx as U, jsxs as W } from "react/jsx-runtime";
|
|
28
|
-
import { EmphasisPanel as
|
|
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 pe = Object.entries(
|
|
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,78 +51,78 @@ var pe = Object.entries(N).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:
|
|
57
|
-
}), { vehicle:
|
|
58
|
-
|
|
59
|
-
if (!t || !
|
|
60
|
-
let [e, ...n] =
|
|
61
|
-
|
|
62
|
-
employeeId:
|
|
57
|
+
search: re(ve) || void 0
|
|
58
|
+
}), { vehicle: Ee, isLoading: De } = m(N.vehicleId || void 0);
|
|
59
|
+
ae(() => {
|
|
60
|
+
if (!t || !k) return;
|
|
61
|
+
let [e, ...n] = k.fullName.trim().split(/\s+/);
|
|
62
|
+
F({
|
|
63
|
+
employeeId: k.employeeId || "",
|
|
63
64
|
firstName: e || "",
|
|
64
65
|
lastName: n.join(" "),
|
|
65
|
-
email:
|
|
66
|
-
phone:
|
|
67
|
-
licenseNumber:
|
|
68
|
-
licenseClass:
|
|
69
|
-
licenseExpiry:
|
|
70
|
-
status:
|
|
71
|
-
vehicleId:
|
|
72
|
-
vehicleIds:
|
|
73
|
-
rating:
|
|
74
|
-
notes:
|
|
75
|
-
hireDate:
|
|
76
|
-
baseSalary:
|
|
77
|
-
bonusYtd:
|
|
78
|
-
payCurrency:
|
|
79
|
-
onLeaveUntil:
|
|
66
|
+
email: k.email || "",
|
|
67
|
+
phone: k.phone || "",
|
|
68
|
+
licenseNumber: k.licenseNumber || "",
|
|
69
|
+
licenseClass: k.licenseType || "",
|
|
70
|
+
licenseExpiry: q(k.licenseExpiry),
|
|
71
|
+
status: k.status,
|
|
72
|
+
vehicleId: k.assignedVehicle || "",
|
|
73
|
+
vehicleIds: k.vehicleIds,
|
|
74
|
+
rating: k.rating ? String(k.rating) : "",
|
|
75
|
+
notes: k.notes || "",
|
|
76
|
+
hireDate: q(k.hireDate),
|
|
77
|
+
baseSalary: k.baseSalary === void 0 ? "" : String(k.baseSalary),
|
|
78
|
+
bonusYtd: k.bonusYtd === void 0 ? "" : String(k.bonusYtd),
|
|
79
|
+
payCurrency: k.payCurrency || "",
|
|
80
|
+
onLeaveUntil: q(k.onLeaveUntil)
|
|
80
81
|
});
|
|
81
|
-
}, [t,
|
|
82
|
-
let
|
|
83
|
-
firstName:
|
|
84
|
-
lastName:
|
|
85
|
-
email:
|
|
86
|
-
phone:
|
|
87
|
-
licenseNumber:
|
|
88
|
-
licenseClass:
|
|
89
|
-
licenseExpiry:
|
|
90
|
-
status:
|
|
91
|
-
vehicleId:
|
|
92
|
-
vehicleIds:
|
|
93
|
-
rating:
|
|
94
|
-
notes:
|
|
95
|
-
hireDate:
|
|
96
|
-
baseSalary:
|
|
97
|
-
bonusYtd:
|
|
98
|
-
payCurrency:
|
|
99
|
-
...e ? { onLeaveUntil:
|
|
100
|
-
}),
|
|
101
|
-
employeeId:
|
|
82
|
+
}, [t, k]);
|
|
83
|
+
let Oe = () => i?.(u(r, "fleet/drivers")), $ = (e = !0) => ({
|
|
84
|
+
firstName: N.firstName.trim(),
|
|
85
|
+
lastName: N.lastName.trim(),
|
|
86
|
+
email: N.email.trim() || void 0,
|
|
87
|
+
phone: N.phone.trim() || void 0,
|
|
88
|
+
licenseNumber: N.licenseNumber.trim() || void 0,
|
|
89
|
+
licenseClass: N.licenseClass.trim() || void 0,
|
|
90
|
+
licenseExpiry: J(N.licenseExpiry),
|
|
91
|
+
status: d(N.status),
|
|
92
|
+
vehicleId: N.vehicleId || null,
|
|
93
|
+
vehicleIds: N.vehicleIds,
|
|
94
|
+
rating: N.rating.trim() ? Number(N.rating) : void 0,
|
|
95
|
+
notes: N.notes.trim() || void 0,
|
|
96
|
+
hireDate: J(N.hireDate),
|
|
97
|
+
baseSalary: N.baseSalary.trim() ? Number(N.baseSalary) : void 0,
|
|
98
|
+
bonusYtd: N.bonusYtd.trim() ? Number(N.bonusYtd) : void 0,
|
|
99
|
+
payCurrency: N.payCurrency.trim() || void 0,
|
|
100
|
+
...e ? { onLeaveUntil: J(N.onLeaveUntil) ?? null } : {}
|
|
101
|
+
}), ke = () => ({
|
|
102
|
+
employeeId: N.employeeId.trim(),
|
|
102
103
|
...$(!1)
|
|
103
|
-
}),
|
|
104
|
-
if (e.preventDefault(), !
|
|
105
|
-
|
|
104
|
+
}), Ae = async (e) => {
|
|
105
|
+
if (e.preventDefault(), !N.employeeId.trim() || !N.firstName.trim() || !N.lastName.trim()) {
|
|
106
|
+
V("Employee ID, first name and last name are required.");
|
|
106
107
|
return;
|
|
107
108
|
}
|
|
108
|
-
if (!
|
|
109
|
-
|
|
109
|
+
if (!N.phone.trim()) {
|
|
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
|
-
let e = await o(
|
|
119
|
-
i?.(
|
|
119
|
+
let e = await o(ke());
|
|
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
126
|
if (!t || !X.trim()) {
|
|
126
127
|
Q("A reason is required to dismiss a driver.");
|
|
127
128
|
return;
|
|
@@ -132,59 +133,59 @@ function J({ editId: t }) {
|
|
|
132
133
|
...$(),
|
|
133
134
|
terminatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
134
135
|
terminationReason: X.trim()
|
|
135
|
-
}), Y(!1), await
|
|
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
|
-
return /* @__PURE__ */ W(
|
|
143
|
-
title:
|
|
142
|
+
}, Me = M && !!k?.terminatedAt;
|
|
143
|
+
return /* @__PURE__ */ W(j, {
|
|
144
|
+
title: M ? "Edit Driver" : "Add Driver",
|
|
144
145
|
subtitle: "Add a driver to your workforce",
|
|
145
|
-
icon: /* @__PURE__ */ U(
|
|
146
|
+
icon: /* @__PURE__ */ U(l, { size: 24 }),
|
|
146
147
|
headerActions: /* @__PURE__ */ W("div", {
|
|
147
148
|
className: "flex gap-2",
|
|
148
|
-
children: [/* @__PURE__ */ W(
|
|
149
|
+
children: [/* @__PURE__ */ W(g, {
|
|
149
150
|
variant: "outline",
|
|
150
|
-
onClick:
|
|
151
|
-
disabled:
|
|
151
|
+
onClick: Oe,
|
|
152
|
+
disabled: L,
|
|
152
153
|
children: [/* @__PURE__ */ U(e, { size: 16 }), " Cancel"]
|
|
153
|
-
}), /* @__PURE__ */ W(
|
|
154
|
-
onClick:
|
|
155
|
-
disabled:
|
|
154
|
+
}), /* @__PURE__ */ W(g, {
|
|
155
|
+
onClick: Ae,
|
|
156
|
+
disabled: L,
|
|
156
157
|
children: [
|
|
157
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__ */ U(
|
|
165
|
-
icon: /* @__PURE__ */ U(
|
|
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
|
-
|
|
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
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
|
-
}),
|
|
178
|
+
}), k.terminationReason && /* @__PURE__ */ W("p", {
|
|
178
179
|
className: "mt-1",
|
|
179
|
-
children: ["Reason: ",
|
|
180
|
+
children: ["Reason: ", k.terminationReason]
|
|
180
181
|
})]
|
|
181
182
|
}),
|
|
182
183
|
/* @__PURE__ */ W("form", {
|
|
183
|
-
onSubmit:
|
|
184
|
+
onSubmit: Ae,
|
|
184
185
|
className: "max-w-3xl space-y-6",
|
|
185
186
|
children: [
|
|
186
|
-
/* @__PURE__ */ U(
|
|
187
|
-
/* @__PURE__ */ W(
|
|
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
191
|
}), /* @__PURE__ */ W("div", {
|
|
@@ -195,41 +196,41 @@ function J({ editId: t }) {
|
|
|
195
196
|
children: [
|
|
196
197
|
/* @__PURE__ */ W("div", {
|
|
197
198
|
className: "space-y-2",
|
|
198
|
-
children: [/* @__PURE__ */ W(
|
|
199
|
+
children: [/* @__PURE__ */ W(S, {
|
|
199
200
|
htmlFor: "employeeId",
|
|
200
201
|
children: [
|
|
201
202
|
"Employee ID ",
|
|
202
|
-
|
|
203
|
+
M ? "(immutable)" : "",
|
|
203
204
|
" ",
|
|
204
205
|
/* @__PURE__ */ U("span", {
|
|
205
206
|
className: "text-status-error-text",
|
|
206
|
-
children: !
|
|
207
|
+
children: !M && "*"
|
|
207
208
|
})
|
|
208
209
|
]
|
|
209
|
-
}), /* @__PURE__ */ U(
|
|
210
|
+
}), /* @__PURE__ */ U(x, {
|
|
210
211
|
id: "employeeId",
|
|
211
|
-
value:
|
|
212
|
-
onChange: (e) =>
|
|
212
|
+
value: N.employeeId,
|
|
213
|
+
onChange: (e) => F((t) => ({
|
|
213
214
|
...t,
|
|
214
215
|
employeeId: e.target.value
|
|
215
216
|
})),
|
|
216
217
|
placeholder: "EMP-001",
|
|
217
218
|
required: !0,
|
|
218
|
-
disabled:
|
|
219
|
+
disabled: M
|
|
219
220
|
})]
|
|
220
221
|
}),
|
|
221
222
|
/* @__PURE__ */ W("div", {
|
|
222
223
|
className: "space-y-2",
|
|
223
|
-
children: [/* @__PURE__ */ W(
|
|
224
|
+
children: [/* @__PURE__ */ W(S, {
|
|
224
225
|
htmlFor: "firstName",
|
|
225
226
|
children: ["First Name ", /* @__PURE__ */ U("span", {
|
|
226
227
|
className: "text-status-error-text",
|
|
227
228
|
children: "*"
|
|
228
229
|
})]
|
|
229
|
-
}), /* @__PURE__ */ U(
|
|
230
|
+
}), /* @__PURE__ */ U(x, {
|
|
230
231
|
id: "firstName",
|
|
231
|
-
value:
|
|
232
|
-
onChange: (e) =>
|
|
232
|
+
value: N.firstName,
|
|
233
|
+
onChange: (e) => F((t) => ({
|
|
233
234
|
...t,
|
|
234
235
|
firstName: e.target.value
|
|
235
236
|
})),
|
|
@@ -239,16 +240,16 @@ function J({ editId: t }) {
|
|
|
239
240
|
}),
|
|
240
241
|
/* @__PURE__ */ W("div", {
|
|
241
242
|
className: "space-y-2",
|
|
242
|
-
children: [/* @__PURE__ */ W(
|
|
243
|
+
children: [/* @__PURE__ */ W(S, {
|
|
243
244
|
htmlFor: "lastName",
|
|
244
245
|
children: ["Last Name ", /* @__PURE__ */ U("span", {
|
|
245
246
|
className: "text-status-error-text",
|
|
246
247
|
children: "*"
|
|
247
248
|
})]
|
|
248
|
-
}), /* @__PURE__ */ U(
|
|
249
|
+
}), /* @__PURE__ */ U(x, {
|
|
249
250
|
id: "lastName",
|
|
250
|
-
value:
|
|
251
|
-
onChange: (e) =>
|
|
251
|
+
value: N.lastName,
|
|
252
|
+
onChange: (e) => F((t) => ({
|
|
252
253
|
...t,
|
|
253
254
|
lastName: e.target.value
|
|
254
255
|
})),
|
|
@@ -263,14 +264,14 @@ function J({ editId: t }) {
|
|
|
263
264
|
children: [
|
|
264
265
|
/* @__PURE__ */ W("div", {
|
|
265
266
|
className: "space-y-2",
|
|
266
|
-
children: [/* @__PURE__ */ U(
|
|
267
|
+
children: [/* @__PURE__ */ U(S, {
|
|
267
268
|
htmlFor: "email",
|
|
268
269
|
children: "Email"
|
|
269
|
-
}), /* @__PURE__ */ U(
|
|
270
|
+
}), /* @__PURE__ */ U(x, {
|
|
270
271
|
id: "email",
|
|
271
272
|
type: "email",
|
|
272
|
-
value:
|
|
273
|
-
onChange: (e) =>
|
|
273
|
+
value: N.email,
|
|
274
|
+
onChange: (e) => F((t) => ({
|
|
274
275
|
...t,
|
|
275
276
|
email: e.target.value
|
|
276
277
|
})),
|
|
@@ -279,16 +280,16 @@ function J({ editId: t }) {
|
|
|
279
280
|
}),
|
|
280
281
|
/* @__PURE__ */ W("div", {
|
|
281
282
|
className: "space-y-2",
|
|
282
|
-
children: [/* @__PURE__ */ W(
|
|
283
|
+
children: [/* @__PURE__ */ W(S, {
|
|
283
284
|
htmlFor: "phone",
|
|
284
285
|
children: ["Phone ", /* @__PURE__ */ U("span", {
|
|
285
286
|
className: "text-status-error-text",
|
|
286
287
|
children: "*"
|
|
287
288
|
})]
|
|
288
|
-
}), /* @__PURE__ */ U(
|
|
289
|
+
}), /* @__PURE__ */ U(x, {
|
|
289
290
|
id: "phone",
|
|
290
|
-
value:
|
|
291
|
-
onChange: (e) =>
|
|
291
|
+
value: N.phone,
|
|
292
|
+
onChange: (e) => F((t) => ({
|
|
292
293
|
...t,
|
|
293
294
|
phone: e.target.value
|
|
294
295
|
})),
|
|
@@ -298,19 +299,19 @@ function J({ editId: t }) {
|
|
|
298
299
|
}),
|
|
299
300
|
/* @__PURE__ */ W("div", {
|
|
300
301
|
className: "space-y-2",
|
|
301
|
-
children: [/* @__PURE__ */ U(
|
|
302
|
+
children: [/* @__PURE__ */ U(S, {
|
|
302
303
|
htmlFor: "status",
|
|
303
304
|
children: "Status"
|
|
304
|
-
}), /* @__PURE__ */ W(
|
|
305
|
-
value:
|
|
306
|
-
onValueChange: (e) =>
|
|
305
|
+
}), /* @__PURE__ */ W(C, {
|
|
306
|
+
value: N.status,
|
|
307
|
+
onValueChange: (e) => F((t) => ({
|
|
307
308
|
...t,
|
|
308
309
|
status: e
|
|
309
310
|
})),
|
|
310
|
-
children: [/* @__PURE__ */ U(
|
|
311
|
+
children: [/* @__PURE__ */ U(E, {
|
|
311
312
|
id: "status",
|
|
312
|
-
children: /* @__PURE__ */ U(
|
|
313
|
-
}), /* @__PURE__ */ U(
|
|
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)) })]
|
|
@@ -323,13 +324,13 @@ function J({ editId: t }) {
|
|
|
323
324
|
children: [
|
|
324
325
|
/* @__PURE__ */ W("div", {
|
|
325
326
|
className: "space-y-2",
|
|
326
|
-
children: [/* @__PURE__ */ U(
|
|
327
|
+
children: [/* @__PURE__ */ U(S, {
|
|
327
328
|
htmlFor: "licenseNumber",
|
|
328
329
|
children: "License Number"
|
|
329
|
-
}), /* @__PURE__ */ U(
|
|
330
|
+
}), /* @__PURE__ */ U(x, {
|
|
330
331
|
id: "licenseNumber",
|
|
331
|
-
value:
|
|
332
|
-
onChange: (e) =>
|
|
332
|
+
value: N.licenseNumber,
|
|
333
|
+
onChange: (e) => F((t) => ({
|
|
333
334
|
...t,
|
|
334
335
|
licenseNumber: e.target.value
|
|
335
336
|
})),
|
|
@@ -338,13 +339,13 @@ function J({ editId: t }) {
|
|
|
338
339
|
}),
|
|
339
340
|
/* @__PURE__ */ W("div", {
|
|
340
341
|
className: "space-y-2",
|
|
341
|
-
children: [/* @__PURE__ */ U(
|
|
342
|
+
children: [/* @__PURE__ */ U(S, {
|
|
342
343
|
htmlFor: "licenseClass",
|
|
343
344
|
children: "License Class"
|
|
344
|
-
}), /* @__PURE__ */ U(
|
|
345
|
+
}), /* @__PURE__ */ U(x, {
|
|
345
346
|
id: "licenseClass",
|
|
346
|
-
value:
|
|
347
|
-
onChange: (e) =>
|
|
347
|
+
value: N.licenseClass,
|
|
348
|
+
onChange: (e) => F((t) => ({
|
|
348
349
|
...t,
|
|
349
350
|
licenseClass: e.target.value
|
|
350
351
|
})),
|
|
@@ -353,14 +354,14 @@ function J({ editId: t }) {
|
|
|
353
354
|
}),
|
|
354
355
|
/* @__PURE__ */ W("div", {
|
|
355
356
|
className: "space-y-2",
|
|
356
|
-
children: [/* @__PURE__ */ U(
|
|
357
|
+
children: [/* @__PURE__ */ U(S, {
|
|
357
358
|
htmlFor: "licenseExpiry",
|
|
358
359
|
children: "License Expiry"
|
|
359
|
-
}), /* @__PURE__ */ U(
|
|
360
|
+
}), /* @__PURE__ */ U(x, {
|
|
360
361
|
id: "licenseExpiry",
|
|
361
362
|
type: "date",
|
|
362
|
-
value:
|
|
363
|
-
onChange: (e) =>
|
|
363
|
+
value: N.licenseExpiry,
|
|
364
|
+
onChange: (e) => F((t) => ({
|
|
364
365
|
...t,
|
|
365
366
|
licenseExpiry: e.target.value
|
|
366
367
|
}))
|
|
@@ -372,10 +373,10 @@ function J({ editId: t }) {
|
|
|
372
373
|
className: "grid grid-cols-1 md:grid-cols-2 gap-4",
|
|
373
374
|
children: [/* @__PURE__ */ W("div", {
|
|
374
375
|
className: "space-y-2",
|
|
375
|
-
children: [/* @__PURE__ */ U(
|
|
376
|
+
children: [/* @__PURE__ */ U(S, {
|
|
376
377
|
htmlFor: "vehicleSearch",
|
|
377
378
|
children: "Search vehicles"
|
|
378
|
-
}), /* @__PURE__ */ U(
|
|
379
|
+
}), /* @__PURE__ */ U(x, {
|
|
379
380
|
id: "vehicleSearch",
|
|
380
381
|
value: ve,
|
|
381
382
|
onChange: (e) => ye(e.target.value),
|
|
@@ -383,13 +384,13 @@ function J({ editId: t }) {
|
|
|
383
384
|
})]
|
|
384
385
|
}), /* @__PURE__ */ W("div", {
|
|
385
386
|
className: "space-y-2",
|
|
386
|
-
children: [/* @__PURE__ */ U(
|
|
387
|
+
children: [/* @__PURE__ */ U(S, {
|
|
387
388
|
htmlFor: "vehicle",
|
|
388
389
|
children: "Assigned Vehicle"
|
|
389
|
-
}), /* @__PURE__ */ U(
|
|
390
|
+
}), /* @__PURE__ */ U(ie, {
|
|
390
391
|
id: "vehicle",
|
|
391
|
-
value:
|
|
392
|
-
onChange: (e) =>
|
|
392
|
+
value: N.vehicleId,
|
|
393
|
+
onChange: (e) => F((t) => ({
|
|
393
394
|
...t,
|
|
394
395
|
vehicleId: e,
|
|
395
396
|
vehicleIds: e ? [e] : []
|
|
@@ -399,7 +400,7 @@ function J({ editId: t }) {
|
|
|
399
400
|
getId: (e) => e.id,
|
|
400
401
|
getLabel: (e) => `${e.vehicleNumber} (${e.type})`,
|
|
401
402
|
renderOption: (e) => /* @__PURE__ */ W(H, { children: [
|
|
402
|
-
/* @__PURE__ */ U(
|
|
403
|
+
/* @__PURE__ */ U(te, {
|
|
403
404
|
size: 14,
|
|
404
405
|
className: "mr-2 inline text-text-secondary"
|
|
405
406
|
}),
|
|
@@ -408,8 +409,12 @@ function J({ editId: t }) {
|
|
|
408
409
|
e.type,
|
|
409
410
|
")"
|
|
410
411
|
] }),
|
|
411
|
-
selectedOption:
|
|
412
|
-
selectedLoading:
|
|
412
|
+
selectedOption: Ee,
|
|
413
|
+
selectedLoading: De,
|
|
414
|
+
hasMore: Ce,
|
|
415
|
+
totalCount: we,
|
|
416
|
+
onLoadMore: Te,
|
|
417
|
+
loadingMore: Se,
|
|
413
418
|
placeholder: "Unassigned",
|
|
414
419
|
emptyText: "No vehicles match that search."
|
|
415
420
|
})]
|
|
@@ -420,17 +425,17 @@ function J({ editId: t }) {
|
|
|
420
425
|
children: [
|
|
421
426
|
/* @__PURE__ */ W("div", {
|
|
422
427
|
className: "space-y-2",
|
|
423
|
-
children: [/* @__PURE__ */ U(
|
|
428
|
+
children: [/* @__PURE__ */ U(S, {
|
|
424
429
|
htmlFor: "rating",
|
|
425
430
|
children: "Rating (0–5)"
|
|
426
|
-
}), /* @__PURE__ */ U(
|
|
431
|
+
}), /* @__PURE__ */ U(x, {
|
|
427
432
|
id: "rating",
|
|
428
433
|
type: "number",
|
|
429
434
|
min: 0,
|
|
430
435
|
max: 5,
|
|
431
436
|
step: .1,
|
|
432
|
-
value:
|
|
433
|
-
onChange: (e) =>
|
|
437
|
+
value: N.rating,
|
|
438
|
+
onChange: (e) => F((t) => ({
|
|
434
439
|
...t,
|
|
435
440
|
rating: e.target.value
|
|
436
441
|
})),
|
|
@@ -439,14 +444,14 @@ function J({ editId: t }) {
|
|
|
439
444
|
}),
|
|
440
445
|
/* @__PURE__ */ W("div", {
|
|
441
446
|
className: "space-y-2",
|
|
442
|
-
children: [/* @__PURE__ */ U(
|
|
447
|
+
children: [/* @__PURE__ */ U(S, {
|
|
443
448
|
htmlFor: "hireDate",
|
|
444
449
|
children: "Hire Date"
|
|
445
|
-
}), /* @__PURE__ */ U(
|
|
450
|
+
}), /* @__PURE__ */ U(x, {
|
|
446
451
|
id: "hireDate",
|
|
447
452
|
type: "date",
|
|
448
|
-
value:
|
|
449
|
-
onChange: (e) =>
|
|
453
|
+
value: N.hireDate,
|
|
454
|
+
onChange: (e) => F((t) => ({
|
|
450
455
|
...t,
|
|
451
456
|
hireDate: e.target.value
|
|
452
457
|
}))
|
|
@@ -456,24 +461,24 @@ function J({ editId: t }) {
|
|
|
456
461
|
className: "space-y-2",
|
|
457
462
|
children: [/* @__PURE__ */ W("div", {
|
|
458
463
|
className: "flex items-center justify-between gap-2",
|
|
459
|
-
children: [/* @__PURE__ */ U(
|
|
464
|
+
children: [/* @__PURE__ */ U(S, {
|
|
460
465
|
htmlFor: "onLeaveUntil",
|
|
461
466
|
children: "On Leave Until"
|
|
462
|
-
}),
|
|
467
|
+
}), N.onLeaveUntil && /* @__PURE__ */ U(g, {
|
|
463
468
|
type: "button",
|
|
464
469
|
variant: "ghost",
|
|
465
470
|
size: "sm",
|
|
466
|
-
onClick: () =>
|
|
471
|
+
onClick: () => F((e) => ({
|
|
467
472
|
...e,
|
|
468
473
|
onLeaveUntil: ""
|
|
469
474
|
})),
|
|
470
475
|
children: "Clear"
|
|
471
476
|
})]
|
|
472
|
-
}), /* @__PURE__ */ U(
|
|
477
|
+
}), /* @__PURE__ */ U(x, {
|
|
473
478
|
id: "onLeaveUntil",
|
|
474
479
|
type: "date",
|
|
475
|
-
value:
|
|
476
|
-
onChange: (e) =>
|
|
480
|
+
value: N.onLeaveUntil,
|
|
481
|
+
onChange: (e) => F((t) => ({
|
|
477
482
|
...t,
|
|
478
483
|
onLeaveUntil: e.target.value
|
|
479
484
|
}))
|
|
@@ -483,24 +488,24 @@ function J({ editId: t }) {
|
|
|
483
488
|
})
|
|
484
489
|
]
|
|
485
490
|
})] }),
|
|
486
|
-
/* @__PURE__ */ W(
|
|
491
|
+
/* @__PURE__ */ W(_, { children: [/* @__PURE__ */ U(y, { children: /* @__PURE__ */ W(b, {
|
|
487
492
|
className: "flex items-center gap-2",
|
|
488
493
|
children: [/* @__PURE__ */ U(n, { size: 18 }), " Compensation"]
|
|
489
|
-
}) }), /* @__PURE__ */ U(
|
|
494
|
+
}) }), /* @__PURE__ */ U(v, { children: /* @__PURE__ */ W("div", {
|
|
490
495
|
className: "grid grid-cols-1 md:grid-cols-3 gap-4",
|
|
491
496
|
children: [
|
|
492
497
|
/* @__PURE__ */ W("div", {
|
|
493
498
|
className: "space-y-2",
|
|
494
|
-
children: [/* @__PURE__ */ U(
|
|
499
|
+
children: [/* @__PURE__ */ U(S, {
|
|
495
500
|
htmlFor: "baseSalary",
|
|
496
501
|
children: "Base Salary (annual)"
|
|
497
|
-
}), /* @__PURE__ */ U(
|
|
502
|
+
}), /* @__PURE__ */ U(x, {
|
|
498
503
|
id: "baseSalary",
|
|
499
504
|
type: "number",
|
|
500
505
|
min: 0,
|
|
501
506
|
step: .01,
|
|
502
|
-
value:
|
|
503
|
-
onChange: (e) =>
|
|
507
|
+
value: N.baseSalary,
|
|
508
|
+
onChange: (e) => F((t) => ({
|
|
504
509
|
...t,
|
|
505
510
|
baseSalary: e.target.value
|
|
506
511
|
})),
|
|
@@ -509,16 +514,16 @@ function J({ editId: t }) {
|
|
|
509
514
|
}),
|
|
510
515
|
/* @__PURE__ */ W("div", {
|
|
511
516
|
className: "space-y-2",
|
|
512
|
-
children: [/* @__PURE__ */ U(
|
|
517
|
+
children: [/* @__PURE__ */ U(S, {
|
|
513
518
|
htmlFor: "bonusYtd",
|
|
514
519
|
children: "Bonus (YTD)"
|
|
515
|
-
}), /* @__PURE__ */ U(
|
|
520
|
+
}), /* @__PURE__ */ U(x, {
|
|
516
521
|
id: "bonusYtd",
|
|
517
522
|
type: "number",
|
|
518
523
|
min: 0,
|
|
519
524
|
step: .01,
|
|
520
|
-
value:
|
|
521
|
-
onChange: (e) =>
|
|
525
|
+
value: N.bonusYtd,
|
|
526
|
+
onChange: (e) => F((t) => ({
|
|
522
527
|
...t,
|
|
523
528
|
bonusYtd: e.target.value
|
|
524
529
|
})),
|
|
@@ -527,13 +532,13 @@ function J({ editId: t }) {
|
|
|
527
532
|
}),
|
|
528
533
|
/* @__PURE__ */ W("div", {
|
|
529
534
|
className: "space-y-2",
|
|
530
|
-
children: [/* @__PURE__ */ U(
|
|
535
|
+
children: [/* @__PURE__ */ U(S, {
|
|
531
536
|
htmlFor: "payCurrency",
|
|
532
537
|
children: "Currency"
|
|
533
|
-
}), /* @__PURE__ */ U(
|
|
538
|
+
}), /* @__PURE__ */ U(x, {
|
|
534
539
|
id: "payCurrency",
|
|
535
|
-
value:
|
|
536
|
-
onChange: (e) =>
|
|
540
|
+
value: N.payCurrency,
|
|
541
|
+
onChange: (e) => F((t) => ({
|
|
537
542
|
...t,
|
|
538
543
|
payCurrency: e.target.value
|
|
539
544
|
})),
|
|
@@ -543,69 +548,69 @@ function J({ editId: t }) {
|
|
|
543
548
|
})
|
|
544
549
|
]
|
|
545
550
|
}) })] }),
|
|
546
|
-
/* @__PURE__ */ W(
|
|
551
|
+
/* @__PURE__ */ W(_, { children: [/* @__PURE__ */ U(y, { children: /* @__PURE__ */ W(b, {
|
|
547
552
|
className: "flex items-center gap-2",
|
|
548
553
|
children: [/* @__PURE__ */ U(ee, { size: 18 }), " HR Notes"]
|
|
549
|
-
}) }), /* @__PURE__ */ U(
|
|
550
|
-
value:
|
|
551
|
-
onChange: (e) =>
|
|
554
|
+
}) }), /* @__PURE__ */ U(v, { children: /* @__PURE__ */ U(O, {
|
|
555
|
+
value: N.notes,
|
|
556
|
+
onChange: (e) => F((t) => ({
|
|
552
557
|
...t,
|
|
553
558
|
notes: e.target.value
|
|
554
559
|
})),
|
|
555
560
|
placeholder: "Performance notes, disciplinary history, anything worth tracking for this driver...",
|
|
556
561
|
rows: 4
|
|
557
562
|
}) })] }),
|
|
558
|
-
|
|
563
|
+
M && !Me && /* @__PURE__ */ W(_, {
|
|
559
564
|
className: "border-status-error-border",
|
|
560
|
-
children: [/* @__PURE__ */ U(
|
|
565
|
+
children: [/* @__PURE__ */ U(y, { children: /* @__PURE__ */ W(b, {
|
|
561
566
|
className: "flex items-center gap-2 text-status-error-text",
|
|
562
|
-
children: [/* @__PURE__ */ U(
|
|
563
|
-
}) }), /* @__PURE__ */ W(
|
|
567
|
+
children: [/* @__PURE__ */ U(c, { size: 18 }), " Dismiss Driver"]
|
|
568
|
+
}) }), /* @__PURE__ */ W(v, { children: [/* @__PURE__ */ U("p", {
|
|
564
569
|
className: "mb-3 text-sm text-text-secondary",
|
|
565
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."
|
|
566
|
-
}), /* @__PURE__ */ W(
|
|
571
|
+
}), /* @__PURE__ */ W(g, {
|
|
567
572
|
type: "button",
|
|
568
573
|
variant: "outline",
|
|
569
574
|
className: "border-status-error-border text-status-error-text hover:bg-status-error-bg-subtle",
|
|
570
575
|
onClick: () => Y(!0),
|
|
571
|
-
children: [/* @__PURE__ */ U(
|
|
576
|
+
children: [/* @__PURE__ */ U(c, { size: 16 }), " Dismiss this driver"]
|
|
572
577
|
})] })]
|
|
573
578
|
})
|
|
574
579
|
]
|
|
575
580
|
}),
|
|
576
581
|
/* @__PURE__ */ U(se, {
|
|
577
|
-
open:
|
|
582
|
+
open: G,
|
|
578
583
|
onOpenChange: Y,
|
|
579
584
|
children: /* @__PURE__ */ W(ce, { children: [
|
|
580
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." })] }),
|
|
581
586
|
/* @__PURE__ */ W("div", {
|
|
582
587
|
className: "space-y-2 px-1",
|
|
583
588
|
children: [
|
|
584
|
-
/* @__PURE__ */ W(
|
|
589
|
+
/* @__PURE__ */ W(S, {
|
|
585
590
|
htmlFor: "dismissReason",
|
|
586
591
|
children: ["Reason ", /* @__PURE__ */ U("span", {
|
|
587
592
|
className: "text-status-error-text",
|
|
588
593
|
children: "*"
|
|
589
594
|
})]
|
|
590
595
|
}),
|
|
591
|
-
/* @__PURE__ */ U(
|
|
596
|
+
/* @__PURE__ */ U(O, {
|
|
592
597
|
id: "dismissReason",
|
|
593
598
|
value: X,
|
|
594
599
|
onChange: (e) => he(e.target.value),
|
|
595
600
|
placeholder: "e.g. Repeated policy violations, voluntary resignation, performance...",
|
|
596
601
|
rows: 3
|
|
597
602
|
}),
|
|
598
|
-
/* @__PURE__ */ U(
|
|
603
|
+
/* @__PURE__ */ U(P, { message: _e })
|
|
599
604
|
]
|
|
600
605
|
}),
|
|
601
|
-
/* @__PURE__ */ W(ue, { children: [/* @__PURE__ */ U(
|
|
606
|
+
/* @__PURE__ */ W(ue, { children: [/* @__PURE__ */ U(g, {
|
|
602
607
|
variant: "outline",
|
|
603
608
|
onClick: () => Y(!1),
|
|
604
609
|
disabled: Z,
|
|
605
610
|
children: "Cancel"
|
|
606
|
-
}), /* @__PURE__ */ U(
|
|
611
|
+
}), /* @__PURE__ */ U(g, {
|
|
607
612
|
className: "bg-status-error-text text-text-inverse hover:opacity-90",
|
|
608
|
-
onClick:
|
|
613
|
+
onClick: je,
|
|
609
614
|
disabled: Z,
|
|
610
615
|
children: Z ? "Dismissing..." : "Confirm dismissal"
|
|
611
616
|
})] })
|
|
@@ -614,39 +619,41 @@ function J({ editId: t }) {
|
|
|
614
619
|
]
|
|
615
620
|
});
|
|
616
621
|
}
|
|
617
|
-
function
|
|
618
|
-
let { driverId: a } = V(),
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
if (
|
|
622
|
-
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, {
|
|
623
630
|
title: "Driver not found",
|
|
624
|
-
onRetry:
|
|
631
|
+
onRetry: C
|
|
625
632
|
});
|
|
626
|
-
let
|
|
627
|
-
return /* @__PURE__ */ W(
|
|
628
|
-
title:
|
|
629
|
-
subtitle: `Employee ID: ${
|
|
630
|
-
icon: /* @__PURE__ */ U(
|
|
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 }),
|
|
631
638
|
headerActions: /* @__PURE__ */ W("div", {
|
|
632
639
|
className: "flex gap-2",
|
|
633
|
-
children: [/* @__PURE__ */ W(
|
|
640
|
+
children: [/* @__PURE__ */ W(g, {
|
|
634
641
|
variant: "outline",
|
|
635
|
-
onClick:
|
|
642
|
+
onClick: T,
|
|
636
643
|
children: [/* @__PURE__ */ U(e, { size: 16 }), " Back"]
|
|
637
|
-
}), /* @__PURE__ */ W(
|
|
638
|
-
onClick: () =>
|
|
644
|
+
}), /* @__PURE__ */ W(g, {
|
|
645
|
+
onClick: () => p?.(u(d, "fleet/drivers/" + a + "/edit")),
|
|
639
646
|
children: [/* @__PURE__ */ U(o, { size: 16 }), " Edit"]
|
|
640
647
|
})]
|
|
641
648
|
}),
|
|
642
649
|
headerContent: /* @__PURE__ */ W("div", {
|
|
643
650
|
className: "flex flex-wrap items-center gap-4",
|
|
644
651
|
children: [
|
|
645
|
-
/* @__PURE__ */ U(
|
|
646
|
-
status:
|
|
652
|
+
/* @__PURE__ */ U(N, {
|
|
653
|
+
status: h.status,
|
|
647
654
|
type: "driver"
|
|
648
655
|
}),
|
|
649
|
-
|
|
656
|
+
D && /* @__PURE__ */ U(N, {
|
|
650
657
|
status: "dismissed",
|
|
651
658
|
label: "Dismissed",
|
|
652
659
|
customColors: {
|
|
@@ -654,29 +661,29 @@ function Y() {
|
|
|
654
661
|
text: "text-status-error-text"
|
|
655
662
|
}
|
|
656
663
|
}),
|
|
657
|
-
|
|
664
|
+
O && !D && /* @__PURE__ */ U(N, {
|
|
658
665
|
status: "on_leave",
|
|
659
|
-
label: `On leave until ${
|
|
666
|
+
label: `On leave until ${I(O, "short")}`,
|
|
660
667
|
customColors: {
|
|
661
668
|
bg: "bg-status-warning-bg-subtle",
|
|
662
669
|
text: "text-status-warning-text"
|
|
663
670
|
}
|
|
664
671
|
}),
|
|
665
|
-
|
|
672
|
+
h.rating !== void 0 && /* @__PURE__ */ W("div", {
|
|
666
673
|
className: "flex items-center gap-1",
|
|
667
674
|
children: [/* @__PURE__ */ U(s, {
|
|
668
675
|
size: 16,
|
|
669
676
|
className: "text-status-warning-text fill-current"
|
|
670
677
|
}), /* @__PURE__ */ U("span", {
|
|
671
678
|
className: "font-medium",
|
|
672
|
-
children:
|
|
679
|
+
children: h.rating.toFixed(1)
|
|
673
680
|
})]
|
|
674
681
|
})
|
|
675
682
|
]
|
|
676
683
|
}),
|
|
677
684
|
children: [
|
|
678
|
-
/* @__PURE__ */ U(
|
|
679
|
-
icon: /* @__PURE__ */ U(
|
|
685
|
+
/* @__PURE__ */ U(K, {
|
|
686
|
+
icon: /* @__PURE__ */ U(l, { size: 18 }),
|
|
680
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."
|
|
681
688
|
}),
|
|
682
689
|
/* @__PURE__ */ U(G, {
|
|
@@ -687,14 +694,14 @@ function Y() {
|
|
|
687
694
|
label: "Assign to an order",
|
|
688
695
|
description: "Hand a pending delivery to this driver.",
|
|
689
696
|
icon: /* @__PURE__ */ U(i, { size: 16 }),
|
|
690
|
-
onClick: () =>
|
|
697
|
+
onClick: () => E("orders")
|
|
691
698
|
},
|
|
692
699
|
{
|
|
693
700
|
id: "routes",
|
|
694
701
|
label: "Plan their route",
|
|
695
702
|
description: "Batch nearby drop-offs into an optimized itinerary.",
|
|
696
703
|
icon: /* @__PURE__ */ U(t, { size: 16 }),
|
|
697
|
-
onClick: () =>
|
|
704
|
+
onClick: () => E("routes")
|
|
698
705
|
},
|
|
699
706
|
{
|
|
700
707
|
id: "edit",
|
|
@@ -705,14 +712,14 @@ function Y() {
|
|
|
705
712
|
}
|
|
706
713
|
]
|
|
707
714
|
}),
|
|
708
|
-
|
|
715
|
+
D && /* @__PURE__ */ W("div", {
|
|
709
716
|
className: "rounded-card border border-status-error-border bg-status-error-bg-subtle p-4 text-sm text-status-error-text",
|
|
710
717
|
children: [/* @__PURE__ */ W("p", {
|
|
711
718
|
className: "font-medium",
|
|
712
|
-
children: ["Dismissed ",
|
|
713
|
-
}),
|
|
719
|
+
children: ["Dismissed ", h.terminatedAt && I(h.terminatedAt, "full")]
|
|
720
|
+
}), h.terminationReason && /* @__PURE__ */ W("p", {
|
|
714
721
|
className: "mt-1",
|
|
715
|
-
children: ["Reason: ",
|
|
722
|
+
children: ["Reason: ", h.terminationReason]
|
|
716
723
|
})]
|
|
717
724
|
}),
|
|
718
725
|
/* @__PURE__ */ W("div", {
|
|
@@ -720,10 +727,10 @@ function Y() {
|
|
|
720
727
|
children: [/* @__PURE__ */ W("div", {
|
|
721
728
|
className: "lg:col-span-2 space-y-6",
|
|
722
729
|
children: [
|
|
723
|
-
/* @__PURE__ */ W(
|
|
730
|
+
/* @__PURE__ */ W(_, { children: [/* @__PURE__ */ U(y, { children: /* @__PURE__ */ W(b, {
|
|
724
731
|
className: "flex items-center gap-2",
|
|
725
732
|
children: [/* @__PURE__ */ U(r, { size: 18 }), " License"]
|
|
726
|
-
}) }), /* @__PURE__ */ U(
|
|
733
|
+
}) }), /* @__PURE__ */ U(v, { children: /* @__PURE__ */ U("div", {
|
|
727
734
|
className: "flex items-center justify-between p-3 border rounded-lg",
|
|
728
735
|
children: /* @__PURE__ */ W("div", { children: [
|
|
729
736
|
/* @__PURE__ */ U("p", {
|
|
@@ -732,40 +739,40 @@ function Y() {
|
|
|
732
739
|
}),
|
|
733
740
|
/* @__PURE__ */ W("p", {
|
|
734
741
|
className: "text-sm text-text-secondary",
|
|
735
|
-
children: [
|
|
742
|
+
children: [h.licenseNumber || "—", h.licenseType ? ` - ${h.licenseType}` : ""]
|
|
736
743
|
}),
|
|
737
744
|
/* @__PURE__ */ U("p", {
|
|
738
745
|
className: "text-sm text-text-secondary",
|
|
739
|
-
children:
|
|
746
|
+
children: h.licenseExpiry ? `Expires: ${I(h.licenseExpiry)}` : "Expiry not recorded"
|
|
740
747
|
})
|
|
741
748
|
] })
|
|
742
749
|
}) })] }),
|
|
743
|
-
|
|
750
|
+
h.notes && /* @__PURE__ */ W(_, { children: [/* @__PURE__ */ U(y, { children: /* @__PURE__ */ W(b, {
|
|
744
751
|
className: "flex items-center gap-2",
|
|
745
752
|
children: [/* @__PURE__ */ U(ee, { size: 18 }), " HR Notes"]
|
|
746
|
-
}) }), /* @__PURE__ */ U(
|
|
753
|
+
}) }), /* @__PURE__ */ U(v, { children: /* @__PURE__ */ U("p", {
|
|
747
754
|
className: "text-sm whitespace-pre-wrap",
|
|
748
|
-
children:
|
|
755
|
+
children: h.notes
|
|
749
756
|
}) })] }),
|
|
750
|
-
/* @__PURE__ */ U(
|
|
757
|
+
/* @__PURE__ */ U(L, {
|
|
751
758
|
entityType: "driver",
|
|
752
|
-
entityId:
|
|
759
|
+
entityId: h.id
|
|
753
760
|
})
|
|
754
761
|
]
|
|
755
762
|
}), /* @__PURE__ */ W("div", {
|
|
756
763
|
className: "space-y-6",
|
|
757
764
|
children: [
|
|
758
|
-
/* @__PURE__ */ W(
|
|
765
|
+
/* @__PURE__ */ W(_, { children: [/* @__PURE__ */ U(y, { children: /* @__PURE__ */ W(b, {
|
|
759
766
|
className: "flex items-center gap-2",
|
|
760
|
-
children: [/* @__PURE__ */ U(
|
|
761
|
-
}) }), /* @__PURE__ */ U(
|
|
767
|
+
children: [/* @__PURE__ */ U(te, { size: 18 }), " Assigned Vehicle"]
|
|
768
|
+
}) }), /* @__PURE__ */ U(v, { children: h.assignedVehicle ? w ? /* @__PURE__ */ W("button", {
|
|
762
769
|
type: "button",
|
|
763
770
|
className: "text-sm font-medium text-primary hover:underline",
|
|
764
|
-
onClick: () =>
|
|
771
|
+
onClick: () => E(`fleet/vehicles/${w.id}`),
|
|
765
772
|
children: [
|
|
766
|
-
|
|
773
|
+
w.vehicleNumber,
|
|
767
774
|
" (",
|
|
768
|
-
|
|
775
|
+
w.type,
|
|
769
776
|
")"
|
|
770
777
|
]
|
|
771
778
|
}) : /* @__PURE__ */ U("p", {
|
|
@@ -775,47 +782,47 @@ function Y() {
|
|
|
775
782
|
className: "text-sm text-text-secondary",
|
|
776
783
|
children: "No vehicle assigned"
|
|
777
784
|
}) })] }),
|
|
778
|
-
/* @__PURE__ */ W(
|
|
785
|
+
/* @__PURE__ */ W(_, { children: [/* @__PURE__ */ U(y, { children: /* @__PURE__ */ U(b, { children: "Record" }) }), /* @__PURE__ */ U(v, {
|
|
779
786
|
className: "space-y-4",
|
|
780
787
|
children: /* @__PURE__ */ W("div", { children: [/* @__PURE__ */ U("p", {
|
|
781
788
|
className: "text-sm text-text-secondary",
|
|
782
789
|
children: "Hire Date"
|
|
783
790
|
}), /* @__PURE__ */ U("p", {
|
|
784
791
|
className: "font-medium",
|
|
785
|
-
children:
|
|
792
|
+
children: h.hireDate ? I(h.hireDate) : "Not recorded"
|
|
786
793
|
})] })
|
|
787
794
|
})] }),
|
|
788
|
-
/* @__PURE__ */ W(
|
|
795
|
+
/* @__PURE__ */ W(_, { children: [/* @__PURE__ */ U(y, { children: /* @__PURE__ */ W(b, {
|
|
789
796
|
className: "flex items-center gap-2",
|
|
790
797
|
children: [/* @__PURE__ */ U(n, { size: 18 }), " Compensation"]
|
|
791
|
-
}) }), /* @__PURE__ */ U(
|
|
798
|
+
}) }), /* @__PURE__ */ U(v, {
|
|
792
799
|
className: "space-y-3",
|
|
793
|
-
children:
|
|
800
|
+
children: M ? /* @__PURE__ */ W(H, { children: [h.baseSalary !== void 0 && /* @__PURE__ */ W("div", { children: [/* @__PURE__ */ U("p", {
|
|
794
801
|
className: "text-sm text-text-secondary",
|
|
795
802
|
children: "Base Salary"
|
|
796
803
|
}), /* @__PURE__ */ W("p", {
|
|
797
804
|
className: "font-medium",
|
|
798
|
-
children: [
|
|
799
|
-
})] }),
|
|
805
|
+
children: [F(h.baseSalary, h.payCurrency || void 0), "/year"]
|
|
806
|
+
})] }), h.bonusYtd !== void 0 && /* @__PURE__ */ W("div", { children: [/* @__PURE__ */ U("p", {
|
|
800
807
|
className: "text-sm text-text-secondary",
|
|
801
808
|
children: "Bonus (YTD)"
|
|
802
809
|
}), /* @__PURE__ */ U("p", {
|
|
803
810
|
className: "font-medium",
|
|
804
|
-
children:
|
|
811
|
+
children: F(h.bonusYtd, h.payCurrency || void 0)
|
|
805
812
|
})] })] }) : /* @__PURE__ */ U("p", {
|
|
806
813
|
className: "text-sm text-text-secondary",
|
|
807
814
|
children: "Not recorded"
|
|
808
815
|
})
|
|
809
816
|
})] }),
|
|
810
|
-
|
|
817
|
+
h.currentLocation && /* @__PURE__ */ W(_, { children: [/* @__PURE__ */ U(y, { children: /* @__PURE__ */ W(b, {
|
|
811
818
|
className: "flex items-center gap-2",
|
|
812
819
|
children: [/* @__PURE__ */ U(i, { size: 18 }), " Current Location"]
|
|
813
|
-
}) }), /* @__PURE__ */ W(
|
|
820
|
+
}) }), /* @__PURE__ */ W(v, { children: [/* @__PURE__ */ U("p", {
|
|
814
821
|
className: "text-sm",
|
|
815
|
-
children:
|
|
822
|
+
children: h.currentLocation.address || "Location updating..."
|
|
816
823
|
}), /* @__PURE__ */ U("p", {
|
|
817
824
|
className: "text-xs text-text-secondary mt-1",
|
|
818
|
-
children:
|
|
825
|
+
children: h.currentLocation.timestamp ? `Updated ${I(h.currentLocation.timestamp, "relative")}` : "Update time not recorded"
|
|
819
826
|
})] })] })
|
|
820
827
|
]
|
|
821
828
|
})]
|
|
@@ -824,4 +831,4 @@ function Y() {
|
|
|
824
831
|
});
|
|
825
832
|
}
|
|
826
833
|
//#endregion
|
|
827
|
-
export {
|
|
834
|
+
export { X as default };
|