@burdenoff/microfe-movethewheels 2026.626.2 → 2026.703.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AIAssistantPage-AvsMbunM.js → AIAssistantPage-C3cPsWt-.js} +100 -73
- package/dist/AnalyticsPage-Dz6g2MvK.js +215 -0
- package/dist/{CreateOrderPage-CjlnEtk3.js → CreateOrderPage-C5iwnjp4.js} +36 -67
- package/dist/CustomerDetailsPage-B6nwFyLO.js +406 -0
- package/dist/{CustomersPage-CGGfD4ki.js → CustomersPage-2Y05LVyh.js} +26 -28
- package/dist/{DashboardPage-D2HRqwg9.js → DashboardPage-BVjQi0EB.js} +85 -83
- package/dist/{DataTable-CD9ZhpLB.js → DataTable-DmciIKKM.js} +3 -3
- package/dist/DriverDetailsPage-CN3WQ0B9.js +507 -0
- package/dist/{DriversPage-DKiynISH.js → DriversPage-B0Zpx8OQ.js} +25 -27
- package/dist/{FinancePage-Vg8WPs38.js → FinancePage-DEDykSOP.js} +9 -9
- package/dist/FleetPage-DqkFi3s3.js +365 -0
- package/dist/FormError-BlOjnXOq.js +15 -0
- package/dist/ImportExportPage-DKJRCezl.js +290 -0
- package/dist/InventoryPage-DwfgCUQq.js +253 -0
- package/dist/{LiveTrackingPage-DQ1q4Id3.js → LiveTrackingPage-DCX-K-LR.js} +60 -56
- package/dist/MarketplacePage-CIQ97_zp.js +247 -0
- package/dist/{MetricCard-B7yMyvMX.js → MetricCard-BY0QrMD4.js} +1 -1
- package/dist/{OrderDetailsPage-CFASgsYX.js → OrderDetailsPage-DYiZ-9UK.js} +83 -85
- package/dist/{OrdersListPage-BHeT8S5o.js → OrdersListPage-BjDlCKJd.js} +31 -33
- package/dist/{PageLayout-D3N8MCTm.js → PageLayout-D4LDHJJq.js} +483 -422
- package/dist/ProductDetailsPage-C9uOiYLp.js +350 -0
- package/dist/{ProductsPage--xEpbQ8A.js → ProductsPage-C1G9h7Xd.js} +22 -24
- package/dist/ReportsPage-Zp53q3_8.js +284 -0
- package/dist/RouteDetailsPage-DUStXSf9.js +531 -0
- package/dist/RoutesPage-DMfoicM1.js +144 -0
- package/dist/SettingsPage-Bn-v0mbQ.js +421 -0
- package/dist/StatusBadge-BZurYHMy.js +152 -0
- package/dist/{TrackingPage-CcRc_dva.js → TrackingPage-W-jtdM3Y.js} +59 -61
- package/dist/VehicleDetailsPage-Bceo5oz3.js +410 -0
- package/dist/{VehiclesPage-UlxPWP9K.js → VehiclesPage-VBtOep91.js} +20 -22
- package/dist/WarehouseDetailsPage-L_6sWigM.js +493 -0
- package/dist/{WarehousesPage-CuTO-OPp.js → WarehousesPage-DCbXXXWE.js} +16 -18
- package/dist/{arrow-left-CBpZKkpq.js → arrow-left-n48Y-Wis.js} +1 -1
- package/dist/{box-CAaiElsb.js → box-D9Pal4HM.js} +1 -1
- package/dist/{chart-column-D1Ym15-S.js → chart-column-BFIJysDR.js} +1 -1
- package/dist/{chevron-right-BIFGi0UA.js → chevron-right-EMIIyyJ1.js} +1 -1
- package/dist/{circle-alert-DjmNo5_L.js → circle-alert-iY24lSlp.js} +1 -1
- package/dist/{circle-check-big-CjuPVo3_.js → circle-check-big-w0TrLKMF.js} +1 -1
- package/dist/{clock-BjkdnddD.js → clock-DJZtdl8u.js} +1 -1
- package/dist/{dollar-sign-IB4O0wuQ.js → dollar-sign-CgKQRz_e.js} +1 -1
- package/dist/{download-Dpa9vqoG.js → download-DRXxoiQR.js} +1 -1
- package/dist/{file-text-C8Uioy11.js → file-text-DWWY6_f5.js} +1 -1
- package/dist/{filter-Da5OZaHI.js → filter-DloLC2eE.js} +1 -1
- package/dist/index.js +186 -162
- package/dist/{map-_Per4sT9.js → map-CkJaULb2.js} +1 -1
- package/dist/{map-pin-BSaf5IDL.js → map-pin-BGiCvyCs.js} +1 -1
- package/dist/{navigation-DaTbrhw2.js → navigation-D36prnAn.js} +1 -1
- package/dist/{package-BE7U0wQE.js → package-BChUzpJS.js} +1 -1
- package/dist/{phone-DV4StZiA.js → phone-Ac9s3mo_.js} +1 -1
- package/dist/{plus-Dl1rLeJR.js → plus-Z76q-FZm.js} +1 -1
- package/dist/{refresh-cw-CWfERAit.js → refresh-cw-DKt6f5T6.js} +1 -1
- package/dist/{save-XH8vydOn.js → save-CojywNhG.js} +1 -1
- package/dist/{search-OxoIiL_C.js → search-CDGefqb3.js} +1 -1
- package/dist/{square-pen-hLIbFQFV.js → square-pen-CopE9GmB.js} +1 -1
- package/dist/{star-YsVV3MNQ.js → star-nHlLjDKR.js} +1 -1
- package/dist/{store-RCBl7HB-.js → store-BR9Voi5E.js} +1 -1
- package/dist/trash-2-BKhar6Hs.js +32 -0
- package/dist/{trending-up-C-85AwGT.js → trending-up-Dohgd4t_.js} +1 -1
- package/dist/{triangle-alert-BOhfGgmh.js → triangle-alert-i-XQL9Rd.js} +1 -1
- package/dist/{truck-CtDjNFbi.js → truck-C0v_hbLR.js} +1 -1
- package/dist/{useAnalytics-ph7eTIK6.js → useAnalytics-DS8n0xgg.js} +40 -40
- package/dist/useAssistant-D4v3oxD3.js +84 -0
- package/dist/{useCustomers-bS3a4ytk.js → useCustomers-BmTNGxiI.js} +24 -24
- package/dist/{useFleet-BdETplNE.js → useFleet-DKqXZ16m.js} +133 -109
- package/dist/useImportExport-DHr-SWSw.js +55 -0
- package/dist/{useInventory-Dwn18FPz.js → useInventory-DkyiVY_A.js} +95 -75
- package/dist/{useOrders-D_3_hGMp.js → useOrders-Cfk1GLiq.js} +42 -42
- package/dist/useReports-CTqZr-AB.js +78 -0
- package/dist/{useRoutes-v4aBaS-E.js → useRoutes-BQWO607N.js} +31 -31
- package/dist/useSettings-CkDH_-gM.js +81 -0
- package/dist/{useTracking-De2KIUNu.js → useTracking-B-va1kO3.js} +22 -22
- package/dist/{user-Dz5TJZFs.js → user-jyFU3lXk.js} +1 -1
- package/dist/{users-g2N0eL-Z.js → users-DZ-ilS6B.js} +1 -1
- package/dist/{warehouse-D3WWDeTX.js → warehouse-6m5kXMLu.js} +1 -1
- package/dist/{wrench-CmxY1n4I.js → wrench-CANXWxF-.js} +1 -1
- package/package.json +1 -1
- package/src/movethewheels/MoveTheWheelsRoutes.tsx +31 -3
- package/src/movethewheels/components/FormError.tsx +25 -0
- package/src/movethewheels/components/StatusBadge.tsx +18 -37
- package/src/movethewheels/constants/index.ts +67 -26
- package/src/movethewheels/hooks/index.ts +12 -0
- package/src/movethewheels/hooks/useAnalytics.ts +20 -6
- package/src/movethewheels/hooks/useAssistant.ts +74 -0
- package/src/movethewheels/hooks/useFleet.ts +170 -59
- package/src/movethewheels/hooks/useImportExport.ts +101 -0
- package/src/movethewheels/hooks/useInventory.ts +107 -0
- package/src/movethewheels/hooks/useReports.ts +158 -0
- package/src/movethewheels/hooks/useSettings.ts +120 -0
- package/src/movethewheels/pages/AIAssistantPage.tsx +53 -15
- package/src/movethewheels/pages/AnalyticsPage.tsx +67 -64
- package/src/movethewheels/pages/CustomerDetailsPage.tsx +154 -21
- package/src/movethewheels/pages/CustomersPage.tsx +1 -1
- package/src/movethewheels/pages/DashboardPage.tsx +42 -22
- package/src/movethewheels/pages/DriverDetailsPage.tsx +160 -3
- package/src/movethewheels/pages/DriversPage.tsx +6 -2
- package/src/movethewheels/pages/FleetPage.tsx +96 -38
- package/src/movethewheels/pages/ImportExportPage.tsx +174 -68
- package/src/movethewheels/pages/InventoryPage.tsx +66 -28
- package/src/movethewheels/pages/LiveTrackingPage.tsx +12 -3
- package/src/movethewheels/pages/MarketplacePage.tsx +87 -45
- package/src/movethewheels/pages/OrderDetailsPage.tsx +2 -2
- package/src/movethewheels/pages/ProductDetailsPage.tsx +146 -3
- package/src/movethewheels/pages/ProductsPage.tsx +5 -1
- package/src/movethewheels/pages/ReportsPage.tsx +194 -90
- package/src/movethewheels/pages/RouteDetailsPage.tsx +290 -36
- package/src/movethewheels/pages/RoutesPage.tsx +4 -9
- package/src/movethewheels/pages/SettingsPage.tsx +234 -56
- package/src/movethewheels/pages/TrackingPage.tsx +6 -6
- package/src/movethewheels/pages/VehicleDetailsPage.tsx +158 -2
- package/src/movethewheels/pages/VehiclesPage.tsx +5 -1
- package/src/movethewheels/pages/WarehouseDetailsPage.tsx +224 -2
- package/src/movethewheels/pages/WarehousesPage.tsx +5 -1
- package/src/movethewheels/providers/MoveTheWheelsProvider.tsx +7 -6
- package/src/movethewheels/store/movethewheelsStore.ts +1 -1
- package/dist/AnalyticsPage-CCLfHgQZ.js +0 -212
- package/dist/CustomerDetailsPage-I6cdDHUi.js +0 -265
- package/dist/DriverDetailsPage-rg_pGNuP.js +0 -330
- package/dist/FleetPage-DddXt8r8.js +0 -332
- package/dist/ImportExportPage-BW6qO3kc.js +0 -248
- package/dist/InventoryPage-rMGuaJN-.js +0 -222
- package/dist/MarketplacePage-DKrXAv62.js +0 -219
- package/dist/ProductDetailsPage-CFGcbaHo.js +0 -195
- package/dist/ReportsPage-Bb7_90rK.js +0 -235
- package/dist/RouteDetailsPage-CVtDVb1N.js +0 -282
- package/dist/RoutesPage-s57PtgcQ.js +0 -163
- package/dist/SettingsPage-BYNCBOpN.js +0 -298
- package/dist/StatusBadge-CijYQXtb.js +0 -209
- package/dist/VehicleDetailsPage-3YDMPsPs.js +0 -220
- package/dist/WarehouseDetailsPage-Db7KeN-d.js +0 -238
- package/dist/graphqlClient-CdJyR_ed.js +0 -55
- package/dist/navigation-BgnOfsVd.js +0 -6
- package/dist/route-Dp9JiN_E.js +0 -51
- package/dist/settings-3Rw5NwFF.js +0 -28
- package/src/movethewheels/constants/mockData.ts +0 -1342
- /package/dist/{formatters-_vJlC-47.js → formatters-CF2S2l1m.js} +0 -0
|
@@ -0,0 +1,410 @@
|
|
|
1
|
+
import { A as e, F as t, I as n, L as r, M as i, P as a, R as o, ct as s, d as c, f as l, g as u, h as d, i as f, j as p, l as m, n as h, ot as g, r as _, u as v } from "./PageLayout-D4LDHJJq.js";
|
|
2
|
+
import { t as y } from "./arrow-left-n48Y-Wis.js";
|
|
3
|
+
import { t as b } from "./file-text-DWWY6_f5.js";
|
|
4
|
+
import { n as x, t as S } from "./wrench-CANXWxF-.js";
|
|
5
|
+
import { t as C } from "./map-pin-BGiCvyCs.js";
|
|
6
|
+
import { t as w } from "./save-CojywNhG.js";
|
|
7
|
+
import { t as T } from "./square-pen-CopE9GmB.js";
|
|
8
|
+
import { t as E } from "./truck-C0v_hbLR.js";
|
|
9
|
+
import { a as D, r as O } from "./useFleet-DKqXZ16m.js";
|
|
10
|
+
import { a as k, r as A } from "./StatusBadge-BZurYHMy.js";
|
|
11
|
+
import { r as j } from "./formatters-CF2S2l1m.js";
|
|
12
|
+
import { t as M } from "./FormError-BlOjnXOq.js";
|
|
13
|
+
import { useState as N } from "react";
|
|
14
|
+
import { useParams as P } from "react-router-dom";
|
|
15
|
+
import { jsx as F, jsxs as I } from "react/jsx-runtime";
|
|
16
|
+
import { EmphasisPanel as L, NextSteps as R, PagePurpose as z } from "@burdenoff/fe-libs/ui";
|
|
17
|
+
//#region src/movethewheels/pages/VehicleDetailsPage.tsx
|
|
18
|
+
var B = [
|
|
19
|
+
{
|
|
20
|
+
value: "TRUCK",
|
|
21
|
+
label: "Truck"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
value: "VAN",
|
|
25
|
+
label: "Van"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
value: "MOTORCYCLE",
|
|
29
|
+
label: "Motorcycle"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
value: "BICYCLE",
|
|
33
|
+
label: "Bicycle"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
value: "FLATBED",
|
|
37
|
+
label: "Flatbed"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
value: "REFRIGERATED",
|
|
41
|
+
label: "Refrigerated"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
value: "SEMI_TRAILER",
|
|
45
|
+
label: "Semi-Trailer"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
value: "DRONE",
|
|
49
|
+
label: "Drone"
|
|
50
|
+
}
|
|
51
|
+
];
|
|
52
|
+
function V() {
|
|
53
|
+
let { basePath: i, navigate: c } = g(), { createVehicle: l } = O(), [u, d] = N({
|
|
54
|
+
vehicleNumber: "",
|
|
55
|
+
type: "VAN",
|
|
56
|
+
make: "",
|
|
57
|
+
model: "",
|
|
58
|
+
licensePlate: ""
|
|
59
|
+
}), [m, h] = N(!1), [_, b] = N(null), x = () => c?.(s(i, "fleet/vehicles")), S = async (e) => {
|
|
60
|
+
if (e.preventDefault(), !u.vehicleNumber.trim()) {
|
|
61
|
+
b("Vehicle number is required.");
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
h(!0), b(null);
|
|
65
|
+
try {
|
|
66
|
+
let e = await l({
|
|
67
|
+
vehicleNumber: u.vehicleNumber.trim(),
|
|
68
|
+
type: u.type,
|
|
69
|
+
make: u.make.trim() || void 0,
|
|
70
|
+
model: u.model.trim() || void 0,
|
|
71
|
+
licensePlate: u.licensePlate.trim() || void 0
|
|
72
|
+
});
|
|
73
|
+
c?.(s(i, `fleet/vehicles/${e.id}`));
|
|
74
|
+
} catch (e) {
|
|
75
|
+
console.error("Failed to create vehicle:", e), b(e instanceof Error ? e.message : "Failed to create vehicle. Please try again."), h(!1);
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
return /* @__PURE__ */ I(f, {
|
|
79
|
+
title: "Add Vehicle",
|
|
80
|
+
subtitle: "Register a new vehicle in your fleet",
|
|
81
|
+
icon: /* @__PURE__ */ F(E, { size: 24 }),
|
|
82
|
+
headerActions: /* @__PURE__ */ I("div", {
|
|
83
|
+
className: "flex gap-2",
|
|
84
|
+
children: [/* @__PURE__ */ I(v, {
|
|
85
|
+
variant: "outline",
|
|
86
|
+
onClick: x,
|
|
87
|
+
disabled: m,
|
|
88
|
+
children: [/* @__PURE__ */ F(y, { size: 16 }), " Cancel"]
|
|
89
|
+
}), /* @__PURE__ */ I(v, {
|
|
90
|
+
onClick: S,
|
|
91
|
+
disabled: m,
|
|
92
|
+
children: [
|
|
93
|
+
/* @__PURE__ */ F(w, { size: 16 }),
|
|
94
|
+
" ",
|
|
95
|
+
m ? "Saving..." : "Add Vehicle"
|
|
96
|
+
]
|
|
97
|
+
})]
|
|
98
|
+
}),
|
|
99
|
+
children: [/* @__PURE__ */ F(z, {
|
|
100
|
+
icon: /* @__PURE__ */ F(E, { size: 18 }),
|
|
101
|
+
children: "Add a vehicle so it can be assigned to deliveries and routes. Give it a fleet number and type to start — make, model and plate help identify it on the road."
|
|
102
|
+
}), /* @__PURE__ */ I("form", {
|
|
103
|
+
onSubmit: S,
|
|
104
|
+
className: "max-w-2xl space-y-6",
|
|
105
|
+
children: [/* @__PURE__ */ F(M, { message: _ }), /* @__PURE__ */ I(L, { children: [/* @__PURE__ */ F("h2", {
|
|
106
|
+
className: "text-base font-semibold text-text-primary mb-4",
|
|
107
|
+
children: "Vehicle Details"
|
|
108
|
+
}), /* @__PURE__ */ I("div", {
|
|
109
|
+
className: "space-y-4",
|
|
110
|
+
children: [/* @__PURE__ */ I("div", {
|
|
111
|
+
className: "grid grid-cols-1 md:grid-cols-2 gap-4",
|
|
112
|
+
children: [/* @__PURE__ */ I("div", {
|
|
113
|
+
className: "space-y-2",
|
|
114
|
+
children: [/* @__PURE__ */ I(p, {
|
|
115
|
+
htmlFor: "vehicleNumber",
|
|
116
|
+
children: ["Vehicle Number ", /* @__PURE__ */ F("span", {
|
|
117
|
+
className: "text-status-error-text",
|
|
118
|
+
children: "*"
|
|
119
|
+
})]
|
|
120
|
+
}), /* @__PURE__ */ F(e, {
|
|
121
|
+
id: "vehicleNumber",
|
|
122
|
+
value: u.vehicleNumber,
|
|
123
|
+
onChange: (e) => d((t) => ({
|
|
124
|
+
...t,
|
|
125
|
+
vehicleNumber: e.target.value
|
|
126
|
+
})),
|
|
127
|
+
placeholder: "MTW-001",
|
|
128
|
+
required: !0
|
|
129
|
+
})]
|
|
130
|
+
}), /* @__PURE__ */ I("div", {
|
|
131
|
+
className: "space-y-2",
|
|
132
|
+
children: [/* @__PURE__ */ I(p, {
|
|
133
|
+
htmlFor: "type",
|
|
134
|
+
children: ["Type ", /* @__PURE__ */ F("span", {
|
|
135
|
+
className: "text-status-error-text",
|
|
136
|
+
children: "*"
|
|
137
|
+
})]
|
|
138
|
+
}), /* @__PURE__ */ I(a, {
|
|
139
|
+
value: u.type,
|
|
140
|
+
onValueChange: (e) => d((t) => ({
|
|
141
|
+
...t,
|
|
142
|
+
type: e
|
|
143
|
+
})),
|
|
144
|
+
children: [/* @__PURE__ */ F(r, {
|
|
145
|
+
id: "type",
|
|
146
|
+
children: /* @__PURE__ */ F(o, {})
|
|
147
|
+
}), /* @__PURE__ */ F(t, { children: B.map((e) => /* @__PURE__ */ F(n, {
|
|
148
|
+
value: e.value,
|
|
149
|
+
children: e.label
|
|
150
|
+
}, e.value)) })]
|
|
151
|
+
})]
|
|
152
|
+
})]
|
|
153
|
+
}), /* @__PURE__ */ I("div", {
|
|
154
|
+
className: "grid grid-cols-1 md:grid-cols-3 gap-4",
|
|
155
|
+
children: [
|
|
156
|
+
/* @__PURE__ */ I("div", {
|
|
157
|
+
className: "space-y-2",
|
|
158
|
+
children: [/* @__PURE__ */ F(p, {
|
|
159
|
+
htmlFor: "make",
|
|
160
|
+
children: "Make"
|
|
161
|
+
}), /* @__PURE__ */ F(e, {
|
|
162
|
+
id: "make",
|
|
163
|
+
value: u.make,
|
|
164
|
+
onChange: (e) => d((t) => ({
|
|
165
|
+
...t,
|
|
166
|
+
make: e.target.value
|
|
167
|
+
})),
|
|
168
|
+
placeholder: "Ford"
|
|
169
|
+
})]
|
|
170
|
+
}),
|
|
171
|
+
/* @__PURE__ */ I("div", {
|
|
172
|
+
className: "space-y-2",
|
|
173
|
+
children: [/* @__PURE__ */ F(p, {
|
|
174
|
+
htmlFor: "model",
|
|
175
|
+
children: "Model"
|
|
176
|
+
}), /* @__PURE__ */ F(e, {
|
|
177
|
+
id: "model",
|
|
178
|
+
value: u.model,
|
|
179
|
+
onChange: (e) => d((t) => ({
|
|
180
|
+
...t,
|
|
181
|
+
model: e.target.value
|
|
182
|
+
})),
|
|
183
|
+
placeholder: "Transit"
|
|
184
|
+
})]
|
|
185
|
+
}),
|
|
186
|
+
/* @__PURE__ */ I("div", {
|
|
187
|
+
className: "space-y-2",
|
|
188
|
+
children: [/* @__PURE__ */ F(p, {
|
|
189
|
+
htmlFor: "licensePlate",
|
|
190
|
+
children: "License Plate"
|
|
191
|
+
}), /* @__PURE__ */ F(e, {
|
|
192
|
+
id: "licensePlate",
|
|
193
|
+
value: u.licensePlate,
|
|
194
|
+
onChange: (e) => d((t) => ({
|
|
195
|
+
...t,
|
|
196
|
+
licensePlate: e.target.value
|
|
197
|
+
})),
|
|
198
|
+
placeholder: "ABC-1234"
|
|
199
|
+
})]
|
|
200
|
+
})
|
|
201
|
+
]
|
|
202
|
+
})]
|
|
203
|
+
})] })]
|
|
204
|
+
})]
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
function H() {
|
|
208
|
+
let { vehicleId: e } = P(), { basePath: t, navigate: n } = g(), { vehicle: r, isLoading: a, error: o, refetch: p } = D(e), w = () => n?.(s(t, "fleet/vehicles")), O = (e) => n?.(s(t, e));
|
|
209
|
+
return e ? a ? /* @__PURE__ */ F(_, { message: "Loading vehicle details..." }) : o || !r ? /* @__PURE__ */ F(h, {
|
|
210
|
+
title: "Vehicle not found",
|
|
211
|
+
onRetry: p
|
|
212
|
+
}) : /* @__PURE__ */ I(f, {
|
|
213
|
+
title: r.vehicleNumber,
|
|
214
|
+
subtitle: `${r.make} ${r.model} (${r.year})`,
|
|
215
|
+
icon: /* @__PURE__ */ F(E, { size: 24 }),
|
|
216
|
+
headerActions: /* @__PURE__ */ I("div", {
|
|
217
|
+
className: "flex gap-2",
|
|
218
|
+
children: [/* @__PURE__ */ I(v, {
|
|
219
|
+
variant: "outline",
|
|
220
|
+
onClick: w,
|
|
221
|
+
children: [/* @__PURE__ */ F(y, { size: 16 }), " Back"]
|
|
222
|
+
}), /* @__PURE__ */ I(v, { children: [/* @__PURE__ */ F(T, { size: 16 }), " Edit"] })]
|
|
223
|
+
}),
|
|
224
|
+
headerContent: /* @__PURE__ */ I("div", {
|
|
225
|
+
className: "flex gap-2",
|
|
226
|
+
children: [/* @__PURE__ */ F(A, {
|
|
227
|
+
status: r.status,
|
|
228
|
+
type: "vehicle"
|
|
229
|
+
}), /* @__PURE__ */ F(k, { type: r.type })]
|
|
230
|
+
}),
|
|
231
|
+
children: [
|
|
232
|
+
/* @__PURE__ */ F(z, {
|
|
233
|
+
icon: /* @__PURE__ */ F(E, { size: 18 }),
|
|
234
|
+
children: "The full record for this vehicle — specs, capacity, fuel and mileage, maintenance schedule and current location. Use it to confirm a vehicle is fuelled, serviced and the right size before dispatching it on a delivery."
|
|
235
|
+
}),
|
|
236
|
+
/* @__PURE__ */ F(R, {
|
|
237
|
+
storageKey: "movethewheels-vehicle-details",
|
|
238
|
+
steps: [{
|
|
239
|
+
id: "assign",
|
|
240
|
+
label: "Assign to a delivery",
|
|
241
|
+
description: "Put this vehicle on an order that fits its capacity.",
|
|
242
|
+
icon: /* @__PURE__ */ F(C, { size: 16 }),
|
|
243
|
+
onClick: () => O("orders")
|
|
244
|
+
}, {
|
|
245
|
+
id: "maintenance",
|
|
246
|
+
label: "Schedule maintenance",
|
|
247
|
+
description: "Keep it road-ready and compliant.",
|
|
248
|
+
icon: /* @__PURE__ */ F(S, { size: 16 }),
|
|
249
|
+
onClick: () => {}
|
|
250
|
+
}]
|
|
251
|
+
}),
|
|
252
|
+
/* @__PURE__ */ I("div", {
|
|
253
|
+
className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
|
|
254
|
+
children: [/* @__PURE__ */ I("div", {
|
|
255
|
+
className: "lg:col-span-2 space-y-6",
|
|
256
|
+
children: [
|
|
257
|
+
/* @__PURE__ */ I(L, { children: [/* @__PURE__ */ F("h2", {
|
|
258
|
+
className: "text-base font-semibold text-text-primary mb-4",
|
|
259
|
+
children: "Vehicle Information"
|
|
260
|
+
}), /* @__PURE__ */ I("div", {
|
|
261
|
+
className: "grid grid-cols-2 md:grid-cols-4 gap-6",
|
|
262
|
+
children: [
|
|
263
|
+
/* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("p", {
|
|
264
|
+
className: "text-sm text-text-secondary",
|
|
265
|
+
children: "Type"
|
|
266
|
+
}), /* @__PURE__ */ F("p", {
|
|
267
|
+
className: "font-medium capitalize",
|
|
268
|
+
children: r.type
|
|
269
|
+
})] }),
|
|
270
|
+
/* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("p", {
|
|
271
|
+
className: "text-sm text-text-secondary",
|
|
272
|
+
children: "Make"
|
|
273
|
+
}), /* @__PURE__ */ F("p", {
|
|
274
|
+
className: "font-medium",
|
|
275
|
+
children: r.make
|
|
276
|
+
})] }),
|
|
277
|
+
/* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("p", {
|
|
278
|
+
className: "text-sm text-text-secondary",
|
|
279
|
+
children: "Model"
|
|
280
|
+
}), /* @__PURE__ */ F("p", {
|
|
281
|
+
className: "font-medium",
|
|
282
|
+
children: r.model
|
|
283
|
+
})] }),
|
|
284
|
+
/* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("p", {
|
|
285
|
+
className: "text-sm text-text-secondary",
|
|
286
|
+
children: "Year"
|
|
287
|
+
}), /* @__PURE__ */ F("p", {
|
|
288
|
+
className: "font-medium",
|
|
289
|
+
children: r.year
|
|
290
|
+
})] })
|
|
291
|
+
]
|
|
292
|
+
})] }),
|
|
293
|
+
/* @__PURE__ */ I(c, { children: [/* @__PURE__ */ F(d, { children: /* @__PURE__ */ F(u, { children: "Capacity" }) }), /* @__PURE__ */ F(l, { children: /* @__PURE__ */ I("div", {
|
|
294
|
+
className: "grid grid-cols-3 gap-6",
|
|
295
|
+
children: [
|
|
296
|
+
/* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("p", {
|
|
297
|
+
className: "text-sm text-text-secondary",
|
|
298
|
+
children: "Weight"
|
|
299
|
+
}), /* @__PURE__ */ I("p", {
|
|
300
|
+
className: "text-2xl font-bold",
|
|
301
|
+
children: [r.capacity.weight, /* @__PURE__ */ F("span", {
|
|
302
|
+
className: "text-sm font-normal",
|
|
303
|
+
children: " kg"
|
|
304
|
+
})]
|
|
305
|
+
})] }),
|
|
306
|
+
/* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("p", {
|
|
307
|
+
className: "text-sm text-text-secondary",
|
|
308
|
+
children: "Volume"
|
|
309
|
+
}), /* @__PURE__ */ I("p", {
|
|
310
|
+
className: "text-2xl font-bold",
|
|
311
|
+
children: [r.capacity.volume, /* @__PURE__ */ F("span", {
|
|
312
|
+
className: "text-sm font-normal",
|
|
313
|
+
children: " m³"
|
|
314
|
+
})]
|
|
315
|
+
})] }),
|
|
316
|
+
r.capacity.pallets && /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("p", {
|
|
317
|
+
className: "text-sm text-text-secondary",
|
|
318
|
+
children: "Pallets"
|
|
319
|
+
}), /* @__PURE__ */ F("p", {
|
|
320
|
+
className: "text-2xl font-bold",
|
|
321
|
+
children: r.capacity.pallets
|
|
322
|
+
})] })
|
|
323
|
+
]
|
|
324
|
+
}) })] }),
|
|
325
|
+
/* @__PURE__ */ I(c, { children: [/* @__PURE__ */ F(d, { children: /* @__PURE__ */ I(u, {
|
|
326
|
+
className: "flex items-center gap-2",
|
|
327
|
+
children: [/* @__PURE__ */ F(b, { size: 18 }), " Documents"]
|
|
328
|
+
}) }), /* @__PURE__ */ F(l, { children: r.documents.length > 0 ? /* @__PURE__ */ F("div", {
|
|
329
|
+
className: "space-y-3",
|
|
330
|
+
children: r.documents.map((e) => /* @__PURE__ */ I("div", {
|
|
331
|
+
className: "flex items-center justify-between p-3 border rounded-lg",
|
|
332
|
+
children: [/* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("p", {
|
|
333
|
+
className: "font-medium capitalize",
|
|
334
|
+
children: e.type.replace("_", " ")
|
|
335
|
+
}), /* @__PURE__ */ I("p", {
|
|
336
|
+
className: "text-sm text-text-secondary",
|
|
337
|
+
children: ["Expires: ", j(e.expiryDate)]
|
|
338
|
+
})] }), /* @__PURE__ */ F(m, {
|
|
339
|
+
variant: e.verified ? "default" : "secondary",
|
|
340
|
+
children: e.verified ? "Verified" : "Pending"
|
|
341
|
+
})]
|
|
342
|
+
}, e.id))
|
|
343
|
+
}) : /* @__PURE__ */ F("p", {
|
|
344
|
+
className: "text-text-secondary text-center py-4",
|
|
345
|
+
children: "No documents uploaded"
|
|
346
|
+
}) })] })
|
|
347
|
+
]
|
|
348
|
+
}), /* @__PURE__ */ I("div", {
|
|
349
|
+
className: "space-y-6",
|
|
350
|
+
children: [
|
|
351
|
+
/* @__PURE__ */ I(c, { children: [/* @__PURE__ */ F(d, { children: /* @__PURE__ */ I(u, {
|
|
352
|
+
className: "flex items-center gap-2",
|
|
353
|
+
children: [/* @__PURE__ */ F(x, { size: 18 }), " Fuel & Mileage"]
|
|
354
|
+
}) }), /* @__PURE__ */ I(l, {
|
|
355
|
+
className: "space-y-4",
|
|
356
|
+
children: [r.fuelLevel !== void 0 && /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ I("div", {
|
|
357
|
+
className: "flex justify-between text-sm mb-2",
|
|
358
|
+
children: [/* @__PURE__ */ F("span", { children: "Fuel Level" }), /* @__PURE__ */ I("span", { children: [r.fuelLevel, "%"] })]
|
|
359
|
+
}), /* @__PURE__ */ F(i, { value: r.fuelLevel })] }), r.mileage !== void 0 && /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("p", {
|
|
360
|
+
className: "text-sm text-text-secondary",
|
|
361
|
+
children: "Total Mileage"
|
|
362
|
+
}), /* @__PURE__ */ I("p", {
|
|
363
|
+
className: "text-2xl font-bold",
|
|
364
|
+
children: [
|
|
365
|
+
r.mileage.toLocaleString(),
|
|
366
|
+
" ",
|
|
367
|
+
/* @__PURE__ */ F("span", {
|
|
368
|
+
className: "text-sm font-normal",
|
|
369
|
+
children: "miles"
|
|
370
|
+
})
|
|
371
|
+
]
|
|
372
|
+
})] })]
|
|
373
|
+
})] }),
|
|
374
|
+
/* @__PURE__ */ I(c, { children: [/* @__PURE__ */ F(d, { children: /* @__PURE__ */ I(u, {
|
|
375
|
+
className: "flex items-center gap-2",
|
|
376
|
+
children: [/* @__PURE__ */ F(S, { size: 18 }), " Maintenance"]
|
|
377
|
+
}) }), /* @__PURE__ */ I(l, {
|
|
378
|
+
className: "space-y-3",
|
|
379
|
+
children: [/* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("p", {
|
|
380
|
+
className: "text-sm text-text-secondary",
|
|
381
|
+
children: "Last Maintenance"
|
|
382
|
+
}), /* @__PURE__ */ F("p", {
|
|
383
|
+
className: "font-medium",
|
|
384
|
+
children: r.lastMaintenance ? j(r.lastMaintenance) : "N/A"
|
|
385
|
+
})] }), /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("p", {
|
|
386
|
+
className: "text-sm text-text-secondary",
|
|
387
|
+
children: "Next Scheduled"
|
|
388
|
+
}), /* @__PURE__ */ F("p", {
|
|
389
|
+
className: "font-medium",
|
|
390
|
+
children: r.nextMaintenance ? j(r.nextMaintenance) : "N/A"
|
|
391
|
+
})] })]
|
|
392
|
+
})] }),
|
|
393
|
+
r.currentLocation && /* @__PURE__ */ I(c, { children: [/* @__PURE__ */ F(d, { children: /* @__PURE__ */ I(u, {
|
|
394
|
+
className: "flex items-center gap-2",
|
|
395
|
+
children: [/* @__PURE__ */ F(C, { size: 18 }), " Current Location"]
|
|
396
|
+
}) }), /* @__PURE__ */ I(l, { children: [/* @__PURE__ */ F("p", {
|
|
397
|
+
className: "text-sm",
|
|
398
|
+
children: r.currentLocation.address || "Location updating..."
|
|
399
|
+
}), /* @__PURE__ */ I("p", {
|
|
400
|
+
className: "text-xs text-text-secondary mt-1",
|
|
401
|
+
children: ["Updated ", j(r.currentLocation.timestamp || /* @__PURE__ */ new Date(), "relative")]
|
|
402
|
+
})] })] })
|
|
403
|
+
]
|
|
404
|
+
})]
|
|
405
|
+
})
|
|
406
|
+
]
|
|
407
|
+
}) : /* @__PURE__ */ F(V, {});
|
|
408
|
+
}
|
|
409
|
+
//#endregion
|
|
410
|
+
export { H as default };
|
|
@@ -1,43 +1,41 @@
|
|
|
1
|
-
import { M as e,
|
|
2
|
-
import { t as
|
|
3
|
-
import { t as
|
|
4
|
-
import { t as
|
|
5
|
-
import { t as
|
|
6
|
-
import { t as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { a as l, r as u } from "./StatusBadge-CijYQXtb.js";
|
|
10
|
-
import { t as d } from "./navigation-BgnOfsVd.js";
|
|
1
|
+
import { M as e, ct as t, i as n, ot as r } from "./PageLayout-D4LDHJJq.js";
|
|
2
|
+
import { t as i } from "./DataTable-DmciIKKM.js";
|
|
3
|
+
import { t as a } from "./download-DRXxoiQR.js";
|
|
4
|
+
import { t as o } from "./plus-Z76q-FZm.js";
|
|
5
|
+
import { t as s } from "./refresh-cw-DKt6f5T6.js";
|
|
6
|
+
import { t as c } from "./truck-C0v_hbLR.js";
|
|
7
|
+
import { o as l } from "./useFleet-DKqXZ16m.js";
|
|
8
|
+
import { a as u, r as d } from "./StatusBadge-BZurYHMy.js";
|
|
11
9
|
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
12
10
|
import { CTAOverflowMenu as m, EmphasisPanel as h, PagePurpose as g } from "@burdenoff/fe-libs/ui";
|
|
13
11
|
//#region src/movethewheels/pages/VehiclesPage.tsx
|
|
14
12
|
function _() {
|
|
15
|
-
let { basePath: _, navigate: v } =
|
|
16
|
-
v && v(
|
|
13
|
+
let { basePath: _, navigate: v } = r(), { vehicles: y, totalVehicles: b, isLoading: x, refetch: S } = l(), C = (e) => {
|
|
14
|
+
v && v(t(_, e));
|
|
17
15
|
};
|
|
18
|
-
return /* @__PURE__ */ p(
|
|
16
|
+
return /* @__PURE__ */ p(n, {
|
|
19
17
|
title: "Vehicles",
|
|
20
18
|
subtitle: `${b} vehicles in fleet`,
|
|
21
|
-
icon: /* @__PURE__ */ f(
|
|
19
|
+
icon: /* @__PURE__ */ f(c, { size: 24 }),
|
|
22
20
|
headerActions: /* @__PURE__ */ f(m, {
|
|
23
21
|
primary: {
|
|
24
22
|
label: "Add Vehicle",
|
|
25
|
-
icon: /* @__PURE__ */ f(
|
|
26
|
-
onSelect: () =>
|
|
23
|
+
icon: /* @__PURE__ */ f(o, { size: 16 }),
|
|
24
|
+
onSelect: () => C("fleet/vehicles/new")
|
|
27
25
|
},
|
|
28
26
|
actions: [{
|
|
29
27
|
label: "Refresh",
|
|
30
|
-
icon: /* @__PURE__ */ f(
|
|
28
|
+
icon: /* @__PURE__ */ f(s, { size: 16 }),
|
|
31
29
|
onSelect: () => S()
|
|
32
30
|
}, {
|
|
33
31
|
label: "Export",
|
|
34
|
-
icon: /* @__PURE__ */ f(
|
|
32
|
+
icon: /* @__PURE__ */ f(a, { size: 16 }),
|
|
35
33
|
onSelect: () => {}
|
|
36
34
|
}]
|
|
37
35
|
}),
|
|
38
36
|
children: [
|
|
39
37
|
/* @__PURE__ */ f(g, {
|
|
40
|
-
icon: /* @__PURE__ */ f(
|
|
38
|
+
icon: /* @__PURE__ */ f(c, { size: 18 }),
|
|
41
39
|
children: "Every truck, van and bike in your fleet. Monitor capacity, fuel level, mileage and maintenance status here so you always know which vehicles are road-ready before dispatching an order."
|
|
42
40
|
}),
|
|
43
41
|
/* @__PURE__ */ p(h, { children: [/* @__PURE__ */ f("p", {
|
|
@@ -69,7 +67,7 @@ function _() {
|
|
|
69
67
|
})] })
|
|
70
68
|
]
|
|
71
69
|
})] }),
|
|
72
|
-
/* @__PURE__ */ f(
|
|
70
|
+
/* @__PURE__ */ f(i, {
|
|
73
71
|
columns: [
|
|
74
72
|
{
|
|
75
73
|
id: "vehicleNumber",
|
|
@@ -85,7 +83,7 @@ function _() {
|
|
|
85
83
|
id: "type",
|
|
86
84
|
header: "Type",
|
|
87
85
|
accessorKey: "type",
|
|
88
|
-
cell: (e) => /* @__PURE__ */ f(
|
|
86
|
+
cell: (e) => /* @__PURE__ */ f(u, { type: e.type })
|
|
89
87
|
},
|
|
90
88
|
{
|
|
91
89
|
id: "details",
|
|
@@ -107,7 +105,7 @@ function _() {
|
|
|
107
105
|
header: "Status",
|
|
108
106
|
accessorKey: "status",
|
|
109
107
|
sortable: !0,
|
|
110
|
-
cell: (e) => /* @__PURE__ */ f(
|
|
108
|
+
cell: (e) => /* @__PURE__ */ f(d, {
|
|
111
109
|
status: e.status,
|
|
112
110
|
type: "vehicle"
|
|
113
111
|
})
|