@burdenoff/microfe-movethewheels 2026.703.7 → 2026.704.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/{AIAssistantPage-B7FGmmKT.js → AIAssistantPage-MWJLAMN_.js} +5 -5
- package/dist/{AnalyticsPage-DXduj5KB.js → AnalyticsPage-900jpV2T.js} +9 -9
- package/dist/{CreateOrderPage-DuJJQ16b.js → CreateOrderPage-CXbhJLLz.js} +164 -139
- package/dist/{CustomerDetailsPage-C98SKw7Z.js → CustomerDetailsPage-CHzg75Q5.js} +16 -16
- package/dist/{CustomersPage-s8hK55JL.js → CustomersPage-CwtVspuq.js} +11 -11
- package/dist/{DashboardPage-BsEgcKEN.js → DashboardPage-BoswH3ec.js} +17 -17
- package/dist/{DataTable-Da7yHjM1.js → DataTable-CmdZd6iV.js} +7 -7
- package/dist/{DocumentsCard-CziaTJhP.js → DocumentsCard-y2ybnAlu.js} +4 -4
- package/dist/DriverDetailsPage-CPO0G8Ki.js +518 -0
- package/dist/{DriversPage-Duy_ITG6.js → DriversPage-6Z61dpDI.js} +11 -11
- package/dist/{FinancePage-BZtPTpmT.js → FinancePage-DYadOUzC.js} +9 -9
- package/dist/{FleetPage-DJfzoHbs.js → FleetPage-qWRj7WFO.js} +10 -10
- package/dist/{FormError-CWjGwOW8.js → FormError-D4T5FWZA.js} +1 -1
- package/dist/{ImportExportPage-DJ77GK_7.js → ImportExportPage-BhWGfbH3.js} +6 -6
- package/dist/{InventoryPage-Dpnwk_N3.js → InventoryPage-DbR4Z--d.js} +10 -10
- package/dist/{LiveTrackingPage-CLlvsP1B.js → LiveTrackingPage-5U68u3oA.js} +10 -10
- package/dist/{MarketplacePage-d99r-v6p.js → MarketplacePage-DMH0HNDH.js} +9 -9
- package/dist/{MetricCard-DA5ZqAVl.js → MetricCard-CqU5WsyW.js} +2 -2
- package/dist/{Notice-kkjV2rLR.js → Notice-BrXJ85dA.js} +2 -2
- package/dist/{OrderDetailsPage-BePtkyN0.js → OrderDetailsPage-DRYifXm9.js} +28 -24
- package/dist/{OrdersListPage-Csy_KScx.js → OrdersListPage-DvICveRv.js} +14 -14
- package/dist/{PageLayout-h_q9l8af.js → PageLayout-j9Zw3wBN.js} +579 -561
- package/dist/ProductDetailsPage-CWgcRqGR.js +375 -0
- package/dist/{ProductsPage-B4jWJ5bv.js → ProductsPage-CokwDOR2.js} +9 -9
- package/dist/{ReportsPage-ALRYfXtz.js → ReportsPage-MU8F9DQC.js} +9 -9
- package/dist/RouteDetailsPage-BHQbFgI9.js +642 -0
- package/dist/{RoutesPage-CQHCDInT.js → RoutesPage-Dqd5Don6.js} +7 -7
- package/dist/{SettingsPage-BYBRrlGe.js → SettingsPage-_6SIlcBX.js} +4 -4
- package/dist/{Sparkline-Q-6bJ24J.js → Sparkline-DTGdlxUH.js} +1 -1
- package/dist/{StatusBadge-1W2p8fEi.js → StatusBadge-BfiF-nNI.js} +1 -1
- package/dist/{TrackingPage-CFndTIyk.js → TrackingPage-Cg0tYGJe.js} +11 -11
- package/dist/VehicleDetailsPage-BbZlCFPo.js +417 -0
- package/dist/{VehiclesPage-ClkfFZxL.js → VehiclesPage-BfBEyXGs.js} +12 -12
- package/dist/WarehouseDetailsPage-DxNhiaoI.js +515 -0
- package/dist/{WarehousesPage-kNba6cr3.js → WarehousesPage-M3NaBT0z.js} +8 -8
- package/dist/{arrow-left-XOzFvBFD.js → arrow-left-1dVWv2dg.js} +1 -1
- package/dist/{arrow-right-CRrwlvFe.js → arrow-right-PUCNATnk.js} +1 -1
- package/dist/{arrow-up-ClFaLPly.js → arrow-up-VQuGMABN.js} +1 -1
- package/dist/{box-BX4WyCLv.js → box-DW1KNP8j.js} +1 -1
- package/dist/{boxes-R3nq5f0_.js → boxes-D6I00XqA.js} +1 -1
- package/dist/{chart-column-BgF8J9bx.js → chart-column-BwQ5H9ol.js} +1 -1
- package/dist/{charts-BS_OnWc6.js → charts-Dv_zxP7L.js} +2 -2
- package/dist/{chevron-left-D3hcLQ1g.js → chevron-left-DzNxoaBG.js} +1 -1
- package/dist/{chevron-right-BpfSrzQF.js → chevron-right-CKm3ZC1T.js} +1 -1
- package/dist/{circle-alert-CLqT8iCQ.js → circle-alert-CtBm6oIb.js} +1 -1
- package/dist/{circle-check-CWLAr_8f.js → circle-check-B_Y7FDyR.js} +1 -1
- package/dist/{circle-check-big-Dsuz8dJ2.js → circle-check-big-H5pLiMBW.js} +1 -1
- package/dist/{clock-DrZOQD8h.js → clock-B4-qjGuB.js} +1 -1
- package/dist/{dollar-sign-CJfKfYul.js → dollar-sign-CYGHy2oS.js} +1 -1
- package/dist/{download-C-yNvUiL.js → download-BJonq2ty.js} +1 -1
- package/dist/{file-text-m2SyQgBo.js → file-text-C-cZx58r.js} +1 -1
- package/dist/{filter-uA6govE9.js → filter-B_S6WOqr.js} +1 -1
- package/dist/{fuel-BroSIBo1.js → fuel-Cjt6IxKr.js} +1 -1
- package/dist/index.js +53 -33
- package/dist/{map-BzwQ__kD.js → map-CO0aWUae.js} +1 -1
- package/dist/{map-pin-BGbmEGn3.js → map-pin-BISLzLwb.js} +1 -1
- package/dist/{maps-DpIuSSmg.js → maps-CtfuCAmh.js} +1 -1
- package/dist/{navigation-CjKGLL9T.js → navigation-BFki5UJz.js} +1 -1
- package/dist/{package-D36cKFvu.js → package-UyaWiALC.js} +1 -1
- package/dist/{phone-mMZFHd1Z.js → phone-Bav_V7rR.js} +1 -1
- package/dist/{plus-DY5R-c1j.js → plus-Bk_G-lFC.js} +1 -1
- package/dist/{refresh-cw-DyOLYuDU.js → refresh-cw-C4-jecjy.js} +1 -1
- package/dist/{route-CuaZ1wU3.js → route-WpCP6F1x.js} +1 -1
- package/dist/{save-h9dzHwJE.js → save-CcfoIn2J.js} +1 -1
- package/dist/{search-stTGSec-.js → search-C3YRxW9e.js} +1 -1
- package/dist/{square-pen-DT5srCPD.js → square-pen-Dr1X-P2s.js} +1 -1
- package/dist/{star-gp4yO3PF.js → star-1Ixfuzai.js} +1 -1
- package/dist/{store-DJZDAvCY.js → store-BwU935v5.js} +1 -1
- package/dist/{trash-2-DwcjTxYE.js → trash-2-CC4KugEJ.js} +1 -1
- package/dist/{trending-up-2q2sPVsb.js → trending-up-1brglj1E.js} +1 -1
- package/dist/{triangle-alert-CU60xaOi.js → triangle-alert-Dh56Yu3-.js} +1 -1
- package/dist/{truck-ByZxqZhI.js → truck-DxhtLfkG.js} +1 -1
- package/dist/{upload-CWor1uj3.js → upload-CLf0JLXW.js} +1 -1
- package/dist/{useAssistant-uoc8wjr0.js → useAssistant-B9qBtRKm.js} +1 -1
- package/dist/{useCustomers-BPPhQXSH.js → useCustomers-BQ4AIEAT.js} +1 -1
- package/dist/{useFleet-CT_iW2V9.js → useFleet-BfA_-VUW.js} +101 -72
- package/dist/{useImportExport-BG0Cg_D9.js → useImportExport-7-O8noRJ.js} +1 -1
- package/dist/{useInventory-BtBGnOC2.js → useInventory-BO7TSgq_.js} +99 -73
- package/dist/{useOrders-BC-1mCc0.js → useOrders-B5FV0kcz.js} +1 -1
- package/dist/{useReports-Cx8blThR.js → useReports-hUXb8ryJ.js} +1 -1
- package/dist/{useRoutes-8fw8oO6y.js → useRoutes-C_ZCYJ_h.js} +1 -1
- package/dist/{useSettings-Do5WSUaI.js → useSettings-BNNzQs_B.js} +2 -2
- package/dist/{useTracking-Dogilo5C.js → useTracking-7nd_XOSL.js} +3 -3
- package/dist/{user-Dr_JS2FF.js → user-B1IjWJtn.js} +1 -1
- package/dist/{user-check-CBSiMH6I.js → user-check-Cx6fHHll.js} +1 -1
- package/dist/{users-BRV9-2nV.js → users-BKmsb79k.js} +1 -1
- package/dist/{warehouse-CmIAl0_w.js → warehouse-DE1irFyJ.js} +1 -1
- package/dist/{wrench-6U-BTSbg.js → wrench-DTJGFs17.js} +1 -1
- package/dist/{x-DX8sZrkd.js → x-CvsUGJy1.js} +1 -1
- package/package.json +1 -1
- package/src/movethewheels/MoveTheWheelsRoutes.tsx +5 -0
- package/src/movethewheels/components/GlassPanel.tsx +1 -3
- package/src/movethewheels/components/MetricCard.tsx +16 -3
- package/src/movethewheels/components/charts/StatusDonut.tsx +2 -6
- package/src/movethewheels/components/charts/TrendChart.tsx +2 -6
- package/src/movethewheels/components/maps/LogisticsMap.tsx +1 -4
- package/src/movethewheels/components/maps/RouteMap.tsx +3 -5
- package/src/movethewheels/components/maps/TrackingMap.tsx +11 -2
- package/src/movethewheels/hooks/useFleet.ts +113 -0
- package/src/movethewheels/hooks/useInventory.ts +86 -0
- package/src/movethewheels/hooks/useSettings.ts +8 -1
- package/src/movethewheels/pages/CreateOrderPage.tsx +48 -6
- package/src/movethewheels/pages/CustomerDetailsPage.tsx +3 -2
- package/src/movethewheels/pages/DriverDetailsPage.tsx +58 -20
- package/src/movethewheels/pages/OrderDetailsPage.tsx +2 -1
- package/src/movethewheels/pages/ProductDetailsPage.tsx +51 -15
- package/src/movethewheels/pages/RouteDetailsPage.tsx +51 -7
- package/src/movethewheels/pages/VehicleDetailsPage.tsx +53 -17
- package/src/movethewheels/pages/VehiclesPage.tsx +9 -1
- package/src/movethewheels/pages/WarehouseDetailsPage.tsx +49 -11
- package/src/movethewheels/types/index.ts +3 -0
- package/src/movethewheels/utils/graphqlClient.ts +51 -1
- package/dist/DriverDetailsPage-CBzAmM6s.js +0 -490
- package/dist/ProductDetailsPage-BMlRoR9E.js +0 -350
- package/dist/RouteDetailsPage-Btb1MSIS.js +0 -610
- package/dist/VehicleDetailsPage-DNLrMljV.js +0 -393
- package/dist/WarehouseDetailsPage-CAQFz7l_.js +0 -493
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { at as e, st as t } from "./PageLayout-
|
|
1
|
+
import { at as e, st as t } from "./PageLayout-j9Zw3wBN.js";
|
|
2
2
|
import { useCallback as n, useEffect as r, useMemo as i, useState as a } from "react";
|
|
3
3
|
//#region src/movethewheels/hooks/useInventory.ts
|
|
4
|
-
var o = "\n query ListInventoryItems($filter: InventoryFilterInput, $pagination: PaginationInput) {\n inventoryItems(filter: $filter, pagination: $pagination) {\n id\n productId\n warehouseId\n onHand\n available\n allocated\n damaged\n reorderPoint\n createdAt\n updatedAt\n }\n }\n", s = "\n query ListProducts($filter: ProductFilterInput, $pagination: PaginationInput) {\n products(filter: $filter, pagination: $pagination) {\n id\n sku\n name\n description\n category\n brand\n dimensions\n weight\n value\n hazardous\n fragile\n temperatureControlled\n createdAt\n updatedAt\n }\n }\n", c = "\n query ListWarehouses($filter: WarehouseFilterInput, $pagination: PaginationInput) {\n warehouses(filter: $filter, pagination: $pagination) {\n id\n name\n code\n type\n address\n totalCapacity\n usedCapacity\n createdAt\n }\n }\n", l = "\n query GetProduct($id: ID!) {\n product(id: $id) {\n id\n sku\n name\n description\n category\n brand\n dimensions\n weight\n value\n hazardous\n fragile\n temperatureControlled\n createdAt\n updatedAt\n }\n }\n", u = "\n query GetWarehouse($id: ID!) {\n warehouse(id: $id) {\n id\n name\n code\n type\n address\n totalCapacity\n usedCapacity\n createdAt\n }\n }\n", d = "\n query GetInventoryStats {\n inventoryStats {\n totalOnHand\n totalAvailable\n totalAllocated\n totalDamaged\n lowStockCount\n }\n }\n", f = "\n mutation CreateProduct($input: CreateProductInput!) {\n createProduct(input: $input) {\n id\n sku\n name\n description\n category\n brand\n dimensions\n weight\n value\n hazardous\n fragile\n temperatureControlled\n createdAt\n updatedAt\n }\n }\n", p = "\n mutation CreateWarehouse($input: CreateWarehouseInput!) {\n createWarehouse(input: $input) {\n id\n name\n code\n type\n address\n totalCapacity\n usedCapacity\n createdAt\n }\n }\n",
|
|
5
|
-
function
|
|
4
|
+
var o = "\n query ListInventoryItems($filter: InventoryFilterInput, $pagination: PaginationInput) {\n inventoryItems(filter: $filter, pagination: $pagination) {\n id\n productId\n warehouseId\n onHand\n available\n allocated\n damaged\n reorderPoint\n createdAt\n updatedAt\n }\n }\n", s = "\n query ListProducts($filter: ProductFilterInput, $pagination: PaginationInput) {\n products(filter: $filter, pagination: $pagination) {\n id\n sku\n name\n description\n category\n brand\n dimensions\n weight\n value\n hazardous\n fragile\n temperatureControlled\n createdAt\n updatedAt\n }\n }\n", c = "\n query ListWarehouses($filter: WarehouseFilterInput, $pagination: PaginationInput) {\n warehouses(filter: $filter, pagination: $pagination) {\n id\n name\n code\n type\n address\n totalCapacity\n usedCapacity\n createdAt\n }\n }\n", l = "\n query GetProduct($id: ID!) {\n product(id: $id) {\n id\n sku\n name\n description\n category\n brand\n dimensions\n weight\n value\n hazardous\n fragile\n temperatureControlled\n createdAt\n updatedAt\n }\n }\n", u = "\n query GetWarehouse($id: ID!) {\n warehouse(id: $id) {\n id\n name\n code\n type\n address\n totalCapacity\n usedCapacity\n createdAt\n }\n }\n", d = "\n query GetInventoryStats {\n inventoryStats {\n totalOnHand\n totalAvailable\n totalAllocated\n totalDamaged\n lowStockCount\n }\n }\n", f = "\n mutation CreateProduct($input: CreateProductInput!) {\n createProduct(input: $input) {\n id\n sku\n name\n description\n category\n brand\n dimensions\n weight\n value\n hazardous\n fragile\n temperatureControlled\n createdAt\n updatedAt\n }\n }\n", p = "\n mutation UpdateProduct($id: ID!, $input: UpdateProductInput!) {\n updateProduct(id: $id, input: $input) {\n id\n sku\n name\n description\n category\n brand\n dimensions\n weight\n value\n hazardous\n fragile\n temperatureControlled\n createdAt\n updatedAt\n }\n }\n", m = "\n mutation CreateWarehouse($input: CreateWarehouseInput!) {\n createWarehouse(input: $input) {\n id\n name\n code\n type\n address\n totalCapacity\n usedCapacity\n createdAt\n }\n }\n", h = "\n mutation UpdateWarehouse($id: ID!, $input: UpdateWarehouseInput!) {\n updateWarehouse(id: $id, input: $input) {\n id\n name\n code\n type\n address\n totalCapacity\n usedCapacity\n createdAt\n }\n }\n", g = "\n mutation AdjustInventoryStock($input: AdjustInventoryStockInput!) {\n adjustInventoryStock(input: $input) {\n id\n productId\n warehouseId\n onHand\n available\n allocated\n damaged\n reorderPoint\n createdAt\n updatedAt\n }\n }\n";
|
|
5
|
+
function _(e) {
|
|
6
6
|
return {
|
|
7
7
|
id: e.id,
|
|
8
8
|
sku: e.sku,
|
|
@@ -29,7 +29,7 @@ function h(e) {
|
|
|
29
29
|
updatedAt: new Date(e.updatedAt)
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
|
-
function
|
|
32
|
+
function v(e) {
|
|
33
33
|
let t = e.totalCapacity ?? 0, n = e.usedCapacity ?? 0;
|
|
34
34
|
return {
|
|
35
35
|
id: e.id,
|
|
@@ -69,7 +69,7 @@ function g(e) {
|
|
|
69
69
|
createdAt: new Date(e.createdAt)
|
|
70
70
|
};
|
|
71
71
|
}
|
|
72
|
-
function
|
|
72
|
+
function y(e) {
|
|
73
73
|
return {
|
|
74
74
|
id: e.id,
|
|
75
75
|
productId: e.productId,
|
|
@@ -92,7 +92,7 @@ function _(e) {
|
|
|
92
92
|
updatedAt: new Date(e.updatedAt)
|
|
93
93
|
};
|
|
94
94
|
}
|
|
95
|
-
function
|
|
95
|
+
function b() {
|
|
96
96
|
let { apiGatewayUrl: e, authToken: n, workspaceToken: r, workspaceId: a, tenantId: o, currentUser: s } = t();
|
|
97
97
|
return i(() => ({
|
|
98
98
|
apiGatewayUrl: e,
|
|
@@ -110,13 +110,13 @@ function v() {
|
|
|
110
110
|
s?.id
|
|
111
111
|
]);
|
|
112
112
|
}
|
|
113
|
-
function
|
|
113
|
+
function x(t = {}) {
|
|
114
114
|
let { filters: l } = t, u = i(() => l, [
|
|
115
115
|
l?.lowStock,
|
|
116
116
|
l?.productId,
|
|
117
117
|
l?.warehouseId
|
|
118
|
-
]), d =
|
|
119
|
-
|
|
118
|
+
]), d = b(), [x, S] = a([]), [C, w] = a([]), [T, E] = a([]), [D, O] = a(!1), [k, A] = a(null), j = n(async () => {
|
|
119
|
+
O(!0), A(null);
|
|
120
120
|
try {
|
|
121
121
|
let [t, n, r] = await Promise.all([
|
|
122
122
|
e(d, o, {
|
|
@@ -137,80 +137,106 @@ function y(t = {}) {
|
|
|
137
137
|
limit: 500,
|
|
138
138
|
offset: 0
|
|
139
139
|
} })
|
|
140
|
-
]), i = t.inventoryItems.map(
|
|
141
|
-
u?.lowStock && (i = i.filter((e) => e.availableQuantity <= e.reorderLevel)),
|
|
140
|
+
]), i = t.inventoryItems.map(y);
|
|
141
|
+
u?.lowStock && (i = i.filter((e) => e.availableQuantity <= e.reorderLevel)), S(i), w(n.products.map(_)), E(r.warehouses.map(v));
|
|
142
142
|
} catch (e) {
|
|
143
|
-
|
|
143
|
+
A(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load inventory data"));
|
|
144
144
|
} finally {
|
|
145
|
-
|
|
145
|
+
O(!1);
|
|
146
146
|
}
|
|
147
147
|
}, [u, d]);
|
|
148
148
|
r(() => {
|
|
149
|
-
|
|
150
|
-
}, [
|
|
151
|
-
let
|
|
152
|
-
|
|
153
|
-
}, [
|
|
154
|
-
let i =
|
|
149
|
+
j();
|
|
150
|
+
}, [j]);
|
|
151
|
+
let M = n(() => {
|
|
152
|
+
j();
|
|
153
|
+
}, [j]), N = n(async (t, n, r) => {
|
|
154
|
+
let i = x.find((e) => e.id === t);
|
|
155
155
|
if (!i) throw Error("Inventory item not found");
|
|
156
|
-
let a =
|
|
156
|
+
let a = y((await e(d, g, { input: {
|
|
157
157
|
id: t,
|
|
158
158
|
onHand: i.quantity + n,
|
|
159
159
|
available: i.availableQuantity + n,
|
|
160
160
|
allocated: i.reservedQuantity,
|
|
161
161
|
damaged: 0
|
|
162
162
|
} })).adjustInventoryStock);
|
|
163
|
-
return
|
|
164
|
-
}, [d,
|
|
165
|
-
let i =
|
|
163
|
+
return S((e) => e.map((e) => e.id === t ? a : e)), a;
|
|
164
|
+
}, [d, x]), P = n(async (e, t, n, r) => {
|
|
165
|
+
let i = x.find((t) => t.warehouseId === e && t.productId === n);
|
|
166
166
|
if (!i) throw Error("Source inventory not found");
|
|
167
|
-
await
|
|
168
|
-
let a =
|
|
169
|
-
a && await
|
|
170
|
-
}, [
|
|
171
|
-
let n =
|
|
167
|
+
await N(i.id, -Math.abs(r), "transfer out");
|
|
168
|
+
let a = x.find((e) => e.warehouseId === t && e.productId === n);
|
|
169
|
+
a && await N(a.id, Math.abs(r), "transfer in");
|
|
170
|
+
}, [x, N]), F = n(async (t) => {
|
|
171
|
+
let n = _((await e(d, f, { input: {
|
|
172
172
|
name: t.name,
|
|
173
173
|
sku: t.sku,
|
|
174
174
|
category: t.category,
|
|
175
175
|
brand: t.brand,
|
|
176
176
|
weight: t.weight
|
|
177
177
|
} })).createProduct);
|
|
178
|
-
return
|
|
179
|
-
}, [d]),
|
|
180
|
-
let n =
|
|
178
|
+
return w((e) => [n, ...e]), n;
|
|
179
|
+
}, [d]), I = n(async (t) => {
|
|
180
|
+
let n = v((await e(d, m, { input: {
|
|
181
181
|
code: t.code,
|
|
182
182
|
name: t.name,
|
|
183
183
|
type: t.type,
|
|
184
184
|
address: t.address,
|
|
185
185
|
totalCapacity: t.totalCapacity
|
|
186
186
|
} })).createWarehouse);
|
|
187
|
-
return
|
|
187
|
+
return E((e) => [n, ...e]), n;
|
|
188
|
+
}, [d]), L = n(async (t, n) => {
|
|
189
|
+
let r = _((await e(d, p, {
|
|
190
|
+
id: t,
|
|
191
|
+
input: {
|
|
192
|
+
name: n.name,
|
|
193
|
+
sku: n.sku,
|
|
194
|
+
category: n.category,
|
|
195
|
+
brand: n.brand,
|
|
196
|
+
weight: n.weight
|
|
197
|
+
}
|
|
198
|
+
})).updateProduct);
|
|
199
|
+
return w((e) => e.map((e) => e.id === t ? r : e)), r;
|
|
200
|
+
}, [d]), R = n(async (t, n) => {
|
|
201
|
+
let r = v((await e(d, h, {
|
|
202
|
+
id: t,
|
|
203
|
+
input: {
|
|
204
|
+
code: n.code,
|
|
205
|
+
name: n.name,
|
|
206
|
+
type: n.type,
|
|
207
|
+
address: n.address,
|
|
208
|
+
totalCapacity: n.totalCapacity
|
|
209
|
+
}
|
|
210
|
+
})).updateWarehouse);
|
|
211
|
+
return E((e) => e.map((e) => e.id === t ? r : e)), r;
|
|
188
212
|
}, [d]);
|
|
189
213
|
return {
|
|
190
|
-
inventory:
|
|
191
|
-
products:
|
|
192
|
-
warehouses:
|
|
193
|
-
totalItems:
|
|
194
|
-
isLoading:
|
|
195
|
-
error:
|
|
196
|
-
refetch:
|
|
197
|
-
updateStock:
|
|
198
|
-
transferStock:
|
|
199
|
-
createProduct:
|
|
200
|
-
createWarehouse:
|
|
214
|
+
inventory: x,
|
|
215
|
+
products: C,
|
|
216
|
+
warehouses: T,
|
|
217
|
+
totalItems: x.length,
|
|
218
|
+
isLoading: D,
|
|
219
|
+
error: k,
|
|
220
|
+
refetch: M,
|
|
221
|
+
updateStock: N,
|
|
222
|
+
transferStock: P,
|
|
223
|
+
createProduct: F,
|
|
224
|
+
createWarehouse: I,
|
|
225
|
+
updateProduct: L,
|
|
226
|
+
updateWarehouse: R
|
|
201
227
|
};
|
|
202
228
|
}
|
|
203
|
-
function
|
|
204
|
-
let { limit: i = 500, offset: o = 0 } = t, c =
|
|
205
|
-
m(!0),
|
|
229
|
+
function S(t = {}) {
|
|
230
|
+
let { limit: i = 500, offset: o = 0 } = t, c = b(), [l, u] = a([]), [d, f] = a(!1), [p, m] = a(!1), [h, g] = a(null), v = n(async () => {
|
|
231
|
+
m(!0), g(null);
|
|
206
232
|
try {
|
|
207
233
|
let t = await e(c, s, { pagination: {
|
|
208
234
|
limit: i,
|
|
209
235
|
offset: o
|
|
210
236
|
} });
|
|
211
|
-
f(t.products.length === i), u(t.products.map(
|
|
237
|
+
f(t.products.length === i), u(t.products.map(_));
|
|
212
238
|
} catch (e) {
|
|
213
|
-
|
|
239
|
+
g(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load products"));
|
|
214
240
|
} finally {
|
|
215
241
|
m(!1);
|
|
216
242
|
}
|
|
@@ -220,18 +246,18 @@ function b(t = {}) {
|
|
|
220
246
|
o
|
|
221
247
|
]);
|
|
222
248
|
return r(() => {
|
|
223
|
-
|
|
224
|
-
}, [
|
|
249
|
+
v();
|
|
250
|
+
}, [v]), {
|
|
225
251
|
products: l,
|
|
226
252
|
totalProducts: l.length,
|
|
227
253
|
hasMore: d,
|
|
228
254
|
isLoading: p,
|
|
229
|
-
error:
|
|
230
|
-
refetch: () => void
|
|
255
|
+
error: h,
|
|
256
|
+
refetch: () => void v()
|
|
231
257
|
};
|
|
232
258
|
}
|
|
233
|
-
function
|
|
234
|
-
let { products: t, isLoading: n, error: r } =
|
|
259
|
+
function C(e = 500) {
|
|
260
|
+
let { products: t, isLoading: n, error: r } = S({
|
|
235
261
|
limit: e,
|
|
236
262
|
offset: 0
|
|
237
263
|
});
|
|
@@ -245,8 +271,8 @@ function x(e = 500) {
|
|
|
245
271
|
error: r
|
|
246
272
|
};
|
|
247
273
|
}
|
|
248
|
-
function
|
|
249
|
-
let i =
|
|
274
|
+
function w(t) {
|
|
275
|
+
let i = b(), [o, s] = a(null), [c, u] = a(!1), [d, f] = a(null), p = n(async () => {
|
|
250
276
|
if (!t) {
|
|
251
277
|
s(null);
|
|
252
278
|
return;
|
|
@@ -254,7 +280,7 @@ function S(t) {
|
|
|
254
280
|
u(!0), f(null);
|
|
255
281
|
try {
|
|
256
282
|
let n = await e(i, l, { id: t });
|
|
257
|
-
s(n.product ?
|
|
283
|
+
s(n.product ? _(n.product) : null);
|
|
258
284
|
} catch (e) {
|
|
259
285
|
f(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load product"));
|
|
260
286
|
} finally {
|
|
@@ -270,17 +296,17 @@ function S(t) {
|
|
|
270
296
|
refetch: () => void p()
|
|
271
297
|
};
|
|
272
298
|
}
|
|
273
|
-
function
|
|
274
|
-
let { limit: i = 500, offset: o = 0 } = t, s =
|
|
275
|
-
m(!0),
|
|
299
|
+
function T(t = {}) {
|
|
300
|
+
let { limit: i = 500, offset: o = 0 } = t, s = b(), [l, u] = a([]), [d, f] = a(!1), [p, m] = a(!1), [h, g] = a(null), _ = n(async () => {
|
|
301
|
+
m(!0), g(null);
|
|
276
302
|
try {
|
|
277
303
|
let t = await e(s, c, { pagination: {
|
|
278
304
|
limit: i,
|
|
279
305
|
offset: o
|
|
280
306
|
} });
|
|
281
|
-
f(t.warehouses.length === i), u(t.warehouses.map(
|
|
307
|
+
f(t.warehouses.length === i), u(t.warehouses.map(v));
|
|
282
308
|
} catch (e) {
|
|
283
|
-
|
|
309
|
+
g(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load warehouses"));
|
|
284
310
|
} finally {
|
|
285
311
|
m(!1);
|
|
286
312
|
}
|
|
@@ -290,18 +316,18 @@ function C(t = {}) {
|
|
|
290
316
|
o
|
|
291
317
|
]);
|
|
292
318
|
return r(() => {
|
|
293
|
-
|
|
294
|
-
}, [
|
|
319
|
+
_();
|
|
320
|
+
}, [_]), {
|
|
295
321
|
warehouses: l,
|
|
296
322
|
totalWarehouses: l.length,
|
|
297
323
|
hasMore: d,
|
|
298
324
|
isLoading: p,
|
|
299
325
|
error: h,
|
|
300
|
-
refetch: () => void
|
|
326
|
+
refetch: () => void _()
|
|
301
327
|
};
|
|
302
328
|
}
|
|
303
|
-
function
|
|
304
|
-
let { warehouses: t, isLoading: n, error: r } =
|
|
329
|
+
function E(e = 500) {
|
|
330
|
+
let { warehouses: t, isLoading: n, error: r } = T({
|
|
305
331
|
limit: e,
|
|
306
332
|
offset: 0
|
|
307
333
|
});
|
|
@@ -318,8 +344,8 @@ function w(e = 500) {
|
|
|
318
344
|
error: r
|
|
319
345
|
};
|
|
320
346
|
}
|
|
321
|
-
function
|
|
322
|
-
let i =
|
|
347
|
+
function D(t) {
|
|
348
|
+
let i = b(), [o, s] = a(null), [c, l] = a(!1), [d, f] = a(null), p = n(async () => {
|
|
323
349
|
if (!t) {
|
|
324
350
|
s(null);
|
|
325
351
|
return;
|
|
@@ -327,7 +353,7 @@ function T(t) {
|
|
|
327
353
|
l(!0), f(null);
|
|
328
354
|
try {
|
|
329
355
|
let n = await e(i, u, { id: t });
|
|
330
|
-
s(n.warehouse ?
|
|
356
|
+
s(n.warehouse ? v(n.warehouse) : null);
|
|
331
357
|
} catch (e) {
|
|
332
358
|
f(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load warehouse"));
|
|
333
359
|
} finally {
|
|
@@ -343,8 +369,8 @@ function T(t) {
|
|
|
343
369
|
refetch: () => void p()
|
|
344
370
|
};
|
|
345
371
|
}
|
|
346
|
-
function
|
|
347
|
-
let t =
|
|
372
|
+
function O() {
|
|
373
|
+
let t = b(), [n, i] = a({
|
|
348
374
|
totalItems: 0,
|
|
349
375
|
lowStockItems: 0,
|
|
350
376
|
totalValue: 0,
|
|
@@ -385,4 +411,4 @@ function E() {
|
|
|
385
411
|
};
|
|
386
412
|
}
|
|
387
413
|
//#endregion
|
|
388
|
-
export {
|
|
414
|
+
export { S as a, T as c, C as i, O as n, D as o, w as r, E as s, x as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { at as e, st as t } from "./PageLayout-
|
|
1
|
+
import { at as e, st as t } from "./PageLayout-j9Zw3wBN.js";
|
|
2
2
|
import { useCallback as n, useEffect as r, useMemo as i, useState as a } from "react";
|
|
3
3
|
//#region src/movethewheels/hooks/useOrders.ts
|
|
4
4
|
var o = "\n query ListMovethewheelsOrders($filter: OrderFilterInput, $pagination: PaginationInput) {\n movethewheelsOrders(filter: $filter, pagination: $pagination) {\n id\n orderNumber\n customerId\n orderType\n status\n priority\n pickupAddress\n deliveryAddress\n items\n pricing\n trackingNumber\n specialInstructions\n scheduledDelivery\n vehicleId\n driverId\n createdAt\n updatedAt\n customer {\n name\n email\n phone\n company\n }\n statusHistory {\n status\n notes\n location\n createdAt\n createdBy\n }\n }\n }\n", s = "\n query GetMovethewheelsOrder($id: ID!) {\n movethewheelsOrder(id: $id) {\n id\n orderNumber\n customerId\n orderType\n status\n priority\n pickupAddress\n deliveryAddress\n items\n pricing\n trackingNumber\n specialInstructions\n scheduledDelivery\n vehicleId\n driverId\n createdAt\n updatedAt\n customer {\n name\n email\n phone\n company\n }\n statusHistory {\n status\n notes\n location\n createdAt\n createdBy\n }\n }\n }\n", c = "\n query GetOrderStatsBundle {\n orderStats {\n total\n pending\n inTransit\n delivered\n cancelled\n failed\n }\n financeMetrics {\n revenue {\n totalRevenue\n averageOrderValue\n }\n }\n }\n", l = "\n mutation CreateMovethewheelsOrder($input: CreateOrderInput!) {\n createMovethewheelsOrder(input: $input) {\n id\n orderNumber\n customerId\n orderType\n status\n priority\n pickupAddress\n deliveryAddress\n items\n pricing\n trackingNumber\n specialInstructions\n scheduledDelivery\n vehicleId\n driverId\n createdAt\n updatedAt\n customer {\n name\n email\n phone\n company\n }\n statusHistory {\n status\n notes\n location\n createdAt\n createdBy\n }\n }\n }\n", u = "\n mutation UpdateMovethewheelsOrder($id: ID!, $input: UpdateOrderInput!) {\n updateMovethewheelsOrder(id: $id, input: $input) {\n id\n orderNumber\n customerId\n orderType\n status\n priority\n pickupAddress\n deliveryAddress\n items\n pricing\n trackingNumber\n specialInstructions\n scheduledDelivery\n vehicleId\n driverId\n createdAt\n updatedAt\n customer {\n name\n email\n phone\n company\n }\n statusHistory {\n status\n notes\n location\n createdAt\n createdBy\n }\n }\n }\n", d = "\n mutation UpdateMovethewheelsOrderStatus($id: ID!, $input: UpdateOrderStatusInput!) {\n updateMovethewheelsOrderStatus(id: $id, input: $input) {\n id\n orderNumber\n customerId\n orderType\n status\n priority\n pickupAddress\n deliveryAddress\n items\n pricing\n trackingNumber\n specialInstructions\n scheduledDelivery\n vehicleId\n driverId\n createdAt\n updatedAt\n customer {\n name\n email\n phone\n company\n }\n statusHistory {\n status\n notes\n location\n createdAt\n createdBy\n }\n }\n }\n", f = "\n mutation DeleteMovethewheelsOrder($id: ID!) {\n deleteMovethewheelsOrder(id: $id)\n }\n";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { at as e, st as t } from "./PageLayout-
|
|
1
|
+
import { at as e, st as t } from "./PageLayout-j9Zw3wBN.js";
|
|
2
2
|
import { useCallback as n, useEffect as r, useMemo as i, useState as a } from "react";
|
|
3
3
|
//#region src/movethewheels/hooks/useReports.ts
|
|
4
4
|
var o = "\n id\n name\n description\n type\n status\n schedule\n lastGenerated\n createdAt\n updatedAt\n", s = `
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { at as e, st as t } from "./PageLayout-
|
|
1
|
+
import { at as e, st as t } from "./PageLayout-j9Zw3wBN.js";
|
|
2
2
|
import { useCallback as n, useEffect as r, useMemo as i, useState as a } from "react";
|
|
3
3
|
//#region src/movethewheels/hooks/useRoutes.ts
|
|
4
4
|
var o = "\n query ListRoutes($filter: RouteFilterInput, $pagination: PaginationInput) {\n routes(filter: $filter, pagination: $pagination) {\n id\n name\n status\n shipmentId\n vehicleId\n driverId\n waypoints\n estimatedDistance\n estimatedDuration\n fuelCost\n actualDistance\n actualDuration\n createdAt\n }\n }\n", s = "\n query GetRoute($id: ID!) {\n route(id: $id) {\n id\n name\n status\n shipmentId\n vehicleId\n driverId\n waypoints\n estimatedDistance\n estimatedDuration\n fuelCost\n actualDistance\n actualDuration\n createdAt\n }\n }\n", c = "\n mutation CreateRoute($input: CreateRouteInput!) {\n createRoute(input: $input) {\n id\n name\n status\n shipmentId\n vehicleId\n driverId\n waypoints\n estimatedDistance\n estimatedDuration\n fuelCost\n actualDistance\n actualDuration\n createdAt\n }\n }\n", l = "\n mutation UpdateRoute($id: ID!, $input: UpdateRouteInput!) {\n updateRoute(id: $id, input: $input) {\n id\n name\n status\n shipmentId\n vehicleId\n driverId\n waypoints\n estimatedDistance\n estimatedDuration\n fuelCost\n actualDistance\n actualDuration\n createdAt\n }\n }\n", u = "\n mutation DeleteRoute($id: ID!) {\n deleteRoute(id: $id)\n }\n", d = "\n mutation OptimizeRoute($id: ID!) {\n optimizeRoute(id: $id) {\n id\n name\n status\n shipmentId\n vehicleId\n driverId\n waypoints\n estimatedDistance\n estimatedDuration\n fuelCost\n actualDistance\n actualDuration\n createdAt\n }\n }\n";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { at as e, st as t, ut as n } from "./PageLayout-
|
|
1
|
+
import { at as e, st as t, ut as n } from "./PageLayout-j9Zw3wBN.js";
|
|
2
2
|
import { useCallback as r, useEffect as i, useMemo as a, useState as o } from "react";
|
|
3
3
|
//#region node_modules/lucide-react/dist/esm/icons/globe.js
|
|
4
4
|
var s = n("Globe", [
|
|
@@ -69,7 +69,7 @@ function d() {
|
|
|
69
69
|
}, [S]);
|
|
70
70
|
return {
|
|
71
71
|
settings: m,
|
|
72
|
-
preferences: m?.preferences ?? {},
|
|
72
|
+
preferences: a(() => m?.preferences ?? {}, [m]),
|
|
73
73
|
isLoading: g,
|
|
74
74
|
isSaving: v,
|
|
75
75
|
error: b,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { at as e, st as t } from "./PageLayout-
|
|
2
|
-
import { r as n, t as r } from "./useOrders-
|
|
3
|
-
import { a as i, n as a, o, t as s } from "./useFleet-
|
|
1
|
+
import { at as e, st as t } from "./PageLayout-j9Zw3wBN.js";
|
|
2
|
+
import { r as n, t as r } from "./useOrders-B5FV0kcz.js";
|
|
3
|
+
import { a as i, n as a, o, t as s } from "./useFleet-BfA_-VUW.js";
|
|
4
4
|
import { useCallback as c, useEffect as l, useMemo as u, useState as d } from "react";
|
|
5
5
|
//#region src/movethewheels/hooks/useTracking.ts
|
|
6
6
|
var f = "\n query ListShipments($filter: ShipmentFilterInput, $pagination: PaginationInput) {\n shipments(filter: $filter, pagination: $pagination) {\n id\n shipmentNumber\n orderId\n status\n estimatedDelivery\n }\n }\n", p = "\n query GetShipment($id: ID!) {\n shipment(id: $id) {\n id\n shipmentNumber\n orderId\n status\n estimatedDelivery\n trackingEvents {\n id\n shipmentId\n eventType\n location\n details\n timestamp\n }\n }\n }\n", m = "\n query GetOrderTracking($orderId: ID!) {\n orderTracking(orderId: $orderId) {\n id\n shipmentId\n eventType\n location\n details\n timestamp\n }\n }\n", h = "\n query GetActiveDeliveries {\n activeDeliveries {\n id\n shipmentNumber\n orderId\n status\n estimatedDelivery\n }\n }\n", g = "\n query GetTrackingAlerts {\n trackingAlerts {\n shipmentId\n shipmentNumber\n alertType\n message\n }\n }\n";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ut as e } from "./PageLayout-
|
|
1
|
+
import { ut as e } from "./PageLayout-j9Zw3wBN.js";
|
|
2
2
|
//#region node_modules/lucide-react/dist/esm/icons/wrench.js
|
|
3
3
|
var t = e("Wrench", [["path", {
|
|
4
4
|
d: "M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",
|
package/package.json
CHANGED
|
@@ -95,18 +95,22 @@ export function MoveTheWheelsRoutes() {
|
|
|
95
95
|
<Route path="fleet/vehicles" element={<VehiclesPage />} />
|
|
96
96
|
<Route path="fleet/vehicles/new" element={<VehicleDetailsPage />} />
|
|
97
97
|
<Route path="fleet/vehicles/:vehicleId" element={<VehicleDetailsPage />} />
|
|
98
|
+
<Route path="fleet/vehicles/:vehicleId/edit" element={<VehicleDetailsPage />} />
|
|
98
99
|
<Route path="fleet/drivers" element={<DriversPage />} />
|
|
99
100
|
<Route path="fleet/drivers/new" element={<DriverDetailsPage />} />
|
|
100
101
|
<Route path="fleet/drivers/:driverId" element={<DriverDetailsPage />} />
|
|
102
|
+
<Route path="fleet/drivers/:driverId/edit" element={<DriverDetailsPage />} />
|
|
101
103
|
|
|
102
104
|
{/* Inventory */}
|
|
103
105
|
<Route path="inventory" element={<InventoryPage />} />
|
|
104
106
|
<Route path="inventory/products" element={<ProductsPage />} />
|
|
105
107
|
<Route path="inventory/products/new" element={<ProductDetailsPage />} />
|
|
106
108
|
<Route path="inventory/products/:productId" element={<ProductDetailsPage />} />
|
|
109
|
+
<Route path="inventory/products/:productId/edit" element={<ProductDetailsPage />} />
|
|
107
110
|
<Route path="inventory/warehouses" element={<WarehousesPage />} />
|
|
108
111
|
<Route path="inventory/warehouses/new" element={<WarehouseDetailsPage />} />
|
|
109
112
|
<Route path="inventory/warehouses/:warehouseId" element={<WarehouseDetailsPage />} />
|
|
113
|
+
<Route path="inventory/warehouses/:warehouseId/edit" element={<WarehouseDetailsPage />} />
|
|
110
114
|
|
|
111
115
|
{/* Customers */}
|
|
112
116
|
<Route path="customers" element={<CustomersPage />} />
|
|
@@ -117,6 +121,7 @@ export function MoveTheWheelsRoutes() {
|
|
|
117
121
|
<Route path="routes" element={<RoutesPage />} />
|
|
118
122
|
<Route path="routes/new" element={<RouteDetailsPage />} />
|
|
119
123
|
<Route path="routes/:routeId" element={<RouteDetailsPage />} />
|
|
124
|
+
<Route path="routes/:routeId/edit" element={<RouteDetailsPage />} />
|
|
120
125
|
|
|
121
126
|
{/* Analytics */}
|
|
122
127
|
<Route path="analytics" element={<AnalyticsPage />} />
|
|
@@ -58,9 +58,7 @@ export function GlassPanel({
|
|
|
58
58
|
{title != null && (
|
|
59
59
|
<h3 className="truncate text-sm font-semibold text-text-primary">{title}</h3>
|
|
60
60
|
)}
|
|
61
|
-
{description != null &&
|
|
62
|
-
<p className="text-xs text-text-secondary">{description}</p>
|
|
63
|
-
)}
|
|
61
|
+
{description != null && <p className="text-xs text-text-secondary">{description}</p>}
|
|
64
62
|
</div>
|
|
65
63
|
{action != null && <div className="flex shrink-0 items-center gap-2">{action}</div>}
|
|
66
64
|
</div>
|
|
@@ -78,7 +78,13 @@ const accentChipClasses: Record<MetricAccent, string> = {
|
|
|
78
78
|
function ArrowIcon({ direction }: { direction: 'up' | 'down' | 'flat' }) {
|
|
79
79
|
if (direction === 'flat') {
|
|
80
80
|
return (
|
|
81
|
-
<svg
|
|
81
|
+
<svg
|
|
82
|
+
className="h-3.5 w-3.5"
|
|
83
|
+
fill="none"
|
|
84
|
+
viewBox="0 0 24 24"
|
|
85
|
+
stroke="currentColor"
|
|
86
|
+
aria-hidden
|
|
87
|
+
>
|
|
82
88
|
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2.5} d="M5 12h14" />
|
|
83
89
|
</svg>
|
|
84
90
|
);
|
|
@@ -91,7 +97,12 @@ function ArrowIcon({ direction }: { direction: 'up' | 'down' | 'flat' }) {
|
|
|
91
97
|
stroke="currentColor"
|
|
92
98
|
aria-hidden
|
|
93
99
|
>
|
|
94
|
-
<path
|
|
100
|
+
<path
|
|
101
|
+
strokeLinecap="round"
|
|
102
|
+
strokeLinejoin="round"
|
|
103
|
+
strokeWidth={2.5}
|
|
104
|
+
d="M12 19V5m0 0l-6 6m6-6l6 6"
|
|
105
|
+
/>
|
|
95
106
|
</svg>
|
|
96
107
|
);
|
|
97
108
|
}
|
|
@@ -278,7 +289,9 @@ export function MetricCardSkeleton({ size = 'md' }: { size?: 'sm' | 'md' | 'lg'
|
|
|
278
289
|
<div className="h-8 w-32 rounded bg-bg-sunken motion-safe:animate-vc-shimmer" />
|
|
279
290
|
<div className="h-3 w-20 rounded bg-bg-sunken motion-safe:animate-vc-shimmer" />
|
|
280
291
|
</div>
|
|
281
|
-
<div
|
|
292
|
+
<div
|
|
293
|
+
className={cn('rounded-xl bg-bg-sunken motion-safe:animate-vc-shimmer', styles.icon)}
|
|
294
|
+
/>
|
|
282
295
|
</div>
|
|
283
296
|
</div>
|
|
284
297
|
</GlassCard>
|
|
@@ -67,9 +67,7 @@ export function StatusDonut({
|
|
|
67
67
|
<Tooltip
|
|
68
68
|
content={
|
|
69
69
|
<ChartTooltip
|
|
70
|
-
formatter={(v) =>
|
|
71
|
-
valueFormatter ? valueFormatter(Number(v)) : String(v)
|
|
72
|
-
}
|
|
70
|
+
formatter={(v) => (valueFormatter ? valueFormatter(Number(v)) : String(v))}
|
|
73
71
|
/>
|
|
74
72
|
}
|
|
75
73
|
/>
|
|
@@ -77,9 +75,7 @@ export function StatusDonut({
|
|
|
77
75
|
</ResponsiveContainer>
|
|
78
76
|
{centerLabel != null && (
|
|
79
77
|
<div className="pointer-events-none absolute inset-0 flex flex-col items-center justify-center text-center">
|
|
80
|
-
<span className="text-2xl font-bold tabular-nums text-text-primary">
|
|
81
|
-
{centerLabel}
|
|
82
|
-
</span>
|
|
78
|
+
<span className="text-2xl font-bold tabular-nums text-text-primary">{centerLabel}</span>
|
|
83
79
|
{centerSubLabel && (
|
|
84
80
|
<span className="text-xs text-text-secondary">{centerSubLabel}</span>
|
|
85
81
|
)}
|
|
@@ -99,9 +99,7 @@ export function TrendChart({
|
|
|
99
99
|
tickLine={false}
|
|
100
100
|
axisLine={false}
|
|
101
101
|
width={44}
|
|
102
|
-
tickFormatter={
|
|
103
|
-
valueFormatter ? (v: number) => valueFormatter(v, '') : undefined
|
|
104
|
-
}
|
|
102
|
+
tickFormatter={valueFormatter ? (v: number) => valueFormatter(v, '') : undefined}
|
|
105
103
|
/>
|
|
106
104
|
<Tooltip
|
|
107
105
|
cursor={{ stroke: chartTokens.axis, strokeOpacity: 0.3 }}
|
|
@@ -144,9 +142,7 @@ export function TrendChart({
|
|
|
144
142
|
tickLine={false}
|
|
145
143
|
axisLine={false}
|
|
146
144
|
width={44}
|
|
147
|
-
tickFormatter={
|
|
148
|
-
valueFormatter ? (v: number) => valueFormatter(v, '') : undefined
|
|
149
|
-
}
|
|
145
|
+
tickFormatter={valueFormatter ? (v: number) => valueFormatter(v, '') : undefined}
|
|
150
146
|
/>
|
|
151
147
|
<Tooltip
|
|
152
148
|
cursor={{ stroke: chartTokens.axis, strokeOpacity: 0.3 }}
|
|
@@ -40,10 +40,7 @@ export function LogisticsMap({
|
|
|
40
40
|
fitToMarkers = true,
|
|
41
41
|
emptyMessage = 'No live locations yet',
|
|
42
42
|
}: LogisticsMapProps) {
|
|
43
|
-
const validMarkers = useMemo(
|
|
44
|
-
() => markers.filter((m) => isRealCoord(m.lat, m.lng)),
|
|
45
|
-
[markers]
|
|
46
|
-
);
|
|
43
|
+
const validMarkers = useMemo(() => markers.filter((m) => isRealCoord(m.lat, m.lng)), [markers]);
|
|
47
44
|
|
|
48
45
|
const validRoutes = useMemo(
|
|
49
46
|
() =>
|
|
@@ -31,7 +31,8 @@ export function RouteMap({
|
|
|
31
31
|
emptyMessage = 'No stops with coordinates yet',
|
|
32
32
|
}: RouteMapProps) {
|
|
33
33
|
const ordered = useMemo(
|
|
34
|
-
() =>
|
|
34
|
+
() =>
|
|
35
|
+
[...stops].filter((s) => isRealCoord(s.lat, s.lng)).sort((a, b) => a.sequence - b.sequence),
|
|
35
36
|
[stops]
|
|
36
37
|
);
|
|
37
38
|
|
|
@@ -48,10 +49,7 @@ export function RouteMap({
|
|
|
48
49
|
emptyState={<p className="text-sm text-text-secondary">{emptyMessage}</p>}
|
|
49
50
|
>
|
|
50
51
|
{line.length >= 2 && (
|
|
51
|
-
<Polyline
|
|
52
|
-
positions={line}
|
|
53
|
-
pathOptions={{ color: routeColor, weight: 4, opacity: 0.85 }}
|
|
54
|
-
/>
|
|
52
|
+
<Polyline positions={line} pathOptions={{ color: routeColor, weight: 4, opacity: 0.85 }} />
|
|
55
53
|
)}
|
|
56
54
|
{ordered.map((s) => (
|
|
57
55
|
<Marker
|
|
@@ -70,11 +70,20 @@ export function TrackingMap({
|
|
|
70
70
|
{trailLine.length >= 2 && (
|
|
71
71
|
<Polyline
|
|
72
72
|
positions={trailLine}
|
|
73
|
-
pathOptions={{
|
|
73
|
+
pathOptions={{
|
|
74
|
+
color: trailColor,
|
|
75
|
+
weight: 4,
|
|
76
|
+
opacity: 0.85,
|
|
77
|
+
dashArray: '1 8',
|
|
78
|
+
lineCap: 'round',
|
|
79
|
+
}}
|
|
74
80
|
/>
|
|
75
81
|
)}
|
|
76
82
|
{originOk && (
|
|
77
|
-
<Marker
|
|
83
|
+
<Marker
|
|
84
|
+
position={[originOk.lat, originOk.lng]}
|
|
85
|
+
icon={createPinIcon('origin', { glyph: false })}
|
|
86
|
+
>
|
|
78
87
|
<Popup>
|
|
79
88
|
<span className="font-semibold">{originOk.label ?? 'Origin'}</span>
|
|
80
89
|
</Popup>
|