@burdenoff/microfe-movethewheels 2026.703.4 → 2026.703.5
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-D2gaEL1U.js} +16 -15
- package/dist/AnalyticsPage-DZMlEoBi.js +194 -0
- package/dist/{CreateOrderPage-DRAgGo9i.js → CreateOrderPage-CWHx8yys.js} +40 -40
- package/dist/{CustomerDetailsPage-BCeMmOFe.js → CustomerDetailsPage-nR4oZ_ju.js} +71 -71
- package/dist/CustomersPage-Bbvwvn8k.js +205 -0
- package/dist/DashboardPage-DrEhNf7N.js +542 -0
- package/dist/{DataTable-XvUcTjwi.js → DataTable-CqMUD4er.js} +31 -31
- package/dist/{DocumentsCard-U2lSe-cn.js → DocumentsCard-edDkgnJj.js} +25 -25
- package/dist/{DriverDetailsPage-BQrYd_Lp.js → DriverDetailsPage-whEMOWs9.js} +64 -64
- package/dist/DriversPage-CHF2ZEzd.js +221 -0
- package/dist/FinancePage-Dn9GrW-1.js +175 -0
- package/dist/{FleetPage-3ZHsB-TN.js → FleetPage-CrtGPy-p.js} +22 -22
- package/dist/{FormError-cuLV2jVD.js → FormError-BKcb_wT-.js} +1 -1
- package/dist/{ImportExportPage-C6f7DqhM.js → ImportExportPage-WYdwZomZ.js} +12 -12
- package/dist/InventoryPage-l5A1f753.js +259 -0
- package/dist/LiveTrackingPage-DhEaNKZ4.js +429 -0
- package/dist/{MarketplacePage-Bh_2ns4v.js → MarketplacePage-B9RYOb1Y.js} +116 -116
- package/dist/MetricCard-y3bWHKUQ.js +191 -0
- package/dist/{Notice-CSoDYKw9.js → Notice-DOO-tjpV.js} +2 -2
- package/dist/{OrderDetailsPage-zCj0lW0j.js → OrderDetailsPage-CwYHwk1K.js} +58 -58
- package/dist/OrdersListPage-DhZJoQeI.js +386 -0
- package/dist/{PageLayout-D4LDHJJq.js → PageLayout-BniRJaQ6.js} +1 -1
- package/dist/{ProductDetailsPage-wsxAQkA0.js → ProductDetailsPage-1Gm9JKy0.js} +55 -55
- package/dist/ProductsPage-C8sn-1tN.js +186 -0
- package/dist/ReportsPage-D1tb0dcz.js +377 -0
- package/dist/{RouteDetailsPage-DyMJE9AS.js → RouteDetailsPage-CkMyR9b_.js} +208 -181
- package/dist/{RoutesPage-Dtc669yc.js → RoutesPage-QkENzsE5.js} +12 -12
- package/dist/{SettingsPage-CpH9xhQg.js → SettingsPage-DV3_tU_X.js} +15 -15
- package/dist/Sparkline-K2RMJ58u.js +16729 -0
- package/dist/{StatusBadge-C87mDpDP.js → StatusBadge-BNHXYvZx.js} +7 -7
- package/dist/TrackingPage-BZrg4RCu.js +368 -0
- package/dist/{VehicleDetailsPage-DldYNsYV.js → VehicleDetailsPage-D-8XPZ2G.js} +53 -53
- package/dist/VehiclesPage-D5BELbtM.js +184 -0
- package/dist/{WarehouseDetailsPage-CMG7or6G.js → WarehouseDetailsPage-Cmg-8Frn.js} +64 -64
- package/dist/WarehousesPage-C1Y1M867.js +182 -0
- package/dist/{arrow-left-n48Y-Wis.js → arrow-left-ClW4Isj7.js} +1 -1
- package/dist/{arrow-right-Q3XQpTPR.js → arrow-right-CmKOmIkh.js} +1 -1
- package/dist/{arrow-up-xNF1zJUG.js → arrow-up-BJijRLAZ.js} +1 -1
- package/dist/{box-Eu05PXDh.js → box-BT3NsRQP.js} +1 -1
- package/dist/boxes-B_OGvQiW.js +54 -0
- package/dist/{chart-column-ouzgxIv_.js → chart-column-DQTTdUPk.js} +1 -1
- package/dist/charts-Tj_PPTfA.js +2018 -0
- package/dist/{chevron-left-B2_r0Elx.js → chevron-left-B1rZyWWb.js} +1 -1
- package/dist/{chevron-right-eV4LjaSi.js → chevron-right-BIcwUJZq.js} +1 -1
- package/dist/chunk-BdsCSvBP.js +20 -0
- package/dist/{circle-alert-Bzh2DBSF.js → circle-alert-CNkuDNc6.js} +1 -1
- package/dist/circle-check-Cs1OVjtV.js +13 -0
- package/dist/{circle-check-big-CGMSpQmD.js → circle-check-big-C-p4eNwn.js} +1 -1
- package/dist/{clock-Bl3ptexL.js → clock-dRGG4rkF.js} +1 -1
- package/dist/{dollar-sign-CAVU95SO.js → dollar-sign-B6RoYHHz.js} +1 -1
- package/dist/{download-C5NbvVDc.js → download-DP04iWTd.js} +1 -1
- package/dist/{file-text-D-1uvLZG.js → file-text-BuDx4hZp.js} +1 -1
- package/dist/{filter-DUfUg6BO.js → filter-BD483_8g.js} +1 -1
- package/dist/{fuel-B6_lnKDs.js → fuel-DLH1ag04.js} +1 -1
- package/dist/index.css +2 -0
- package/dist/index.js +214 -225
- package/dist/{map-C-M-FQLR.js → map-DNQn9fyY.js} +1 -1
- package/dist/{map-pin-Dznl5l40.js → map-pin-CqN1bbT1.js} +1 -1
- package/dist/mapMarkers-NCV9MRKR.js +28 -0
- package/dist/maps-yzLqiK_C.js +5070 -0
- package/dist/{navigation-BJSJl-VG.js → navigation-CgGUt2tR.js} +1 -1
- package/dist/{package-CcRttV2N.js → package-DmRF7iQD.js} +1 -1
- package/dist/{phone-DVSZHt_j.js → phone-Cl32EXKW.js} +1 -1
- package/dist/{plus-C_XZDwBz.js → plus-DlANgOFx.js} +1 -1
- package/dist/{refresh-cw-CfgN67l3.js → refresh-cw-rW59D4b7.js} +1 -1
- package/dist/route-CWjPrtAN.js +22 -0
- package/dist/{save-DJE8Fpdv.js → save-UDlog7hg.js} +1 -1
- package/dist/{search-D_VyGcZT.js → search-DNIG5Ck7.js} +1 -1
- package/dist/{square-pen-D-6JYrVQ.js → square-pen-BcfB3Grd.js} +1 -1
- package/dist/{star-BpRlUZuU.js → star-CVZHFwDx.js} +1 -1
- package/dist/{store-B-8HMuyZ.js → store-bwnmCK9f.js} +1 -1
- package/dist/{trash-2-8vmv-XV_.js → trash-2-B80G12d4.js} +1 -1
- package/dist/{trending-up-Dz6PqPRj.js → trending-up-CH4R4KOa.js} +1 -1
- package/dist/{triangle-alert-D7Y3J_4z.js → triangle-alert-CmS8AUU6.js} +1 -1
- package/dist/{truck-D-y2IDzv.js → truck-9rLDncav.js} +1 -1
- package/dist/{upload-CHZofOqb.js → upload-DanJY1Vo.js} +1 -1
- package/dist/{useAssistant-DVW4QgQb.js → useAssistant-CnEwkTLm.js} +11 -28
- package/dist/{useCustomers-BPW4__PR.js → useCustomers-ChJao1ET.js} +1 -1
- package/dist/{useFleet-ChBkxAd6.js → useFleet-g5Yri0G8.js} +1 -1
- package/dist/{useImportExport-DrPDHEDK.js → useImportExport-MYwIT3rE.js} +1 -1
- package/dist/{useInventory-CAAVMRp6.js → useInventory-BSOn-R1c.js} +1 -1
- package/dist/{useOrders-B465S2nt.js → useOrders-BSiqo61w.js} +1 -1
- package/dist/{useReports-jQ3GpNOm.js → useReports-fWESfsF9.js} +1 -1
- package/dist/{useRoutes-hS3d5-xr.js → useRoutes-zD8Yp323.js} +1 -1
- package/dist/{useSettings-BB8X2RLh.js → useSettings-B1lsWeZ1.js} +6 -6
- package/dist/{useTracking-RjGz9PZG.js → useTracking-BKG0I2ln.js} +3 -3
- package/dist/{user-DzfTn4dE.js → user-DU51el3m.js} +1 -1
- package/dist/{user-check-BEKRCi7v.js → user-check-IMhk-qkX.js} +1 -1
- package/dist/{users-CCrq-w0C.js → users-B8KhJBGg.js} +1 -1
- package/dist/{warehouse-CaqfmMKh.js → warehouse-CcMMioeY.js} +1 -1
- package/dist/{wrench-q_rgJfaP.js → wrench-Dg-sgH2e.js} +1 -1
- package/dist/{x-tMeDMcCw.js → x-C4ObLVEa.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/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,26 +1,26 @@
|
|
|
1
|
-
import { A as e, F as t, I as n, L as r, P as i, R as a,
|
|
2
|
-
import { t as y } from "./arrow-left-
|
|
3
|
-
import { t as b } from "./file-text-
|
|
4
|
-
import { n as x, t as S } from "./Notice-
|
|
5
|
-
import { n as ee, t as te } from "./phone-
|
|
6
|
-
import { t as ne } from "./map-pin-
|
|
7
|
-
import { t as C } from "./package-
|
|
8
|
-
import { t as w } from "./save-
|
|
9
|
-
import { t as T } from "./square-pen-
|
|
10
|
-
import { t as re } from "./star-
|
|
11
|
-
import { t as E } from "./users-
|
|
12
|
-
import { t as ie } from "./x-
|
|
13
|
-
import { r as ae } from "./useOrders-
|
|
14
|
-
import { r as D, t as O } from "./useCustomers-
|
|
15
|
-
import { i as k, r as oe } from "./StatusBadge-
|
|
16
|
-
import { t as A } from "./FormError-
|
|
17
|
-
import { n as se, r as j, t as ce } from "./formatters-
|
|
1
|
+
import { A as e, F as t, I as n, L as r, P as i, R as a, d as o, f as s, g as c, h as l, i as u, j as d, l as f, lt as p, n as m, r as h, st as g, u as _, ut as v } from "./PageLayout-BniRJaQ6.js";
|
|
2
|
+
import { t as y } from "./arrow-left-ClW4Isj7.js";
|
|
3
|
+
import { t as b } from "./file-text-BuDx4hZp.js";
|
|
4
|
+
import { n as x, t as S } from "./Notice-DOO-tjpV.js";
|
|
5
|
+
import { n as ee, t as te } from "./phone-Cl32EXKW.js";
|
|
6
|
+
import { t as ne } from "./map-pin-CqN1bbT1.js";
|
|
7
|
+
import { t as C } from "./package-DmRF7iQD.js";
|
|
8
|
+
import { t as w } from "./save-UDlog7hg.js";
|
|
9
|
+
import { t as T } from "./square-pen-BcfB3Grd.js";
|
|
10
|
+
import { t as re } from "./star-CVZHFwDx.js";
|
|
11
|
+
import { t as E } from "./users-B8KhJBGg.js";
|
|
12
|
+
import { t as ie } from "./x-C4ObLVEa.js";
|
|
13
|
+
import { r as ae } from "./useOrders-BSiqo61w.js";
|
|
14
|
+
import { r as D, t as O } from "./useCustomers-ChJao1ET.js";
|
|
15
|
+
import { i as k, r as oe } from "./StatusBadge-BNHXYvZx.js";
|
|
16
|
+
import { t as A } from "./FormError-BKcb_wT-.js";
|
|
17
|
+
import { n as se, r as j, t as ce } from "./formatters-FWJDwTFv.js";
|
|
18
18
|
import { useEffect as le, useState as M } from "react";
|
|
19
19
|
import { useParams as ue } from "react-router-dom";
|
|
20
20
|
import { Fragment as de, jsx as N, jsxs as P } from "react/jsx-runtime";
|
|
21
21
|
import { EmphasisPanel as F, NextSteps as I, PagePurpose as L } from "@burdenoff/fe-libs/ui";
|
|
22
22
|
//#region node_modules/lucide-react/dist/esm/icons/building.js
|
|
23
|
-
var R =
|
|
23
|
+
var R = v("Building", [
|
|
24
24
|
["rect", {
|
|
25
25
|
width: "16",
|
|
26
26
|
height: "20",
|
|
@@ -84,43 +84,43 @@ function z(e) {
|
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
function B() {
|
|
87
|
-
let { basePath:
|
|
87
|
+
let { basePath: o, navigate: s } = g(), { createCustomer: c } = D(), [l, f] = M({
|
|
88
88
|
name: "",
|
|
89
89
|
type: "b2c",
|
|
90
90
|
email: "",
|
|
91
91
|
phone: "",
|
|
92
92
|
company: ""
|
|
93
|
-
}), [m, h] = M(!1), [
|
|
94
|
-
if (e.preventDefault(), !
|
|
93
|
+
}), [m, h] = M(!1), [v, b] = M(null), x = () => s?.(p(o, "customers")), S = async (e) => {
|
|
94
|
+
if (e.preventDefault(), !l.name.trim()) {
|
|
95
95
|
b("Customer name is required.");
|
|
96
96
|
return;
|
|
97
97
|
}
|
|
98
98
|
h(!0), b(null);
|
|
99
99
|
try {
|
|
100
|
-
let e = await
|
|
101
|
-
name:
|
|
102
|
-
type:
|
|
103
|
-
email:
|
|
104
|
-
phone:
|
|
105
|
-
company:
|
|
100
|
+
let e = await c({
|
|
101
|
+
name: l.name.trim(),
|
|
102
|
+
type: l.type,
|
|
103
|
+
email: l.email.trim() || void 0,
|
|
104
|
+
phone: l.phone.trim() || void 0,
|
|
105
|
+
company: l.company.trim() || void 0
|
|
106
106
|
});
|
|
107
|
-
|
|
107
|
+
s?.(p(o, `customers/${e.id}`));
|
|
108
108
|
} catch (e) {
|
|
109
109
|
console.error("Failed to create customer:", e), b(e instanceof Error ? e.message : "Failed to create customer. Please try again."), h(!1);
|
|
110
110
|
}
|
|
111
111
|
};
|
|
112
|
-
return /* @__PURE__ */ P(
|
|
112
|
+
return /* @__PURE__ */ P(u, {
|
|
113
113
|
title: "New Customer",
|
|
114
114
|
subtitle: "Add a new customer to your account",
|
|
115
115
|
icon: /* @__PURE__ */ N(E, { size: 24 }),
|
|
116
116
|
headerActions: /* @__PURE__ */ P("div", {
|
|
117
117
|
className: "flex gap-2",
|
|
118
|
-
children: [/* @__PURE__ */ P(
|
|
118
|
+
children: [/* @__PURE__ */ P(_, {
|
|
119
119
|
variant: "outline",
|
|
120
120
|
onClick: x,
|
|
121
121
|
disabled: m,
|
|
122
122
|
children: [/* @__PURE__ */ N(y, { size: 16 }), " Cancel"]
|
|
123
|
-
}), /* @__PURE__ */ P(
|
|
123
|
+
}), /* @__PURE__ */ P(_, {
|
|
124
124
|
onClick: S,
|
|
125
125
|
disabled: m,
|
|
126
126
|
children: [
|
|
@@ -136,7 +136,7 @@ function B() {
|
|
|
136
136
|
}), /* @__PURE__ */ P("form", {
|
|
137
137
|
onSubmit: S,
|
|
138
138
|
className: "max-w-2xl space-y-6",
|
|
139
|
-
children: [/* @__PURE__ */ N(A, { message:
|
|
139
|
+
children: [/* @__PURE__ */ N(A, { message: v }), /* @__PURE__ */ P(F, { children: [/* @__PURE__ */ N("h2", {
|
|
140
140
|
className: "text-base font-semibold text-text-primary mb-4",
|
|
141
141
|
children: "Customer Details"
|
|
142
142
|
}), /* @__PURE__ */ P("div", {
|
|
@@ -146,7 +146,7 @@ function B() {
|
|
|
146
146
|
className: "grid grid-cols-1 md:grid-cols-2 gap-4",
|
|
147
147
|
children: [/* @__PURE__ */ P("div", {
|
|
148
148
|
className: "space-y-2",
|
|
149
|
-
children: [/* @__PURE__ */ P(
|
|
149
|
+
children: [/* @__PURE__ */ P(d, {
|
|
150
150
|
htmlFor: "name",
|
|
151
151
|
children: ["Name ", /* @__PURE__ */ N("span", {
|
|
152
152
|
className: "text-status-error-text",
|
|
@@ -154,8 +154,8 @@ function B() {
|
|
|
154
154
|
})]
|
|
155
155
|
}), /* @__PURE__ */ N(e, {
|
|
156
156
|
id: "name",
|
|
157
|
-
value:
|
|
158
|
-
onChange: (e) =>
|
|
157
|
+
value: l.name,
|
|
158
|
+
onChange: (e) => f((t) => ({
|
|
159
159
|
...t,
|
|
160
160
|
name: e.target.value
|
|
161
161
|
})),
|
|
@@ -164,12 +164,12 @@ function B() {
|
|
|
164
164
|
})]
|
|
165
165
|
}), /* @__PURE__ */ P("div", {
|
|
166
166
|
className: "space-y-2",
|
|
167
|
-
children: [/* @__PURE__ */ N(
|
|
167
|
+
children: [/* @__PURE__ */ N(d, {
|
|
168
168
|
htmlFor: "type",
|
|
169
169
|
children: "Customer Type"
|
|
170
170
|
}), /* @__PURE__ */ P(i, {
|
|
171
|
-
value:
|
|
172
|
-
onValueChange: (e) =>
|
|
171
|
+
value: l.type,
|
|
172
|
+
onValueChange: (e) => f((t) => ({
|
|
173
173
|
...t,
|
|
174
174
|
type: e
|
|
175
175
|
})),
|
|
@@ -190,14 +190,14 @@ function B() {
|
|
|
190
190
|
className: "grid grid-cols-1 md:grid-cols-2 gap-4",
|
|
191
191
|
children: [/* @__PURE__ */ P("div", {
|
|
192
192
|
className: "space-y-2",
|
|
193
|
-
children: [/* @__PURE__ */ N(
|
|
193
|
+
children: [/* @__PURE__ */ N(d, {
|
|
194
194
|
htmlFor: "email",
|
|
195
195
|
children: "Email"
|
|
196
196
|
}), /* @__PURE__ */ N(e, {
|
|
197
197
|
id: "email",
|
|
198
198
|
type: "email",
|
|
199
|
-
value:
|
|
200
|
-
onChange: (e) =>
|
|
199
|
+
value: l.email,
|
|
200
|
+
onChange: (e) => f((t) => ({
|
|
201
201
|
...t,
|
|
202
202
|
email: e.target.value
|
|
203
203
|
})),
|
|
@@ -205,13 +205,13 @@ function B() {
|
|
|
205
205
|
})]
|
|
206
206
|
}), /* @__PURE__ */ P("div", {
|
|
207
207
|
className: "space-y-2",
|
|
208
|
-
children: [/* @__PURE__ */ N(
|
|
208
|
+
children: [/* @__PURE__ */ N(d, {
|
|
209
209
|
htmlFor: "phone",
|
|
210
210
|
children: "Phone"
|
|
211
211
|
}), /* @__PURE__ */ N(e, {
|
|
212
212
|
id: "phone",
|
|
213
|
-
value:
|
|
214
|
-
onChange: (e) =>
|
|
213
|
+
value: l.phone,
|
|
214
|
+
onChange: (e) => f((t) => ({
|
|
215
215
|
...t,
|
|
216
216
|
phone: e.target.value
|
|
217
217
|
})),
|
|
@@ -221,13 +221,13 @@ function B() {
|
|
|
221
221
|
}),
|
|
222
222
|
/* @__PURE__ */ P("div", {
|
|
223
223
|
className: "space-y-2",
|
|
224
|
-
children: [/* @__PURE__ */ N(
|
|
224
|
+
children: [/* @__PURE__ */ N(d, {
|
|
225
225
|
htmlFor: "company",
|
|
226
226
|
children: "Company"
|
|
227
227
|
}), /* @__PURE__ */ N(e, {
|
|
228
228
|
id: "company",
|
|
229
|
-
value:
|
|
230
|
-
onChange: (e) =>
|
|
229
|
+
value: l.company,
|
|
230
|
+
onChange: (e) => f((t) => ({
|
|
231
231
|
...t,
|
|
232
232
|
company: e.target.value
|
|
233
233
|
})),
|
|
@@ -240,7 +240,7 @@ function B() {
|
|
|
240
240
|
});
|
|
241
241
|
}
|
|
242
242
|
function V() {
|
|
243
|
-
let { customerId: t } = ue(), { basePath: n, navigate: r } = g(), { customer: i, isLoading: a, error:
|
|
243
|
+
let { customerId: t } = ue(), { basePath: n, navigate: r } = g(), { customer: i, isLoading: a, error: v, refetch: V } = O(t), { updateCustomer: fe } = D(), { orders: H, isLoading: pe } = ae({ filters: { customerId: t } }), { message: U, notify: me } = x(), [W, G] = M(!1), [K, q] = M(!1), [J, Y] = M(null), [X, Z] = M({
|
|
244
244
|
name: "",
|
|
245
245
|
email: "",
|
|
246
246
|
phone: "",
|
|
@@ -254,23 +254,23 @@ function V() {
|
|
|
254
254
|
company: i.company ?? ""
|
|
255
255
|
});
|
|
256
256
|
}, [i]);
|
|
257
|
-
let he = () => r?.(
|
|
257
|
+
let he = () => r?.(p(n, "customers")), Q = (e) => r?.(p(n, e)), $ = () => {
|
|
258
258
|
Y(null), G(!0);
|
|
259
259
|
};
|
|
260
|
-
return t ? a ? /* @__PURE__ */ N(
|
|
260
|
+
return t ? a ? /* @__PURE__ */ N(h, { message: "Loading customer details..." }) : v || !i ? /* @__PURE__ */ N(m, {
|
|
261
261
|
title: "Customer not found",
|
|
262
262
|
onRetry: V
|
|
263
|
-
}) : /* @__PURE__ */ P(
|
|
263
|
+
}) : /* @__PURE__ */ P(u, {
|
|
264
264
|
title: i.name,
|
|
265
265
|
subtitle: i.company || i.email,
|
|
266
266
|
icon: /* @__PURE__ */ N(E, { size: 24 }),
|
|
267
267
|
headerActions: /* @__PURE__ */ P("div", {
|
|
268
268
|
className: "flex gap-2",
|
|
269
|
-
children: [/* @__PURE__ */ P(
|
|
269
|
+
children: [/* @__PURE__ */ P(_, {
|
|
270
270
|
variant: "outline",
|
|
271
271
|
onClick: he,
|
|
272
272
|
children: [/* @__PURE__ */ N(y, { size: 16 }), " Back"]
|
|
273
|
-
}), W ? /* @__PURE__ */ P(de, { children: [/* @__PURE__ */ P(
|
|
273
|
+
}), W ? /* @__PURE__ */ P(de, { children: [/* @__PURE__ */ P(_, {
|
|
274
274
|
variant: "outline",
|
|
275
275
|
onClick: () => {
|
|
276
276
|
Y(null), G(!1), i && Z({
|
|
@@ -282,7 +282,7 @@ function V() {
|
|
|
282
282
|
},
|
|
283
283
|
disabled: K,
|
|
284
284
|
children: [/* @__PURE__ */ N(ie, { size: 16 }), " Cancel"]
|
|
285
|
-
}), /* @__PURE__ */ P(
|
|
285
|
+
}), /* @__PURE__ */ P(_, {
|
|
286
286
|
onClick: async () => {
|
|
287
287
|
if (t) {
|
|
288
288
|
if (!X.name.trim()) {
|
|
@@ -310,7 +310,7 @@ function V() {
|
|
|
310
310
|
" ",
|
|
311
311
|
K ? "Saving…" : "Save"
|
|
312
312
|
]
|
|
313
|
-
})] }) : /* @__PURE__ */ P(
|
|
313
|
+
})] }) : /* @__PURE__ */ P(_, {
|
|
314
314
|
onClick: $,
|
|
315
315
|
children: [/* @__PURE__ */ N(T, { size: 16 }), " Edit"]
|
|
316
316
|
})]
|
|
@@ -319,7 +319,7 @@ function V() {
|
|
|
319
319
|
className: "flex items-center gap-4",
|
|
320
320
|
children: [
|
|
321
321
|
/* @__PURE__ */ N(k, { type: i.type }),
|
|
322
|
-
/* @__PURE__ */ N(
|
|
322
|
+
/* @__PURE__ */ N(f, {
|
|
323
323
|
variant: i.isActive ? "default" : "secondary",
|
|
324
324
|
children: i.isActive ? "Active" : "Inactive"
|
|
325
325
|
}),
|
|
@@ -375,7 +375,7 @@ function V() {
|
|
|
375
375
|
children: [
|
|
376
376
|
/* @__PURE__ */ P("div", {
|
|
377
377
|
className: "space-y-2",
|
|
378
|
-
children: [/* @__PURE__ */ P(
|
|
378
|
+
children: [/* @__PURE__ */ P(d, {
|
|
379
379
|
htmlFor: "edit-name",
|
|
380
380
|
children: ["Name ", /* @__PURE__ */ N("span", {
|
|
381
381
|
className: "text-status-error-text",
|
|
@@ -392,7 +392,7 @@ function V() {
|
|
|
392
392
|
}),
|
|
393
393
|
/* @__PURE__ */ P("div", {
|
|
394
394
|
className: "space-y-2",
|
|
395
|
-
children: [/* @__PURE__ */ N(
|
|
395
|
+
children: [/* @__PURE__ */ N(d, {
|
|
396
396
|
htmlFor: "edit-company",
|
|
397
397
|
children: "Company"
|
|
398
398
|
}), /* @__PURE__ */ N(e, {
|
|
@@ -407,7 +407,7 @@ function V() {
|
|
|
407
407
|
}),
|
|
408
408
|
/* @__PURE__ */ P("div", {
|
|
409
409
|
className: "space-y-2",
|
|
410
|
-
children: [/* @__PURE__ */ N(
|
|
410
|
+
children: [/* @__PURE__ */ N(d, {
|
|
411
411
|
htmlFor: "edit-email",
|
|
412
412
|
children: "Email"
|
|
413
413
|
}), /* @__PURE__ */ N(e, {
|
|
@@ -422,7 +422,7 @@ function V() {
|
|
|
422
422
|
}),
|
|
423
423
|
/* @__PURE__ */ P("div", {
|
|
424
424
|
className: "space-y-2",
|
|
425
|
-
children: [/* @__PURE__ */ N(
|
|
425
|
+
children: [/* @__PURE__ */ N(d, {
|
|
426
426
|
htmlFor: "edit-phone",
|
|
427
427
|
children: "Phone"
|
|
428
428
|
}), /* @__PURE__ */ N(e, {
|
|
@@ -494,26 +494,26 @@ function V() {
|
|
|
494
494
|
})()]
|
|
495
495
|
})]
|
|
496
496
|
})] }),
|
|
497
|
-
/* @__PURE__ */ P(
|
|
497
|
+
/* @__PURE__ */ P(o, { children: [/* @__PURE__ */ N(l, { children: /* @__PURE__ */ P(c, {
|
|
498
498
|
className: "flex items-center gap-2",
|
|
499
499
|
children: [/* @__PURE__ */ N(ne, { size: 18 }), " Address"]
|
|
500
|
-
}) }), /* @__PURE__ */ N(
|
|
501
|
-
i.notes && /* @__PURE__ */ P(
|
|
500
|
+
}) }), /* @__PURE__ */ N(s, { children: /* @__PURE__ */ N("p", { children: ce(i.address) }) })] }),
|
|
501
|
+
i.notes && /* @__PURE__ */ P(o, { children: [/* @__PURE__ */ N(l, { children: /* @__PURE__ */ P(c, {
|
|
502
502
|
className: "flex items-center gap-2",
|
|
503
503
|
children: [/* @__PURE__ */ N(b, { size: 18 }), " Notes"]
|
|
504
|
-
}) }), /* @__PURE__ */ N(
|
|
505
|
-
/* @__PURE__ */ P(
|
|
504
|
+
}) }), /* @__PURE__ */ N(s, { children: /* @__PURE__ */ N("p", { children: i.notes }) })] }),
|
|
505
|
+
/* @__PURE__ */ P(o, { children: [/* @__PURE__ */ P(l, {
|
|
506
506
|
className: "flex flex-row items-center justify-between",
|
|
507
|
-
children: [/* @__PURE__ */ P(
|
|
507
|
+
children: [/* @__PURE__ */ P(c, {
|
|
508
508
|
className: "flex items-center gap-2",
|
|
509
509
|
children: [/* @__PURE__ */ N(C, { size: 18 }), " Orders"]
|
|
510
|
-
}), /* @__PURE__ */ P(
|
|
510
|
+
}), /* @__PURE__ */ P(_, {
|
|
511
511
|
variant: "outline",
|
|
512
512
|
size: "sm",
|
|
513
513
|
onClick: () => Q("orders/new"),
|
|
514
514
|
children: [/* @__PURE__ */ N(b, { size: 14 }), " New order"]
|
|
515
515
|
})]
|
|
516
|
-
}), /* @__PURE__ */ N(
|
|
516
|
+
}), /* @__PURE__ */ N(s, { children: pe ? /* @__PURE__ */ N("p", {
|
|
517
517
|
className: "text-text-secondary text-center py-4",
|
|
518
518
|
children: "Loading orders…"
|
|
519
519
|
}) : H.length > 0 ? /* @__PURE__ */ N("div", {
|
|
@@ -564,7 +564,7 @@ function V() {
|
|
|
564
564
|
]
|
|
565
565
|
}), /* @__PURE__ */ P("div", {
|
|
566
566
|
className: "space-y-6",
|
|
567
|
-
children: [/* @__PURE__ */ P(
|
|
567
|
+
children: [/* @__PURE__ */ P(o, { children: [/* @__PURE__ */ N(l, { children: /* @__PURE__ */ N(c, { children: "Business Details" }) }), /* @__PURE__ */ P(s, {
|
|
568
568
|
className: "space-y-3",
|
|
569
569
|
children: [
|
|
570
570
|
i.businessLicense && /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("p", {
|
|
@@ -591,12 +591,12 @@ function V() {
|
|
|
591
591
|
/* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("p", {
|
|
592
592
|
className: "text-sm text-text-secondary",
|
|
593
593
|
children: "Marketing Opt-in"
|
|
594
|
-
}), /* @__PURE__ */ N(
|
|
594
|
+
}), /* @__PURE__ */ N(f, {
|
|
595
595
|
variant: i.marketingOptIn ? "default" : "secondary",
|
|
596
596
|
children: i.marketingOptIn ? "Yes" : "No"
|
|
597
597
|
})] })
|
|
598
598
|
]
|
|
599
|
-
})] }), /* @__PURE__ */ P(
|
|
599
|
+
})] }), /* @__PURE__ */ P(o, { children: [/* @__PURE__ */ N(l, { children: /* @__PURE__ */ N(c, { children: "Account Info" }) }), /* @__PURE__ */ P(s, {
|
|
600
600
|
className: "space-y-3",
|
|
601
601
|
children: [/* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("p", {
|
|
602
602
|
className: "text-sm text-text-secondary",
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import { i as e, l as t, lt as n, o as r, s as i, st as a, u as o, ut as s } from "./PageLayout-BniRJaQ6.js";
|
|
2
|
+
import { t as c } from "./DataTable-CqMUD4er.js";
|
|
3
|
+
import { t as l } from "./download-DP04iWTd.js";
|
|
4
|
+
import { t as u } from "./plus-DlANgOFx.js";
|
|
5
|
+
import { t as d } from "./refresh-cw-rW59D4b7.js";
|
|
6
|
+
import { t as f } from "./star-CVZHFwDx.js";
|
|
7
|
+
import { t as p } from "./user-check-IMhk-qkX.js";
|
|
8
|
+
import { t as m } from "./users-B8KhJBGg.js";
|
|
9
|
+
import { n as h, r as g } from "./useCustomers-ChJao1ET.js";
|
|
10
|
+
import { r as _, t as v } from "./MetricCard-y3bWHKUQ.js";
|
|
11
|
+
import { i as y } from "./StatusBadge-BNHXYvZx.js";
|
|
12
|
+
import { r as b } from "./formatters-FWJDwTFv.js";
|
|
13
|
+
import { useState as x } from "react";
|
|
14
|
+
import { jsx as S, jsxs as C } from "react/jsx-runtime";
|
|
15
|
+
import { CTAOverflowMenu as w, PagePurpose as T } from "@burdenoff/fe-libs/ui";
|
|
16
|
+
//#region node_modules/lucide-react/dist/esm/icons/building-2.js
|
|
17
|
+
var E = s("Building2", [
|
|
18
|
+
["path", {
|
|
19
|
+
d: "M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",
|
|
20
|
+
key: "1b4qmf"
|
|
21
|
+
}],
|
|
22
|
+
["path", {
|
|
23
|
+
d: "M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",
|
|
24
|
+
key: "i71pzd"
|
|
25
|
+
}],
|
|
26
|
+
["path", {
|
|
27
|
+
d: "M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",
|
|
28
|
+
key: "10jefs"
|
|
29
|
+
}],
|
|
30
|
+
["path", {
|
|
31
|
+
d: "M10 6h4",
|
|
32
|
+
key: "1itunk"
|
|
33
|
+
}],
|
|
34
|
+
["path", {
|
|
35
|
+
d: "M10 10h4",
|
|
36
|
+
key: "tcdvrf"
|
|
37
|
+
}],
|
|
38
|
+
["path", {
|
|
39
|
+
d: "M10 14h4",
|
|
40
|
+
key: "kelpxr"
|
|
41
|
+
}],
|
|
42
|
+
["path", {
|
|
43
|
+
d: "M10 18h4",
|
|
44
|
+
key: "1ulq68"
|
|
45
|
+
}]
|
|
46
|
+
]);
|
|
47
|
+
//#endregion
|
|
48
|
+
//#region src/movethewheels/pages/CustomersPage.tsx
|
|
49
|
+
function D() {
|
|
50
|
+
let { basePath: s, navigate: D } = a(), [O, k] = x(0), [A, j] = x(25), { customers: M, hasMore: N, isLoading: P, refetch: F } = g({
|
|
51
|
+
limit: A,
|
|
52
|
+
offset: O * A
|
|
53
|
+
}), { stats: I } = h(), L = (e) => D?.(n(s, e));
|
|
54
|
+
return /* @__PURE__ */ C(e, {
|
|
55
|
+
title: "Customers",
|
|
56
|
+
subtitle: `${I.total} customers`,
|
|
57
|
+
icon: /* @__PURE__ */ S(m, { size: 24 }),
|
|
58
|
+
headerActions: /* @__PURE__ */ S(w, {
|
|
59
|
+
primary: {
|
|
60
|
+
label: "Add Customer",
|
|
61
|
+
icon: /* @__PURE__ */ S(u, { size: 16 }),
|
|
62
|
+
onSelect: () => L("customers/new")
|
|
63
|
+
},
|
|
64
|
+
actions: [{
|
|
65
|
+
label: "Refresh",
|
|
66
|
+
icon: /* @__PURE__ */ S(d, { size: 16 }),
|
|
67
|
+
onSelect: () => F()
|
|
68
|
+
}, {
|
|
69
|
+
label: "Export",
|
|
70
|
+
icon: /* @__PURE__ */ S(l, { size: 16 }),
|
|
71
|
+
onSelect: () => L("import-export")
|
|
72
|
+
}]
|
|
73
|
+
}),
|
|
74
|
+
children: [
|
|
75
|
+
/* @__PURE__ */ S(T, {
|
|
76
|
+
icon: /* @__PURE__ */ S(m, { size: 18 }),
|
|
77
|
+
children: "The businesses and individuals you deliver for. Keep contact details, locations and satisfaction ratings here, and open a customer to see their order history before booking the next shipment."
|
|
78
|
+
}),
|
|
79
|
+
/* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("p", {
|
|
80
|
+
className: "mb-3 text-sm font-medium text-text-secondary",
|
|
81
|
+
children: "Customer base at a glance"
|
|
82
|
+
}), /* @__PURE__ */ C(_, {
|
|
83
|
+
columns: 3,
|
|
84
|
+
children: [
|
|
85
|
+
/* @__PURE__ */ S(v, {
|
|
86
|
+
label: "Total customers",
|
|
87
|
+
value: I.total,
|
|
88
|
+
icon: /* @__PURE__ */ S(m, { size: 20 }),
|
|
89
|
+
accent: "brand"
|
|
90
|
+
}),
|
|
91
|
+
/* @__PURE__ */ S(v, {
|
|
92
|
+
label: "Active",
|
|
93
|
+
value: I.active,
|
|
94
|
+
icon: /* @__PURE__ */ S(p, { size: 20 }),
|
|
95
|
+
accent: "success",
|
|
96
|
+
subtitle: "Currently transacting"
|
|
97
|
+
}),
|
|
98
|
+
/* @__PURE__ */ S(v, {
|
|
99
|
+
label: "Business accounts",
|
|
100
|
+
value: I.b2b,
|
|
101
|
+
icon: /* @__PURE__ */ S(E, { size: 20 }),
|
|
102
|
+
accent: "blue",
|
|
103
|
+
subtitle: "B2B relationships"
|
|
104
|
+
})
|
|
105
|
+
]
|
|
106
|
+
})] }),
|
|
107
|
+
/* @__PURE__ */ S(c, {
|
|
108
|
+
columns: [
|
|
109
|
+
{
|
|
110
|
+
id: "customer",
|
|
111
|
+
header: "Customer",
|
|
112
|
+
cell: (e) => /* @__PURE__ */ C("div", {
|
|
113
|
+
className: "flex items-center gap-3",
|
|
114
|
+
children: [/* @__PURE__ */ S(r, { children: /* @__PURE__ */ S(i, { children: e.name.split(" ").map((e) => e[0]).join("") }) }), /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("p", {
|
|
115
|
+
className: "font-medium",
|
|
116
|
+
children: e.name
|
|
117
|
+
}), /* @__PURE__ */ S("p", {
|
|
118
|
+
className: "text-sm text-text-secondary",
|
|
119
|
+
children: e.email
|
|
120
|
+
})] })]
|
|
121
|
+
})
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
id: "type",
|
|
125
|
+
header: "Type",
|
|
126
|
+
accessorKey: "type",
|
|
127
|
+
cell: (e) => /* @__PURE__ */ S(y, { type: e.type })
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
id: "company",
|
|
131
|
+
header: "Company",
|
|
132
|
+
accessorKey: "company",
|
|
133
|
+
cell: (e) => e.company || "-"
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
id: "phone",
|
|
137
|
+
header: "Phone",
|
|
138
|
+
accessorKey: "phone"
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
id: "location",
|
|
142
|
+
header: "Location",
|
|
143
|
+
cell: (e) => `${e.address.city}, ${e.address.state}`
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
id: "rating",
|
|
147
|
+
header: "Rating",
|
|
148
|
+
cell: (e) => /* @__PURE__ */ C("div", {
|
|
149
|
+
className: "flex items-center gap-1",
|
|
150
|
+
children: [/* @__PURE__ */ S(f, {
|
|
151
|
+
size: 14,
|
|
152
|
+
className: "text-status-warning-text fill-current"
|
|
153
|
+
}), /* @__PURE__ */ S("span", { children: e.rating.toFixed(1) })]
|
|
154
|
+
})
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
id: "status",
|
|
158
|
+
header: "Status",
|
|
159
|
+
cell: (e) => /* @__PURE__ */ S(t, {
|
|
160
|
+
variant: e.isActive ? "default" : "secondary",
|
|
161
|
+
children: e.isActive ? "Active" : "Inactive"
|
|
162
|
+
})
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
id: "created",
|
|
166
|
+
header: "Created",
|
|
167
|
+
accessorKey: "createdAt",
|
|
168
|
+
sortable: !0,
|
|
169
|
+
cell: (e) => b(e.createdAt, "short")
|
|
170
|
+
}
|
|
171
|
+
],
|
|
172
|
+
data: M,
|
|
173
|
+
isLoading: P,
|
|
174
|
+
searchable: !0,
|
|
175
|
+
searchPlaceholder: "Search customers...",
|
|
176
|
+
searchFields: [
|
|
177
|
+
"name",
|
|
178
|
+
"email",
|
|
179
|
+
"company"
|
|
180
|
+
],
|
|
181
|
+
onRowClick: (e) => L(`customers/${e.id}`),
|
|
182
|
+
getRowId: (e) => e.id,
|
|
183
|
+
pageIndex: O,
|
|
184
|
+
pageSize: A,
|
|
185
|
+
onPageChange: k,
|
|
186
|
+
onPageSizeChange: (e) => {
|
|
187
|
+
j(e), k(0);
|
|
188
|
+
},
|
|
189
|
+
hasNextPage: N,
|
|
190
|
+
emptyIllustration: "empty-people",
|
|
191
|
+
emptyTitle: "No customers yet",
|
|
192
|
+
emptyDescription: "Add your first customer to start booking deliveries for them.",
|
|
193
|
+
emptyAction: /* @__PURE__ */ C(o, {
|
|
194
|
+
onClick: () => L("customers/new"),
|
|
195
|
+
children: [/* @__PURE__ */ S(u, {
|
|
196
|
+
size: 16,
|
|
197
|
+
className: "mr-1.5"
|
|
198
|
+
}), "Add Customer"]
|
|
199
|
+
})
|
|
200
|
+
})
|
|
201
|
+
]
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
//#endregion
|
|
205
|
+
export { D as default };
|