@burdenoff/microfe-movethewheels 2026.703.4 → 2026.703.6
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-3YOnHO9Y.js → AIAssistantPage-BmILdHgO.js} +16 -15
- package/dist/AnalyticsPage-BSlsiSDE.js +194 -0
- package/dist/{CreateOrderPage-DRAgGo9i.js → CreateOrderPage-DaCgVaO3.js} +40 -40
- package/dist/{CustomerDetailsPage-BCeMmOFe.js → CustomerDetailsPage-DErpbafW.js} +71 -71
- package/dist/CustomersPage-C1lRU6xs.js +205 -0
- package/dist/DashboardPage-Q5-5EKAU.js +542 -0
- package/dist/{DataTable-XvUcTjwi.js → DataTable-KjzbwnRL.js} +31 -31
- package/dist/{DocumentsCard-U2lSe-cn.js → DocumentsCard-T9y6cv4-.js} +25 -25
- package/dist/{DriverDetailsPage-BQrYd_Lp.js → DriverDetailsPage-DnHGkDC7.js} +64 -64
- package/dist/DriversPage-C0ujWVOn.js +221 -0
- package/dist/FinancePage-CA2XEgsQ.js +175 -0
- package/dist/{FleetPage-3ZHsB-TN.js → FleetPage-DrvXW7wK.js} +22 -22
- package/dist/{FormError-cuLV2jVD.js → FormError-CRsMP7TQ.js} +1 -1
- package/dist/{ImportExportPage-C6f7DqhM.js → ImportExportPage-Cac9HjFx.js} +12 -12
- package/dist/InventoryPage-Ezf4gqKI.js +259 -0
- package/dist/LiveTrackingPage-CzbVwDqK.js +429 -0
- package/dist/{MarketplacePage-Bh_2ns4v.js → MarketplacePage-BHDmSQmo.js} +116 -116
- package/dist/MetricCard-DQlDNqmK.js +191 -0
- package/dist/{Notice-CSoDYKw9.js → Notice-GmA7JDR3.js} +2 -2
- package/dist/{OrderDetailsPage-zCj0lW0j.js → OrderDetailsPage-CR0Wc1aN.js} +58 -58
- package/dist/OrdersListPage-C8Bu6wXM.js +386 -0
- package/dist/{PageLayout-D4LDHJJq.js → PageLayout-DX1Ou6V6.js} +164 -134
- package/dist/{ProductDetailsPage-wsxAQkA0.js → ProductDetailsPage-B_ns2MOe.js} +55 -55
- package/dist/ProductsPage-c92BsEoA.js +186 -0
- package/dist/ReportsPage-CPLXtLT2.js +377 -0
- package/dist/{RouteDetailsPage-DyMJE9AS.js → RouteDetailsPage-DOfcRiFv.js} +208 -181
- package/dist/{RoutesPage-Dtc669yc.js → RoutesPage-BZGublby.js} +12 -12
- package/dist/{SettingsPage-CpH9xhQg.js → SettingsPage-5cweX_xh.js} +15 -15
- package/dist/Sparkline-zSXvG6vA.js +16729 -0
- package/dist/{StatusBadge-C87mDpDP.js → StatusBadge-oZjownr1.js} +7 -7
- package/dist/TrackingPage-Ln9qVflK.js +368 -0
- package/dist/{VehicleDetailsPage-DldYNsYV.js → VehicleDetailsPage-CrkzE0dN.js} +53 -53
- package/dist/VehiclesPage-CTQWH7af.js +184 -0
- package/dist/{WarehouseDetailsPage-CMG7or6G.js → WarehouseDetailsPage-CwDLaG65.js} +64 -64
- package/dist/WarehousesPage-KW02DvZg.js +182 -0
- package/dist/{arrow-left-n48Y-Wis.js → arrow-left-DJDw_Yqv.js} +1 -1
- package/dist/{arrow-right-Q3XQpTPR.js → arrow-right-Cb2fLTPJ.js} +1 -1
- package/dist/{arrow-up-xNF1zJUG.js → arrow-up-PxaOIyiT.js} +1 -1
- package/dist/{box-Eu05PXDh.js → box-hSJVtvGf.js} +1 -1
- package/dist/boxes-DDnxEkT5.js +54 -0
- package/dist/{chart-column-ouzgxIv_.js → chart-column-xXgAZvRl.js} +1 -1
- package/dist/charts-CfCwQg6o.js +2018 -0
- package/dist/{chevron-left-B2_r0Elx.js → chevron-left-dhEGJYdh.js} +1 -1
- package/dist/{chevron-right-eV4LjaSi.js → chevron-right-Cud2NDvm.js} +1 -1
- package/dist/chunk-BdsCSvBP.js +20 -0
- package/dist/{circle-alert-Bzh2DBSF.js → circle-alert-Rx0p3D5w.js} +1 -1
- package/dist/circle-check-BCxRFdFo.js +13 -0
- package/dist/{circle-check-big-CGMSpQmD.js → circle-check-big-BcIJ8xjx.js} +1 -1
- package/dist/{clock-Bl3ptexL.js → clock-B2_YxJgB.js} +1 -1
- package/dist/{dollar-sign-CAVU95SO.js → dollar-sign-CQmAICv4.js} +1 -1
- package/dist/{download-C5NbvVDc.js → download-CG4Tponq.js} +1 -1
- package/dist/{file-text-D-1uvLZG.js → file-text-CzH-zMub.js} +1 -1
- package/dist/{filter-DUfUg6BO.js → filter-C0u2Lwfn.js} +1 -1
- package/dist/{fuel-B6_lnKDs.js → fuel-C2KELcM-.js} +1 -1
- package/dist/index.css +2 -0
- package/dist/index.js +214 -225
- package/dist/{map-C-M-FQLR.js → map-FuPu5aTw.js} +1 -1
- package/dist/{map-pin-Dznl5l40.js → map-pin-czpLv9uy.js} +1 -1
- package/dist/mapMarkers-NCV9MRKR.js +28 -0
- package/dist/maps-D9m7PKrs.js +5070 -0
- package/dist/{navigation-BJSJl-VG.js → navigation-D5_pdCSS.js} +1 -1
- package/dist/{package-CcRttV2N.js → package-B0sdi6lU.js} +1 -1
- package/dist/{phone-DVSZHt_j.js → phone-V2nuzPu9.js} +1 -1
- package/dist/{plus-C_XZDwBz.js → plus-BqQxkfoU.js} +1 -1
- package/dist/{refresh-cw-CfgN67l3.js → refresh-cw-CEOAPEcV.js} +1 -1
- package/dist/route-CZWcW-Dw.js +22 -0
- package/dist/{save-DJE8Fpdv.js → save-DDFvrxWl.js} +1 -1
- package/dist/{search-D_VyGcZT.js → search-D7Ya6jxj.js} +1 -1
- package/dist/{square-pen-D-6JYrVQ.js → square-pen-DoZZS4Lw.js} +1 -1
- package/dist/{star-BpRlUZuU.js → star-B7PgVu5j.js} +1 -1
- package/dist/{store-B-8HMuyZ.js → store-YVzcIG4A.js} +1 -1
- package/dist/{trash-2-8vmv-XV_.js → trash-2-BegnBzwI.js} +1 -1
- package/dist/{trending-up-Dz6PqPRj.js → trending-up-DBd3XNdb.js} +1 -1
- package/dist/{triangle-alert-D7Y3J_4z.js → triangle-alert-Bxk3Kgs6.js} +1 -1
- package/dist/{truck-D-y2IDzv.js → truck-Clrn0oHp.js} +1 -1
- package/dist/{upload-CHZofOqb.js → upload-Df5JmMwH.js} +1 -1
- package/dist/{useAssistant-DVW4QgQb.js → useAssistant-Cb8nnIVC.js} +11 -28
- package/dist/{useCustomers-BPW4__PR.js → useCustomers-Dq2IR2HQ.js} +1 -1
- package/dist/{useFleet-ChBkxAd6.js → useFleet-CapnWBcA.js} +1 -1
- package/dist/{useImportExport-DrPDHEDK.js → useImportExport-BoGzrlJy.js} +1 -1
- package/dist/{useInventory-CAAVMRp6.js → useInventory-Ci6M2d9f.js} +1 -1
- package/dist/{useOrders-B465S2nt.js → useOrders-BuQU1OHX.js} +1 -1
- package/dist/{useReports-jQ3GpNOm.js → useReports-DIx8W7CO.js} +1 -1
- package/dist/{useRoutes-hS3d5-xr.js → useRoutes-D7EvI_pm.js} +1 -1
- package/dist/{useSettings-BB8X2RLh.js → useSettings-BhX251UQ.js} +6 -6
- package/dist/{useTracking-RjGz9PZG.js → useTracking-C40jmZ6W.js} +3 -3
- package/dist/{user-DzfTn4dE.js → user-BlcJrbtE.js} +1 -1
- package/dist/{user-check-BEKRCi7v.js → user-check-DtnQmimP.js} +1 -1
- package/dist/{users-CCrq-w0C.js → users-Cvwko-Dx.js} +1 -1
- package/dist/{warehouse-CaqfmMKh.js → warehouse-LWLVTk6G.js} +1 -1
- package/dist/{wrench-q_rgJfaP.js → wrench-Cme0RbyR.js} +1 -1
- package/dist/{x-tMeDMcCw.js → x-D8C9Pg5V.js} +1 -1
- package/package.json +5 -1
- package/src/movethewheels/components/GlassPanel.tsx +71 -0
- package/src/movethewheels/components/MetricCard.tsx +171 -73
- package/src/movethewheels/components/StatusBadge.tsx +7 -6
- package/src/movethewheels/components/charts/ChartShell.tsx +78 -0
- package/src/movethewheels/components/charts/Sparkline.tsx +85 -0
- package/src/movethewheels/components/charts/StatusDonut.tsx +115 -0
- package/src/movethewheels/components/charts/TrendChart.tsx +179 -0
- package/src/movethewheels/components/charts/VolumeBar.tsx +97 -0
- package/src/movethewheels/components/charts/chartTokens.ts +43 -0
- package/src/movethewheels/components/charts/index.ts +9 -0
- package/src/movethewheels/components/index.ts +44 -1
- package/src/movethewheels/components/maps/LogisticsMap.tsx +94 -0
- package/src/movethewheels/components/maps/MapCanvas.tsx +118 -0
- package/src/movethewheels/components/maps/RouteMap.tsx +71 -0
- package/src/movethewheels/components/maps/TrackingMap.tsx +102 -0
- package/src/movethewheels/components/maps/index.ts +16 -0
- package/src/movethewheels/components/maps/leaflet-setup.ts +124 -0
- package/src/movethewheels/components/maps/map-markers.css +121 -0
- package/src/movethewheels/hooks/useAnalytics.ts +14 -4
- package/src/movethewheels/pages/AnalyticsPage.tsx +93 -73
- package/src/movethewheels/pages/CreateOrderPage.tsx +4 -4
- package/src/movethewheels/pages/CustomersPage.tsx +29 -20
- package/src/movethewheels/pages/DashboardPage.tsx +238 -12
- package/src/movethewheels/pages/DriverDetailsPage.tsx +1 -1
- package/src/movethewheels/pages/DriversPage.tsx +35 -24
- package/src/movethewheels/pages/FinancePage.tsx +68 -30
- package/src/movethewheels/pages/InventoryPage.tsx +15 -3
- package/src/movethewheels/pages/LiveTrackingPage.tsx +124 -16
- package/src/movethewheels/pages/OrdersListPage.tsx +46 -38
- package/src/movethewheels/pages/ProductsPage.tsx +28 -24
- package/src/movethewheels/pages/ReportsPage.tsx +23 -0
- package/src/movethewheels/pages/RouteDetailsPage.tsx +46 -7
- package/src/movethewheels/pages/SettingsPage.tsx +2 -2
- package/src/movethewheels/pages/TrackingPage.tsx +76 -6
- package/src/movethewheels/pages/VehicleDetailsPage.tsx +1 -1
- package/src/movethewheels/pages/VehiclesPage.tsx +34 -24
- package/src/movethewheels/pages/WarehouseDetailsPage.tsx +1 -1
- package/src/movethewheels/pages/WarehousesPage.tsx +28 -22
- package/src/movethewheels/types/index.ts +1 -1
- package/src/movethewheels/utils/graphqlClient.ts +81 -31
- package/src/movethewheels/utils/mapMarkers.ts +58 -0
- package/dist/AnalyticsPage-CMpI1070.js +0 -215
- package/dist/CustomersPage-CaNBMXmM.js +0 -172
- package/dist/DashboardPage-DIKlXde3.js +0 -387
- package/dist/DriversPage-PYmdFiby.js +0 -176
- package/dist/FinancePage-Cwh9Bw4M.js +0 -136
- package/dist/InventoryPage-DpiqVu1v.js +0 -253
- package/dist/LiveTrackingPage-FAzzlVnX.js +0 -379
- package/dist/MetricCard-CVBVpu7o.js +0 -146
- package/dist/OrdersListPage-CAMsuUck.js +0 -384
- package/dist/ProductsPage-DC5qDLfz.js +0 -180
- package/dist/ReportsPage-BwUJ37eO.js +0 -356
- package/dist/TrackingPage-DaNEFG_h.js +0 -325
- package/dist/VehiclesPage-BFw13iMt.js +0 -176
- package/dist/WarehousesPage-Wkytnt86.js +0 -173
- package/dist/useAnalytics-D7HW2XRb.js +0 -347
- /package/dist/{formatters-BQr-aR5W.js → formatters-FWJDwTFv.js} +0 -0
|
@@ -1,176 +0,0 @@
|
|
|
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-XvUcTjwi.js";
|
|
3
|
-
import { t as a } from "./download-C5NbvVDc.js";
|
|
4
|
-
import { t as o } from "./plus-C_XZDwBz.js";
|
|
5
|
-
import { t as s } from "./refresh-cw-CfgN67l3.js";
|
|
6
|
-
import { t as c } from "./truck-D-y2IDzv.js";
|
|
7
|
-
import { i as l, o as u } from "./useFleet-ChBkxAd6.js";
|
|
8
|
-
import { a as d, r as f } from "./StatusBadge-C87mDpDP.js";
|
|
9
|
-
import { useState as p } from "react";
|
|
10
|
-
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
11
|
-
import { CTAOverflowMenu as g, EmphasisPanel as _, PagePurpose as v } from "@burdenoff/fe-libs/ui";
|
|
12
|
-
//#region src/movethewheels/pages/VehiclesPage.tsx
|
|
13
|
-
function y() {
|
|
14
|
-
let { basePath: y, navigate: b } = r(), [x, S] = p(0), [C, w] = p(25), { vehicles: T, isLoading: E, refetch: D } = u({
|
|
15
|
-
limit: C,
|
|
16
|
-
offset: x * C
|
|
17
|
-
}), { stats: O } = l(), k = O.totalVehicles, A = (e) => {
|
|
18
|
-
b && b(t(y, e));
|
|
19
|
-
};
|
|
20
|
-
return /* @__PURE__ */ h(n, {
|
|
21
|
-
title: "Vehicles",
|
|
22
|
-
subtitle: `${k} vehicles in fleet`,
|
|
23
|
-
icon: /* @__PURE__ */ m(c, { size: 24 }),
|
|
24
|
-
headerActions: /* @__PURE__ */ m(g, {
|
|
25
|
-
primary: {
|
|
26
|
-
label: "Add Vehicle",
|
|
27
|
-
icon: /* @__PURE__ */ m(o, { size: 16 }),
|
|
28
|
-
onSelect: () => A("fleet/vehicles/new")
|
|
29
|
-
},
|
|
30
|
-
actions: [{
|
|
31
|
-
label: "Refresh",
|
|
32
|
-
icon: /* @__PURE__ */ m(s, { size: 16 }),
|
|
33
|
-
onSelect: () => D()
|
|
34
|
-
}, {
|
|
35
|
-
label: "Export",
|
|
36
|
-
icon: /* @__PURE__ */ m(a, { size: 16 }),
|
|
37
|
-
onSelect: () => A("import-export")
|
|
38
|
-
}]
|
|
39
|
-
}),
|
|
40
|
-
children: [
|
|
41
|
-
/* @__PURE__ */ m(v, {
|
|
42
|
-
icon: /* @__PURE__ */ m(c, { size: 18 }),
|
|
43
|
-
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."
|
|
44
|
-
}),
|
|
45
|
-
/* @__PURE__ */ h(_, { children: [/* @__PURE__ */ m("p", {
|
|
46
|
-
className: "text-sm font-medium text-text-secondary",
|
|
47
|
-
children: "Fleet at a glance"
|
|
48
|
-
}), /* @__PURE__ */ h("div", {
|
|
49
|
-
className: "mt-3 grid grid-cols-3 gap-4",
|
|
50
|
-
children: [
|
|
51
|
-
/* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("p", {
|
|
52
|
-
className: "text-2xl font-bold text-text-primary tabular-nums",
|
|
53
|
-
children: k
|
|
54
|
-
}), /* @__PURE__ */ m("p", {
|
|
55
|
-
className: "text-xs text-text-secondary",
|
|
56
|
-
children: "Total vehicles"
|
|
57
|
-
})] }),
|
|
58
|
-
/* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("p", {
|
|
59
|
-
className: "text-2xl font-bold text-text-primary tabular-nums",
|
|
60
|
-
children: O.vehiclesByStatus.available
|
|
61
|
-
}), /* @__PURE__ */ m("p", {
|
|
62
|
-
className: "text-xs text-text-secondary",
|
|
63
|
-
children: "Available now"
|
|
64
|
-
})] }),
|
|
65
|
-
/* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("p", {
|
|
66
|
-
className: "text-2xl font-bold text-text-primary tabular-nums",
|
|
67
|
-
children: O.vehiclesByStatus.maintenance
|
|
68
|
-
}), /* @__PURE__ */ m("p", {
|
|
69
|
-
className: "text-xs text-text-secondary",
|
|
70
|
-
children: "In maintenance"
|
|
71
|
-
})] })
|
|
72
|
-
]
|
|
73
|
-
})] }),
|
|
74
|
-
/* @__PURE__ */ m(i, {
|
|
75
|
-
columns: [
|
|
76
|
-
{
|
|
77
|
-
id: "vehicleNumber",
|
|
78
|
-
header: "Vehicle #",
|
|
79
|
-
accessorKey: "vehicleNumber",
|
|
80
|
-
sortable: !0,
|
|
81
|
-
cell: (e) => /* @__PURE__ */ m("span", {
|
|
82
|
-
className: "font-medium",
|
|
83
|
-
children: e.vehicleNumber
|
|
84
|
-
})
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
id: "type",
|
|
88
|
-
header: "Type",
|
|
89
|
-
accessorKey: "type",
|
|
90
|
-
cell: (e) => /* @__PURE__ */ m(d, { type: e.type })
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
id: "details",
|
|
94
|
-
header: "Vehicle",
|
|
95
|
-
cell: (e) => /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ h("p", {
|
|
96
|
-
className: "font-medium",
|
|
97
|
-
children: [
|
|
98
|
-
e.make,
|
|
99
|
-
" ",
|
|
100
|
-
e.model
|
|
101
|
-
]
|
|
102
|
-
}), /* @__PURE__ */ m("p", {
|
|
103
|
-
className: "text-sm text-text-secondary",
|
|
104
|
-
children: e.year
|
|
105
|
-
})] })
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
id: "status",
|
|
109
|
-
header: "Status",
|
|
110
|
-
accessorKey: "status",
|
|
111
|
-
sortable: !0,
|
|
112
|
-
cell: (e) => /* @__PURE__ */ m(f, {
|
|
113
|
-
status: e.status,
|
|
114
|
-
type: "vehicle"
|
|
115
|
-
})
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
id: "capacity",
|
|
119
|
-
header: "Capacity",
|
|
120
|
-
cell: (e) => /* @__PURE__ */ h("div", {
|
|
121
|
-
className: "text-sm",
|
|
122
|
-
children: [/* @__PURE__ */ h("p", { children: [e.capacity.weight, " kg"] }), /* @__PURE__ */ h("p", {
|
|
123
|
-
className: "text-text-secondary",
|
|
124
|
-
children: [e.capacity.volume, " m³"]
|
|
125
|
-
})]
|
|
126
|
-
})
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
id: "fuel",
|
|
130
|
-
header: "Fuel Level",
|
|
131
|
-
cell: (t) => t.fuelLevel === void 0 ? "-" : /* @__PURE__ */ h("div", {
|
|
132
|
-
className: "flex items-center gap-2",
|
|
133
|
-
children: [/* @__PURE__ */ m(e, {
|
|
134
|
-
value: t.fuelLevel,
|
|
135
|
-
className: "w-16 h-2"
|
|
136
|
-
}), /* @__PURE__ */ h("span", {
|
|
137
|
-
className: "text-sm",
|
|
138
|
-
children: [t.fuelLevel, "%"]
|
|
139
|
-
})]
|
|
140
|
-
})
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
id: "mileage",
|
|
144
|
-
header: "Mileage",
|
|
145
|
-
accessorKey: "mileage",
|
|
146
|
-
sortable: !0,
|
|
147
|
-
cell: (e) => e.mileage ? `${e.mileage.toLocaleString()} mi` : "-"
|
|
148
|
-
}
|
|
149
|
-
],
|
|
150
|
-
data: T,
|
|
151
|
-
isLoading: E,
|
|
152
|
-
searchable: !0,
|
|
153
|
-
searchPlaceholder: "Search vehicles...",
|
|
154
|
-
searchFields: [
|
|
155
|
-
"vehicleNumber",
|
|
156
|
-
"make",
|
|
157
|
-
"model"
|
|
158
|
-
],
|
|
159
|
-
onRowClick: (e) => A(`fleet/vehicles/${e.id}`),
|
|
160
|
-
getRowId: (e) => e.id,
|
|
161
|
-
pageIndex: x,
|
|
162
|
-
pageSize: C,
|
|
163
|
-
onPageChange: S,
|
|
164
|
-
onPageSizeChange: (e) => {
|
|
165
|
-
w(e), S(0);
|
|
166
|
-
},
|
|
167
|
-
totalItems: k,
|
|
168
|
-
emptyIllustration: "empty-data",
|
|
169
|
-
emptyTitle: "No vehicles yet",
|
|
170
|
-
emptyDescription: "Add vehicles to your fleet to start assigning them to deliveries."
|
|
171
|
-
})
|
|
172
|
-
]
|
|
173
|
-
});
|
|
174
|
-
}
|
|
175
|
-
//#endregion
|
|
176
|
-
export { y as default };
|
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
import { M as e, ct as t, i as n, l as r, ot as i } from "./PageLayout-D4LDHJJq.js";
|
|
2
|
-
import { t as a } from "./DataTable-XvUcTjwi.js";
|
|
3
|
-
import { t as o } from "./plus-C_XZDwBz.js";
|
|
4
|
-
import { t as s } from "./refresh-cw-CfgN67l3.js";
|
|
5
|
-
import { t as c } from "./warehouse-CaqfmMKh.js";
|
|
6
|
-
import { c as l, s as u } from "./useInventory-CAAVMRp6.js";
|
|
7
|
-
import { useState as d } from "react";
|
|
8
|
-
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
9
|
-
import { CTAOverflowMenu as m, EmphasisPanel as h, PagePurpose as g } from "@burdenoff/fe-libs/ui";
|
|
10
|
-
//#region src/movethewheels/pages/WarehousesPage.tsx
|
|
11
|
-
function _() {
|
|
12
|
-
let { basePath: _, navigate: v } = i(), [y, b] = d(0), [x, S] = d(25), { warehouses: C, hasMore: w, isLoading: T, refetch: E } = l({
|
|
13
|
-
limit: x,
|
|
14
|
-
offset: y * x
|
|
15
|
-
}), { stats: D } = u(), O = (e) => v?.(t(_, e));
|
|
16
|
-
return /* @__PURE__ */ p(n, {
|
|
17
|
-
title: "Warehouses",
|
|
18
|
-
subtitle: `${D.total} warehouses`,
|
|
19
|
-
icon: /* @__PURE__ */ f(c, { size: 24 }),
|
|
20
|
-
headerActions: /* @__PURE__ */ f(m, {
|
|
21
|
-
primary: {
|
|
22
|
-
label: "Add Warehouse",
|
|
23
|
-
icon: /* @__PURE__ */ f(o, { size: 16 }),
|
|
24
|
-
onSelect: () => O("inventory/warehouses/new")
|
|
25
|
-
},
|
|
26
|
-
actions: [{
|
|
27
|
-
label: "Refresh",
|
|
28
|
-
icon: /* @__PURE__ */ f(s, { size: 16 }),
|
|
29
|
-
onSelect: () => E()
|
|
30
|
-
}]
|
|
31
|
-
}),
|
|
32
|
-
children: [
|
|
33
|
-
/* @__PURE__ */ f(g, {
|
|
34
|
-
icon: /* @__PURE__ */ f(c, { size: 18 }),
|
|
35
|
-
children: "Your storage and fulfilment sites. Watch space and pallet utilization across each warehouse to balance stock, spot capacity crunches, and decide where to fulfil an order from."
|
|
36
|
-
}),
|
|
37
|
-
/* @__PURE__ */ p(h, { children: [/* @__PURE__ */ f("p", {
|
|
38
|
-
className: "text-sm font-medium text-text-secondary",
|
|
39
|
-
children: "Network at a glance"
|
|
40
|
-
}), /* @__PURE__ */ p("div", {
|
|
41
|
-
className: "mt-3 grid grid-cols-3 gap-4",
|
|
42
|
-
children: [
|
|
43
|
-
/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("p", {
|
|
44
|
-
className: "text-2xl font-bold text-text-primary tabular-nums",
|
|
45
|
-
children: D.total
|
|
46
|
-
}), /* @__PURE__ */ f("p", {
|
|
47
|
-
className: "text-xs text-text-secondary",
|
|
48
|
-
children: "Total sites"
|
|
49
|
-
})] }),
|
|
50
|
-
/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("p", {
|
|
51
|
-
className: "text-2xl font-bold text-text-primary tabular-nums",
|
|
52
|
-
children: D.active
|
|
53
|
-
}), /* @__PURE__ */ f("p", {
|
|
54
|
-
className: "text-xs text-text-secondary",
|
|
55
|
-
children: "Active"
|
|
56
|
-
})] }),
|
|
57
|
-
/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("p", {
|
|
58
|
-
className: "text-2xl font-bold text-text-primary tabular-nums",
|
|
59
|
-
children: D.total > 0 ? `${Math.round(D.avgUtilization * 100)}%` : "—"
|
|
60
|
-
}), /* @__PURE__ */ f("p", {
|
|
61
|
-
className: "text-xs text-text-secondary",
|
|
62
|
-
children: "Avg utilization"
|
|
63
|
-
})] })
|
|
64
|
-
]
|
|
65
|
-
})] }),
|
|
66
|
-
/* @__PURE__ */ f(a, {
|
|
67
|
-
columns: [
|
|
68
|
-
{
|
|
69
|
-
id: "name",
|
|
70
|
-
header: "Warehouse",
|
|
71
|
-
accessorKey: "name",
|
|
72
|
-
sortable: !0,
|
|
73
|
-
cell: (e) => /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("p", {
|
|
74
|
-
className: "font-medium",
|
|
75
|
-
children: e.name
|
|
76
|
-
}), /* @__PURE__ */ f("p", {
|
|
77
|
-
className: "text-sm text-text-secondary",
|
|
78
|
-
children: e.code
|
|
79
|
-
})] })
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
id: "location",
|
|
83
|
-
header: "Location",
|
|
84
|
-
cell: (e) => /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ p("p", { children: [
|
|
85
|
-
e.address.city,
|
|
86
|
-
", ",
|
|
87
|
-
e.address.state
|
|
88
|
-
] }), /* @__PURE__ */ f("p", {
|
|
89
|
-
className: "text-sm text-text-secondary",
|
|
90
|
-
children: e.address.country
|
|
91
|
-
})] })
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
id: "type",
|
|
95
|
-
header: "Type",
|
|
96
|
-
accessorKey: "type",
|
|
97
|
-
cell: (e) => /* @__PURE__ */ f(r, {
|
|
98
|
-
variant: "outline",
|
|
99
|
-
className: "capitalize",
|
|
100
|
-
children: e.type.replace("_", " ")
|
|
101
|
-
})
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
id: "utilization",
|
|
105
|
-
header: "Utilization",
|
|
106
|
-
cell: (t) => {
|
|
107
|
-
let n = t.capacity.usedSpace / t.capacity.totalSpace * 100;
|
|
108
|
-
return /* @__PURE__ */ p("div", {
|
|
109
|
-
className: "flex items-center gap-2",
|
|
110
|
-
children: [/* @__PURE__ */ f(e, {
|
|
111
|
-
value: n,
|
|
112
|
-
className: "w-16 h-2"
|
|
113
|
-
}), /* @__PURE__ */ p("span", {
|
|
114
|
-
className: "text-sm",
|
|
115
|
-
children: [n.toFixed(0), "%"]
|
|
116
|
-
})]
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
id: "capacity",
|
|
122
|
-
header: "Capacity",
|
|
123
|
-
cell: (e) => /* @__PURE__ */ p("div", {
|
|
124
|
-
className: "text-sm",
|
|
125
|
-
children: [/* @__PURE__ */ p("p", { children: [
|
|
126
|
-
e.capacity.usedSpace.toLocaleString(),
|
|
127
|
-
" / ",
|
|
128
|
-
e.capacity.totalSpace.toLocaleString(),
|
|
129
|
-
" ",
|
|
130
|
-
"sq ft"
|
|
131
|
-
] }), /* @__PURE__ */ p("p", {
|
|
132
|
-
className: "text-text-secondary",
|
|
133
|
-
children: [
|
|
134
|
-
e.capacity.usedPallets,
|
|
135
|
-
" / ",
|
|
136
|
-
e.capacity.totalPallets,
|
|
137
|
-
" pallets"
|
|
138
|
-
]
|
|
139
|
-
})]
|
|
140
|
-
})
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
id: "status",
|
|
144
|
-
header: "Status",
|
|
145
|
-
cell: (e) => /* @__PURE__ */ f(r, {
|
|
146
|
-
variant: e.isActive ? "default" : "secondary",
|
|
147
|
-
children: e.isActive ? "Active" : "Inactive"
|
|
148
|
-
})
|
|
149
|
-
}
|
|
150
|
-
],
|
|
151
|
-
data: C,
|
|
152
|
-
isLoading: T,
|
|
153
|
-
searchable: !0,
|
|
154
|
-
searchPlaceholder: "Search warehouses...",
|
|
155
|
-
searchFields: ["name", "code"],
|
|
156
|
-
onRowClick: (e) => O(`inventory/warehouses/${e.id}`),
|
|
157
|
-
getRowId: (e) => e.id,
|
|
158
|
-
pageIndex: y,
|
|
159
|
-
pageSize: x,
|
|
160
|
-
onPageChange: b,
|
|
161
|
-
onPageSizeChange: (e) => {
|
|
162
|
-
S(e), b(0);
|
|
163
|
-
},
|
|
164
|
-
hasNextPage: w,
|
|
165
|
-
emptyIllustration: "empty-data",
|
|
166
|
-
emptyTitle: "No warehouses yet",
|
|
167
|
-
emptyDescription: "Add a warehouse to store inventory and fulfil orders from it."
|
|
168
|
-
})
|
|
169
|
-
]
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
//#endregion
|
|
173
|
-
export { _ as default };
|
|
@@ -1,347 +0,0 @@
|
|
|
1
|
-
import { it as e, ot as t } from "./PageLayout-D4LDHJJq.js";
|
|
2
|
-
import { useCallback as n, useEffect as r, useMemo as i, useState as a } from "react";
|
|
3
|
-
//#region src/movethewheels/hooks/useAnalytics.ts
|
|
4
|
-
var o = "\n query GetMovethewheelsAnalytics {\n analytics {\n orderTrend {\n label\n value\n }\n deliveryTrend {\n label\n value\n }\n revenueTrend {\n label\n value\n }\n }\n dashboardMetrics {\n totalOrders\n activeDeliveries\n availableDrivers\n activeVehicles\n lowStockItems\n totalRevenue\n onTimeDeliveryRate\n customerSatisfaction\n }\n fleetStats {\n totalVehicles\n activeVehicles\n maintenanceVehicles\n avgDriverRating\n }\n }\n", s = "\n query GetDashboardMetrics {\n dashboardMetrics {\n totalOrders\n activeDeliveries\n availableDrivers\n activeVehicles\n lowStockItems\n totalRevenue\n onTimeDeliveryRate\n customerSatisfaction\n }\n orderStats {\n total\n pending\n inTransit\n delivered\n cancelled\n failed\n }\n fleetStats {\n totalVehicles\n activeVehicles\n maintenanceVehicles\n totalDrivers\n availableDrivers\n onDeliveryDrivers\n avgDriverRating\n }\n financeMetrics {\n revenue {\n totalRevenue\n averageOrderValue\n }\n }\n }\n", c = "\n query GetOrderAnalytics {\n orderStats {\n pending\n inTransit\n delivered\n cancelled\n failed\n }\n analytics {\n orderTrend {\n label\n value\n }\n }\n }\n";
|
|
5
|
-
function l() {
|
|
6
|
-
return {
|
|
7
|
-
overview: {
|
|
8
|
-
totalOrders: 0,
|
|
9
|
-
totalRevenue: 0,
|
|
10
|
-
activeVehicles: 0,
|
|
11
|
-
onTimeDeliveryRate: 0,
|
|
12
|
-
customerSatisfaction: 0
|
|
13
|
-
},
|
|
14
|
-
trends: {
|
|
15
|
-
dailyOrders: [],
|
|
16
|
-
revenue: []
|
|
17
|
-
},
|
|
18
|
-
fleet: {
|
|
19
|
-
utilization: 0,
|
|
20
|
-
totalVehicles: 0,
|
|
21
|
-
activeVehicles: 0,
|
|
22
|
-
maintenanceVehicles: 0,
|
|
23
|
-
outOfServiceVehicles: 0,
|
|
24
|
-
fuelEfficiency: 0
|
|
25
|
-
},
|
|
26
|
-
performance: {
|
|
27
|
-
onTimePickup: 0,
|
|
28
|
-
onTimeDelivery: 0,
|
|
29
|
-
damagedItems: 0,
|
|
30
|
-
customerComplaints: 0,
|
|
31
|
-
driverRatings: 0
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
function u(s = {}) {
|
|
36
|
-
let { apiGatewayUrl: c, authToken: u, workspaceToken: d, workspaceId: f, tenantId: p, currentUser: m } = t(), [h, g] = a(l()), [_, v] = a(!1), [y, b] = a(null), x = i(() => ({
|
|
37
|
-
apiGatewayUrl: c,
|
|
38
|
-
authToken: u,
|
|
39
|
-
workspaceToken: d,
|
|
40
|
-
workspaceId: f,
|
|
41
|
-
tenantId: p,
|
|
42
|
-
actorId: m?.id
|
|
43
|
-
}), [
|
|
44
|
-
c,
|
|
45
|
-
u,
|
|
46
|
-
d,
|
|
47
|
-
f,
|
|
48
|
-
p,
|
|
49
|
-
m?.id
|
|
50
|
-
]), S = n(async () => {
|
|
51
|
-
v(!0), b(null);
|
|
52
|
-
try {
|
|
53
|
-
let t = await e(x, o);
|
|
54
|
-
g({
|
|
55
|
-
overview: {
|
|
56
|
-
totalOrders: t.dashboardMetrics.totalOrders,
|
|
57
|
-
totalRevenue: t.dashboardMetrics.totalRevenue,
|
|
58
|
-
activeVehicles: t.dashboardMetrics.activeVehicles,
|
|
59
|
-
onTimeDeliveryRate: t.dashboardMetrics.onTimeDeliveryRate,
|
|
60
|
-
customerSatisfaction: t.dashboardMetrics.customerSatisfaction
|
|
61
|
-
},
|
|
62
|
-
trends: {
|
|
63
|
-
dailyOrders: t.analytics.orderTrend.map((e) => ({
|
|
64
|
-
date: e.label,
|
|
65
|
-
orders: Math.round(e.value)
|
|
66
|
-
})),
|
|
67
|
-
revenue: t.analytics.revenueTrend.map((e) => ({
|
|
68
|
-
month: e.label,
|
|
69
|
-
revenue: e.value
|
|
70
|
-
}))
|
|
71
|
-
},
|
|
72
|
-
fleet: {
|
|
73
|
-
utilization: t.fleetStats.totalVehicles > 0 ? t.fleetStats.activeVehicles / t.fleetStats.totalVehicles * 100 : 0,
|
|
74
|
-
totalVehicles: t.fleetStats.totalVehicles,
|
|
75
|
-
activeVehicles: t.fleetStats.activeVehicles,
|
|
76
|
-
maintenanceVehicles: t.fleetStats.maintenanceVehicles,
|
|
77
|
-
outOfServiceVehicles: Math.max(t.fleetStats.totalVehicles - t.fleetStats.activeVehicles - t.fleetStats.maintenanceVehicles, 0),
|
|
78
|
-
fuelEfficiency: 0
|
|
79
|
-
},
|
|
80
|
-
performance: {
|
|
81
|
-
onTimePickup: 0,
|
|
82
|
-
onTimeDelivery: t.dashboardMetrics.onTimeDeliveryRate,
|
|
83
|
-
damagedItems: 0,
|
|
84
|
-
customerComplaints: 0,
|
|
85
|
-
driverRatings: t.fleetStats.avgDriverRating
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
} catch (e) {
|
|
89
|
-
b(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load analytics"));
|
|
90
|
-
} finally {
|
|
91
|
-
v(!1);
|
|
92
|
-
}
|
|
93
|
-
}, [x]);
|
|
94
|
-
return r(() => {
|
|
95
|
-
S();
|
|
96
|
-
}, [S]), {
|
|
97
|
-
analytics: h,
|
|
98
|
-
isLoading: _,
|
|
99
|
-
error: y,
|
|
100
|
-
refetch: n(() => {
|
|
101
|
-
S();
|
|
102
|
-
}, [S])
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
function d() {
|
|
106
|
-
let { apiGatewayUrl: n, authToken: o, workspaceToken: c, workspaceId: l, tenantId: u, currentUser: d } = t(), [f, p] = a({
|
|
107
|
-
orders: {
|
|
108
|
-
total: 0,
|
|
109
|
-
pending: 0,
|
|
110
|
-
inTransit: 0,
|
|
111
|
-
delivered: 0,
|
|
112
|
-
today: 0
|
|
113
|
-
},
|
|
114
|
-
fleet: {
|
|
115
|
-
totalVehicles: 0,
|
|
116
|
-
activeVehicles: 0,
|
|
117
|
-
totalDrivers: 0,
|
|
118
|
-
availableDrivers: 0
|
|
119
|
-
},
|
|
120
|
-
revenue: {
|
|
121
|
-
total: 0,
|
|
122
|
-
avgOrderValue: 0,
|
|
123
|
-
currency: "USD"
|
|
124
|
-
},
|
|
125
|
-
performance: {
|
|
126
|
-
onTimeDeliveryRate: 0,
|
|
127
|
-
avgDriverRating: 0
|
|
128
|
-
}
|
|
129
|
-
}), [m, h] = a(!1), [g, _] = a(null), v = i(() => ({
|
|
130
|
-
apiGatewayUrl: n,
|
|
131
|
-
authToken: o,
|
|
132
|
-
workspaceToken: c,
|
|
133
|
-
workspaceId: l,
|
|
134
|
-
tenantId: u,
|
|
135
|
-
actorId: d?.id
|
|
136
|
-
}), [
|
|
137
|
-
n,
|
|
138
|
-
o,
|
|
139
|
-
c,
|
|
140
|
-
l,
|
|
141
|
-
u,
|
|
142
|
-
d?.id
|
|
143
|
-
]);
|
|
144
|
-
return r(() => {
|
|
145
|
-
(async () => {
|
|
146
|
-
h(!0), _(null);
|
|
147
|
-
try {
|
|
148
|
-
let t = await e(v, s);
|
|
149
|
-
p({
|
|
150
|
-
orders: {
|
|
151
|
-
total: t.orderStats.total,
|
|
152
|
-
pending: t.orderStats.pending,
|
|
153
|
-
inTransit: t.orderStats.inTransit,
|
|
154
|
-
delivered: t.orderStats.delivered,
|
|
155
|
-
today: 0
|
|
156
|
-
},
|
|
157
|
-
fleet: {
|
|
158
|
-
totalVehicles: t.fleetStats.totalVehicles,
|
|
159
|
-
activeVehicles: t.fleetStats.activeVehicles,
|
|
160
|
-
totalDrivers: t.fleetStats.totalDrivers,
|
|
161
|
-
availableDrivers: t.fleetStats.availableDrivers
|
|
162
|
-
},
|
|
163
|
-
revenue: {
|
|
164
|
-
total: t.financeMetrics.revenue.totalRevenue,
|
|
165
|
-
avgOrderValue: t.financeMetrics.revenue.averageOrderValue,
|
|
166
|
-
currency: "USD"
|
|
167
|
-
},
|
|
168
|
-
performance: {
|
|
169
|
-
onTimeDeliveryRate: t.dashboardMetrics.onTimeDeliveryRate,
|
|
170
|
-
avgDriverRating: t.fleetStats.avgDriverRating
|
|
171
|
-
}
|
|
172
|
-
});
|
|
173
|
-
} catch (e) {
|
|
174
|
-
_(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load dashboard metrics"));
|
|
175
|
-
} finally {
|
|
176
|
-
h(!1);
|
|
177
|
-
}
|
|
178
|
-
})();
|
|
179
|
-
}, [v]), {
|
|
180
|
-
metrics: f,
|
|
181
|
-
isLoading: m,
|
|
182
|
-
error: g
|
|
183
|
-
};
|
|
184
|
-
}
|
|
185
|
-
function f(e = "monthly") {
|
|
186
|
-
let { analytics: t, isLoading: n, error: r } = u();
|
|
187
|
-
return {
|
|
188
|
-
revenueData: i(() => e === "daily" ? t.trends.dailyOrders.map((e) => ({
|
|
189
|
-
label: e.date,
|
|
190
|
-
value: e.orders
|
|
191
|
-
})) : t.trends.revenue.map((e) => ({
|
|
192
|
-
label: e.month,
|
|
193
|
-
value: e.revenue
|
|
194
|
-
})), [
|
|
195
|
-
t.trends.dailyOrders,
|
|
196
|
-
t.trends.revenue,
|
|
197
|
-
e
|
|
198
|
-
]),
|
|
199
|
-
isLoading: n,
|
|
200
|
-
error: r
|
|
201
|
-
};
|
|
202
|
-
}
|
|
203
|
-
function p() {
|
|
204
|
-
let { apiGatewayUrl: n, authToken: o, workspaceToken: s, workspaceId: l, tenantId: u, currentUser: d } = t(), [f, p] = a({
|
|
205
|
-
byStatus: [],
|
|
206
|
-
byType: [],
|
|
207
|
-
byPriority: [],
|
|
208
|
-
trends: []
|
|
209
|
-
}), [m, h] = a(!1), [g, _] = a(null), v = i(() => ({
|
|
210
|
-
apiGatewayUrl: n,
|
|
211
|
-
authToken: o,
|
|
212
|
-
workspaceToken: s,
|
|
213
|
-
workspaceId: l,
|
|
214
|
-
tenantId: u,
|
|
215
|
-
actorId: d?.id
|
|
216
|
-
}), [
|
|
217
|
-
n,
|
|
218
|
-
o,
|
|
219
|
-
s,
|
|
220
|
-
l,
|
|
221
|
-
u,
|
|
222
|
-
d?.id
|
|
223
|
-
]);
|
|
224
|
-
return r(() => {
|
|
225
|
-
(async () => {
|
|
226
|
-
h(!0), _(null);
|
|
227
|
-
try {
|
|
228
|
-
let t = await e(v, c);
|
|
229
|
-
p({
|
|
230
|
-
byStatus: [
|
|
231
|
-
{
|
|
232
|
-
status: "pending",
|
|
233
|
-
count: t.orderStats.pending
|
|
234
|
-
},
|
|
235
|
-
{
|
|
236
|
-
status: "in_transit",
|
|
237
|
-
count: t.orderStats.inTransit
|
|
238
|
-
},
|
|
239
|
-
{
|
|
240
|
-
status: "delivered",
|
|
241
|
-
count: t.orderStats.delivered
|
|
242
|
-
},
|
|
243
|
-
{
|
|
244
|
-
status: "cancelled",
|
|
245
|
-
count: t.orderStats.cancelled
|
|
246
|
-
},
|
|
247
|
-
{
|
|
248
|
-
status: "failed",
|
|
249
|
-
count: t.orderStats.failed
|
|
250
|
-
}
|
|
251
|
-
],
|
|
252
|
-
byType: [],
|
|
253
|
-
byPriority: [],
|
|
254
|
-
trends: t.analytics.orderTrend.map((e) => ({
|
|
255
|
-
date: e.label,
|
|
256
|
-
orders: Math.round(e.value)
|
|
257
|
-
}))
|
|
258
|
-
});
|
|
259
|
-
} catch (e) {
|
|
260
|
-
_(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load order analytics"));
|
|
261
|
-
} finally {
|
|
262
|
-
h(!1);
|
|
263
|
-
}
|
|
264
|
-
})();
|
|
265
|
-
}, [v]), {
|
|
266
|
-
orderData: f,
|
|
267
|
-
isLoading: m,
|
|
268
|
-
error: g
|
|
269
|
-
};
|
|
270
|
-
}
|
|
271
|
-
function m() {
|
|
272
|
-
let { analytics: e, isLoading: t, error: n } = u();
|
|
273
|
-
return {
|
|
274
|
-
fleetData: i(() => ({
|
|
275
|
-
vehicleUtilization: e.fleet.utilization,
|
|
276
|
-
avgFuelLevel: 0,
|
|
277
|
-
vehiclesByType: [],
|
|
278
|
-
driverPerformance: [],
|
|
279
|
-
fleetStats: e.fleet
|
|
280
|
-
}), [e.fleet]),
|
|
281
|
-
isLoading: t,
|
|
282
|
-
error: n
|
|
283
|
-
};
|
|
284
|
-
}
|
|
285
|
-
var h = "\n query GetMovethewheelsFinanceMetrics {\n financeMetrics {\n revenue {\n totalRevenue\n deliveredRevenue\n averageOrderValue\n }\n fuelCost\n openInvoices\n }\n }\n";
|
|
286
|
-
function g() {
|
|
287
|
-
let { apiGatewayUrl: o, authToken: s, workspaceToken: c, workspaceId: l, tenantId: u, currentUser: d } = t(), [f, p] = a({
|
|
288
|
-
totalRevenue: 0,
|
|
289
|
-
deliveredRevenue: 0,
|
|
290
|
-
averageOrderValue: 0,
|
|
291
|
-
fuelCost: 0,
|
|
292
|
-
openInvoices: 0
|
|
293
|
-
}), [m, g] = a(!1), [_, v] = a(null), y = i(() => ({
|
|
294
|
-
apiGatewayUrl: o,
|
|
295
|
-
authToken: s,
|
|
296
|
-
workspaceToken: c,
|
|
297
|
-
workspaceId: l,
|
|
298
|
-
tenantId: u,
|
|
299
|
-
actorId: d?.id
|
|
300
|
-
}), [
|
|
301
|
-
o,
|
|
302
|
-
s,
|
|
303
|
-
c,
|
|
304
|
-
l,
|
|
305
|
-
u,
|
|
306
|
-
d?.id
|
|
307
|
-
]), b = n(async () => {
|
|
308
|
-
g(!0), v(null);
|
|
309
|
-
try {
|
|
310
|
-
let t = await e(y, h);
|
|
311
|
-
p({
|
|
312
|
-
totalRevenue: t.financeMetrics.revenue.totalRevenue,
|
|
313
|
-
deliveredRevenue: t.financeMetrics.revenue.deliveredRevenue,
|
|
314
|
-
averageOrderValue: t.financeMetrics.revenue.averageOrderValue,
|
|
315
|
-
fuelCost: t.financeMetrics.fuelCost,
|
|
316
|
-
openInvoices: t.financeMetrics.openInvoices
|
|
317
|
-
});
|
|
318
|
-
} catch (e) {
|
|
319
|
-
v(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load finance metrics"));
|
|
320
|
-
} finally {
|
|
321
|
-
g(!1);
|
|
322
|
-
}
|
|
323
|
-
}, [y]);
|
|
324
|
-
return r(() => {
|
|
325
|
-
b();
|
|
326
|
-
}, [b]), {
|
|
327
|
-
metrics: f,
|
|
328
|
-
isLoading: m,
|
|
329
|
-
error: _,
|
|
330
|
-
refetch: n(() => {
|
|
331
|
-
b();
|
|
332
|
-
}, [b])
|
|
333
|
-
};
|
|
334
|
-
}
|
|
335
|
-
function _() {
|
|
336
|
-
let { analytics: e, isLoading: t, error: n } = u();
|
|
337
|
-
return {
|
|
338
|
-
performanceData: i(() => ({
|
|
339
|
-
...e.performance,
|
|
340
|
-
driverRatings: []
|
|
341
|
-
}), [e.performance]),
|
|
342
|
-
isLoading: t,
|
|
343
|
-
error: n
|
|
344
|
-
};
|
|
345
|
-
}
|
|
346
|
-
//#endregion
|
|
347
|
-
export { p as a, m as i, d as n, _ as o, g as r, f as s, u as t };
|
|
File without changes
|