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