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