@burdenoff/microfe-movethewheels 2026.624.1 → 2026.626.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.
Files changed (119) hide show
  1. package/dist/{AIAssistantPage-BrHX2lQn.js → AIAssistantPage-AvsMbunM.js} +39 -33
  2. package/dist/{AnalyticsPage-DI6Wcaw5.js → AnalyticsPage-CCLfHgQZ.js} +44 -33
  3. package/dist/CreateOrderPage-CjlnEtk3.js +510 -0
  4. package/dist/CustomerDetailsPage-I6cdDHUi.js +265 -0
  5. package/dist/CustomersPage-CGGfD4ki.js +163 -0
  6. package/dist/{DashboardPage-3ZOnwg1a.js → DashboardPage-D2HRqwg9.js} +122 -111
  7. package/dist/DataTable-CD9ZhpLB.js +249 -0
  8. package/dist/DriverDetailsPage-rg_pGNuP.js +330 -0
  9. package/dist/DriversPage-DKiynISH.js +167 -0
  10. package/dist/FinancePage-Vg8WPs38.js +158 -0
  11. package/dist/{FleetPage-CPS7r4J3.js → FleetPage-DddXt8r8.js} +124 -85
  12. package/dist/ImportExportPage-BW6qO3kc.js +248 -0
  13. package/dist/InventoryPage-rMGuaJN-.js +222 -0
  14. package/dist/LiveTrackingPage-DQ1q4Id3.js +375 -0
  15. package/dist/MarketplacePage-DKrXAv62.js +219 -0
  16. package/dist/MetricCard-B7yMyvMX.js +146 -0
  17. package/dist/OrderDetailsPage-CFASgsYX.js +431 -0
  18. package/dist/OrdersListPage-BHeT8S5o.js +309 -0
  19. package/dist/{PageLayout-xDTiBTDS.js → PageLayout-D3N8MCTm.js} +213 -195
  20. package/dist/ProductDetailsPage-CFGcbaHo.js +195 -0
  21. package/dist/ProductsPage--xEpbQ8A.js +171 -0
  22. package/dist/{ReportsPage-B8OyWGzl.js → ReportsPage-Bb7_90rK.js} +57 -49
  23. package/dist/RouteDetailsPage-CVtDVb1N.js +282 -0
  24. package/dist/RoutesPage-s57PtgcQ.js +163 -0
  25. package/dist/SettingsPage-BYNCBOpN.js +298 -0
  26. package/dist/{StatusBadge-C--7NhoW.js → StatusBadge-CijYQXtb.js} +5 -2
  27. package/dist/{TrackingPage-BldUm_g7.js → TrackingPage-CcRc_dva.js} +88 -83
  28. package/dist/VehicleDetailsPage-3YDMPsPs.js +220 -0
  29. package/dist/VehiclesPage-UlxPWP9K.js +167 -0
  30. package/dist/WarehouseDetailsPage-Db7KeN-d.js +238 -0
  31. package/dist/WarehousesPage-CuTO-OPp.js +164 -0
  32. package/dist/{arrow-left-Bk5GsGNk.js → arrow-left-CBpZKkpq.js} +1 -1
  33. package/dist/{box-BAMv2-7M.js → box-CAaiElsb.js} +1 -1
  34. package/dist/{chart-column-CAfkf4o6.js → chart-column-D1Ym15-S.js} +1 -1
  35. package/dist/{chevron-right-Czrt_Qew.js → chevron-right-BIFGi0UA.js} +1 -1
  36. package/dist/{circle-alert-CEuV9Pij.js → circle-alert-DjmNo5_L.js} +1 -1
  37. package/dist/{circle-check-big-Cx8aO6B-.js → circle-check-big-CjuPVo3_.js} +1 -1
  38. package/dist/{clock-Be95bq7_.js → clock-BjkdnddD.js} +1 -1
  39. package/dist/{dollar-sign-kJqItPli.js → dollar-sign-IB4O0wuQ.js} +1 -1
  40. package/dist/{download-caab0D3V.js → download-Dpa9vqoG.js} +1 -1
  41. package/dist/{file-text-b1qhrJn1.js → file-text-C8Uioy11.js} +1 -1
  42. package/dist/{filter-BWmLTZB-.js → filter-Da5OZaHI.js} +1 -1
  43. package/dist/index.js +16 -16
  44. package/dist/{map-CS2aFgyO.js → map-_Per4sT9.js} +1 -1
  45. package/dist/{map-pin-96FeqL7H.js → map-pin-BSaf5IDL.js} +1 -1
  46. package/dist/{navigation-i6UXEjTC.js → navigation-DaTbrhw2.js} +1 -1
  47. package/dist/{package-KhSi3xaT.js → package-BE7U0wQE.js} +1 -1
  48. package/dist/{phone-B-h3tbsr.js → phone-DV4StZiA.js} +1 -1
  49. package/dist/{plus-D2BYAzMn.js → plus-Dl1rLeJR.js} +1 -1
  50. package/dist/{refresh-cw-D5Sy01s-.js → refresh-cw-CWfERAit.js} +1 -1
  51. package/dist/{route-CBDXuwH9.js → route-Dp9JiN_E.js} +1 -1
  52. package/dist/{save-CMc7h-Vi.js → save-XH8vydOn.js} +1 -1
  53. package/dist/{search-DVrUQbOg.js → search-OxoIiL_C.js} +1 -1
  54. package/dist/{settings-BwzIRYv3.js → settings-3Rw5NwFF.js} +1 -1
  55. package/dist/{square-pen-DmW36Bau.js → square-pen-hLIbFQFV.js} +1 -1
  56. package/dist/{star-Cv2MzxZL.js → star-YsVV3MNQ.js} +1 -1
  57. package/dist/{store-CLH957vl.js → store-RCBl7HB-.js} +1 -1
  58. package/dist/{trending-up-l8M0BO_w.js → trending-up-C-85AwGT.js} +1 -1
  59. package/dist/{triangle-alert-BI45s6bH.js → triangle-alert-BOhfGgmh.js} +1 -1
  60. package/dist/{truck-DX3lNQkz.js → truck-CtDjNFbi.js} +1 -1
  61. package/dist/{user-D8EY1uvt.js → user-Dz5TJZFs.js} +1 -1
  62. package/dist/{users-CfG0J8wP.js → users-g2N0eL-Z.js} +1 -1
  63. package/dist/{warehouse-Dt_bAr82.js → warehouse-D3WWDeTX.js} +1 -1
  64. package/dist/{wrench-C50eI_Iy.js → wrench-CmxY1n4I.js} +1 -1
  65. package/package.json +2 -2
  66. package/src/movethewheels/components/DataTable.tsx +41 -6
  67. package/src/movethewheels/components/MetricCard.tsx +51 -20
  68. package/src/movethewheels/components/PageLayout.tsx +60 -5
  69. package/src/movethewheels/components/StatusBadge.tsx +2 -1
  70. package/src/movethewheels/pages/AIAssistantPage.tsx +11 -3
  71. package/src/movethewheels/pages/AnalyticsPage.tsx +31 -25
  72. package/src/movethewheels/pages/CreateOrderPage.tsx +56 -17
  73. package/src/movethewheels/pages/CustomerDetailsPage.tsx +63 -38
  74. package/src/movethewheels/pages/CustomersPage.tsx +51 -12
  75. package/src/movethewheels/pages/DashboardPage.tsx +62 -48
  76. package/src/movethewheels/pages/DriverDetailsPage.tsx +57 -26
  77. package/src/movethewheels/pages/DriversPage.tsx +45 -12
  78. package/src/movethewheels/pages/FinancePage.tsx +45 -41
  79. package/src/movethewheels/pages/FleetPage.tsx +82 -34
  80. package/src/movethewheels/pages/ImportExportPage.tsx +46 -29
  81. package/src/movethewheels/pages/InventoryPage.tsx +37 -33
  82. package/src/movethewheels/pages/LiveTrackingPage.tsx +58 -20
  83. package/src/movethewheels/pages/MarketplacePage.tsx +37 -3
  84. package/src/movethewheels/pages/OrderDetailsPage.tsx +74 -46
  85. package/src/movethewheels/pages/OrdersListPage.tsx +81 -14
  86. package/src/movethewheels/pages/ProductDetailsPage.tsx +36 -11
  87. package/src/movethewheels/pages/ProductsPage.tsx +41 -12
  88. package/src/movethewheels/pages/ReportsPage.tsx +23 -19
  89. package/src/movethewheels/pages/RouteDetailsPage.tsx +71 -31
  90. package/src/movethewheels/pages/RoutesPage.tsx +48 -9
  91. package/src/movethewheels/pages/SettingsPage.tsx +68 -26
  92. package/src/movethewheels/pages/TrackingPage.tsx +52 -49
  93. package/src/movethewheels/pages/VehicleDetailsPage.tsx +49 -24
  94. package/src/movethewheels/pages/VehiclesPage.tsx +41 -15
  95. package/src/movethewheels/pages/WarehouseDetailsPage.tsx +55 -30
  96. package/src/movethewheels/pages/WarehousesPage.tsx +46 -9
  97. package/dist/CreateOrderPage-DfkSi6JF.js +0 -471
  98. package/dist/CustomerDetailsPage-DzAIu_tH.js +0 -239
  99. package/dist/CustomersPage-d21ixOYa.js +0 -119
  100. package/dist/DataTable-CZGz3SJu.js +0 -239
  101. package/dist/DriverDetailsPage-YuZSlPSV.js +0 -297
  102. package/dist/DriversPage-BOhqEBTv.js +0 -127
  103. package/dist/FinancePage-CnjUNXOb.js +0 -154
  104. package/dist/ImportExportPage-zNjs7xsV.js +0 -232
  105. package/dist/InventoryPage-C9g5d3SW.js +0 -223
  106. package/dist/LiveTrackingPage-DoBvtdBG.js +0 -332
  107. package/dist/MarketplacePage-BEj5hcBF.js +0 -192
  108. package/dist/MetricCard-DeHVeVwl.js +0 -135
  109. package/dist/OrderDetailsPage-D-9lDZYU.js +0 -398
  110. package/dist/OrdersListPage-CJzHbgY3.js +0 -257
  111. package/dist/ProductDetailsPage-3rKtzXpy.js +0 -168
  112. package/dist/ProductsPage-B0P_wjBJ.js +0 -131
  113. package/dist/RouteDetailsPage-DGjKTUMj.js +0 -240
  114. package/dist/RoutesPage-CpopY8xN.js +0 -116
  115. package/dist/SettingsPage-BvXSa3gi.js +0 -247
  116. package/dist/VehicleDetailsPage-Dqv--MVW.js +0 -194
  117. package/dist/VehiclesPage-CCBHRDHu.js +0 -127
  118. package/dist/WarehouseDetailsPage-ZObC_c7W.js +0 -215
  119. package/dist/WarehousesPage-CpgZEVW9.js +0 -121
@@ -0,0 +1,265 @@
1
+ import { d as e, f as t, g as n, h as r, i, it as a, l as o, n as s, r as c, u as l } from "./PageLayout-D3N8MCTm.js";
2
+ import { t as u } from "./arrow-left-CBpZKkpq.js";
3
+ import { t as d } from "./file-text-C8Uioy11.js";
4
+ import { n as f, t as p } from "./phone-DV4StZiA.js";
5
+ import { t as m } from "./map-pin-BSaf5IDL.js";
6
+ import { t as h } from "./square-pen-hLIbFQFV.js";
7
+ import { t as g } from "./star-YsVV3MNQ.js";
8
+ import { t as _ } from "./users-g2N0eL-Z.js";
9
+ import { r as v } from "./graphqlClient-CdJyR_ed.js";
10
+ import { t as y } from "./useCustomers-bS3a4ytk.js";
11
+ import { i as b } from "./StatusBadge-CijYQXtb.js";
12
+ import { r as x, t as S } from "./formatters-_vJlC-47.js";
13
+ import { t as C } from "./navigation-BgnOfsVd.js";
14
+ import { useParams as w } from "react-router-dom";
15
+ import { jsx as T, jsxs as E } from "react/jsx-runtime";
16
+ import { EmphasisPanel as D, NextSteps as O, PagePurpose as k } from "@burdenoff/fe-libs/ui";
17
+ //#region node_modules/lucide-react/dist/esm/icons/building.js
18
+ var A = a("Building", [
19
+ ["rect", {
20
+ width: "16",
21
+ height: "20",
22
+ x: "4",
23
+ y: "2",
24
+ rx: "2",
25
+ ry: "2",
26
+ key: "76otgf"
27
+ }],
28
+ ["path", {
29
+ d: "M9 22v-4h6v4",
30
+ key: "r93iot"
31
+ }],
32
+ ["path", {
33
+ d: "M8 6h.01",
34
+ key: "1dz90k"
35
+ }],
36
+ ["path", {
37
+ d: "M16 6h.01",
38
+ key: "1x0f13"
39
+ }],
40
+ ["path", {
41
+ d: "M12 6h.01",
42
+ key: "1vi96p"
43
+ }],
44
+ ["path", {
45
+ d: "M12 10h.01",
46
+ key: "1nrarc"
47
+ }],
48
+ ["path", {
49
+ d: "M12 14h.01",
50
+ key: "1etili"
51
+ }],
52
+ ["path", {
53
+ d: "M16 10h.01",
54
+ key: "1m94wz"
55
+ }],
56
+ ["path", {
57
+ d: "M16 14h.01",
58
+ key: "1gbofw"
59
+ }],
60
+ ["path", {
61
+ d: "M8 10h.01",
62
+ key: "19clt8"
63
+ }],
64
+ ["path", {
65
+ d: "M8 14h.01",
66
+ key: "6423bh"
67
+ }]
68
+ ]);
69
+ //#endregion
70
+ //#region src/movethewheels/pages/CustomerDetailsPage.tsx
71
+ function j() {
72
+ let { customerId: a } = w(), { basePath: j, navigate: M } = v(), { customer: N, isLoading: P, error: F, refetch: I } = y(a), L = () => M?.(C(j, "customers")), R = (e) => M?.(C(j, e));
73
+ return a ? P ? /* @__PURE__ */ T(c, { message: "Loading customer details..." }) : F || !N ? /* @__PURE__ */ T(s, {
74
+ title: "Customer not found",
75
+ onRetry: I
76
+ }) : /* @__PURE__ */ E(i, {
77
+ title: N.name,
78
+ subtitle: N.company || N.email,
79
+ icon: /* @__PURE__ */ T(_, { size: 24 }),
80
+ headerActions: /* @__PURE__ */ E("div", {
81
+ className: "flex gap-2",
82
+ children: [/* @__PURE__ */ E(l, {
83
+ variant: "outline",
84
+ onClick: L,
85
+ children: [/* @__PURE__ */ T(u, { size: 16 }), " Back"]
86
+ }), /* @__PURE__ */ E(l, { children: [/* @__PURE__ */ T(h, { size: 16 }), " Edit"] })]
87
+ }),
88
+ headerContent: /* @__PURE__ */ E("div", {
89
+ className: "flex items-center gap-4",
90
+ children: [
91
+ /* @__PURE__ */ T(b, { type: N.type }),
92
+ /* @__PURE__ */ T(o, {
93
+ variant: N.isActive ? "default" : "secondary",
94
+ children: N.isActive ? "Active" : "Inactive"
95
+ }),
96
+ /* @__PURE__ */ E("div", {
97
+ className: "flex items-center gap-1",
98
+ children: [/* @__PURE__ */ T(g, {
99
+ size: 16,
100
+ className: "text-yellow-500 fill-yellow-500"
101
+ }), /* @__PURE__ */ T("span", {
102
+ className: "font-medium",
103
+ children: N.rating.toFixed(1)
104
+ })]
105
+ })
106
+ ]
107
+ }),
108
+ children: [
109
+ /* @__PURE__ */ T(k, {
110
+ icon: /* @__PURE__ */ T(_, { size: 18 }),
111
+ children: "Everything you know about this customer — how to reach them, where they are, and their account standing. Use it to confirm contact details before a delivery, check their rating, or book their next order."
112
+ }),
113
+ /* @__PURE__ */ T(O, {
114
+ storageKey: "movethewheels-customer-details",
115
+ steps: [{
116
+ id: "new-order",
117
+ label: "Book a delivery for this customer",
118
+ description: "Start a new order pre-filled for this account.",
119
+ icon: /* @__PURE__ */ T(d, { size: 16 }),
120
+ onClick: () => R("orders/new")
121
+ }, {
122
+ id: "edit",
123
+ label: "Update contact details",
124
+ description: "Keep email, phone and address current.",
125
+ icon: /* @__PURE__ */ T(h, { size: 16 }),
126
+ onClick: () => {}
127
+ }]
128
+ }),
129
+ /* @__PURE__ */ E("div", {
130
+ className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
131
+ children: [/* @__PURE__ */ E("div", {
132
+ className: "lg:col-span-2 space-y-6",
133
+ children: [
134
+ /* @__PURE__ */ E(D, { children: [/* @__PURE__ */ T("h2", {
135
+ className: "text-base font-semibold text-text-primary mb-4",
136
+ children: "Contact Information"
137
+ }), /* @__PURE__ */ E("div", {
138
+ className: "grid grid-cols-1 md:grid-cols-2 gap-6",
139
+ children: [/* @__PURE__ */ E("div", {
140
+ className: "space-y-4",
141
+ children: [/* @__PURE__ */ E("div", {
142
+ className: "flex items-center gap-3",
143
+ children: [/* @__PURE__ */ T(f, {
144
+ size: 18,
145
+ className: "text-text-secondary"
146
+ }), /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("p", {
147
+ className: "text-sm text-text-secondary",
148
+ children: "Email"
149
+ }), /* @__PURE__ */ T("p", {
150
+ className: "font-medium",
151
+ children: N.email
152
+ })] })]
153
+ }), /* @__PURE__ */ E("div", {
154
+ className: "flex items-center gap-3",
155
+ children: [/* @__PURE__ */ T(p, {
156
+ size: 18,
157
+ className: "text-text-secondary"
158
+ }), /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("p", {
159
+ className: "text-sm text-text-secondary",
160
+ children: "Phone"
161
+ }), /* @__PURE__ */ T("p", {
162
+ className: "font-medium",
163
+ children: N.phone
164
+ })] })]
165
+ })]
166
+ }), /* @__PURE__ */ E("div", {
167
+ className: "space-y-4",
168
+ children: [N.company && /* @__PURE__ */ E("div", {
169
+ className: "flex items-center gap-3",
170
+ children: [/* @__PURE__ */ T(A, {
171
+ size: 18,
172
+ className: "text-text-secondary"
173
+ }), /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("p", {
174
+ className: "text-sm text-text-secondary",
175
+ children: "Company"
176
+ }), /* @__PURE__ */ T("p", {
177
+ className: "font-medium",
178
+ children: N.company
179
+ })] })]
180
+ }), N.website && /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("p", {
181
+ className: "text-sm text-text-secondary",
182
+ children: "Website"
183
+ }), /* @__PURE__ */ T("a", {
184
+ href: N.website,
185
+ className: "text-primary hover:underline",
186
+ children: N.website
187
+ })] })]
188
+ })]
189
+ })] }),
190
+ /* @__PURE__ */ E(e, { children: [/* @__PURE__ */ T(r, { children: /* @__PURE__ */ E(n, {
191
+ className: "flex items-center gap-2",
192
+ children: [/* @__PURE__ */ T(m, { size: 18 }), " Address"]
193
+ }) }), /* @__PURE__ */ T(t, { children: /* @__PURE__ */ T("p", { children: S(N.address) }) })] }),
194
+ N.notes && /* @__PURE__ */ E(e, { children: [/* @__PURE__ */ T(r, { children: /* @__PURE__ */ E(n, {
195
+ className: "flex items-center gap-2",
196
+ children: [/* @__PURE__ */ T(d, { size: 18 }), " Notes"]
197
+ }) }), /* @__PURE__ */ T(t, { children: /* @__PURE__ */ T("p", { children: N.notes }) })] })
198
+ ]
199
+ }), /* @__PURE__ */ E("div", {
200
+ className: "space-y-6",
201
+ children: [/* @__PURE__ */ E(e, { children: [/* @__PURE__ */ T(r, { children: /* @__PURE__ */ T(n, { children: "Business Details" }) }), /* @__PURE__ */ E(t, {
202
+ className: "space-y-3",
203
+ children: [
204
+ N.businessLicense && /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("p", {
205
+ className: "text-sm text-text-secondary",
206
+ children: "Business License"
207
+ }), /* @__PURE__ */ T("p", {
208
+ className: "font-mono",
209
+ children: N.businessLicense
210
+ })] }),
211
+ N.taxId && /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("p", {
212
+ className: "text-sm text-text-secondary",
213
+ children: "Tax ID"
214
+ }), /* @__PURE__ */ T("p", {
215
+ className: "font-mono",
216
+ children: N.taxId
217
+ })] }),
218
+ /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("p", {
219
+ className: "text-sm text-text-secondary",
220
+ children: "Preferred Contact"
221
+ }), /* @__PURE__ */ T("p", {
222
+ className: "capitalize",
223
+ children: N.preferredContactMethod
224
+ })] }),
225
+ /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("p", {
226
+ className: "text-sm text-text-secondary",
227
+ children: "Marketing Opt-in"
228
+ }), /* @__PURE__ */ T(o, {
229
+ variant: N.marketingOptIn ? "default" : "secondary",
230
+ children: N.marketingOptIn ? "Yes" : "No"
231
+ })] })
232
+ ]
233
+ })] }), /* @__PURE__ */ E(e, { children: [/* @__PURE__ */ T(r, { children: /* @__PURE__ */ T(n, { children: "Account Info" }) }), /* @__PURE__ */ E(t, {
234
+ className: "space-y-3",
235
+ children: [/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("p", {
236
+ className: "text-sm text-text-secondary",
237
+ children: "Created"
238
+ }), /* @__PURE__ */ T("p", { children: x(N.createdAt, "full") })] }), /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("p", {
239
+ className: "text-sm text-text-secondary",
240
+ children: "Last Updated"
241
+ }), /* @__PURE__ */ T("p", { children: x(N.updatedAt, "relative") })] })]
242
+ })] })]
243
+ })]
244
+ })
245
+ ]
246
+ }) : /* @__PURE__ */ T(i, {
247
+ title: "New Customer",
248
+ subtitle: "Add a new customer",
249
+ icon: /* @__PURE__ */ T(_, { size: 24 }),
250
+ headerActions: /* @__PURE__ */ E(l, {
251
+ variant: "outline",
252
+ onClick: L,
253
+ children: [/* @__PURE__ */ T(u, { size: 16 }), " Back"]
254
+ }),
255
+ children: /* @__PURE__ */ T(e, { children: /* @__PURE__ */ T(t, {
256
+ className: "p-8 text-center",
257
+ children: /* @__PURE__ */ T("p", {
258
+ className: "text-text-secondary",
259
+ children: "Customer creation form would go here"
260
+ })
261
+ }) })
262
+ });
263
+ }
264
+ //#endregion
265
+ export { j as default };
@@ -0,0 +1,163 @@
1
+ import { i as e, l as t, o as n, s as r, u as i } from "./PageLayout-D3N8MCTm.js";
2
+ import { t as a } from "./DataTable-CD9ZhpLB.js";
3
+ import { t as o } from "./download-Dpa9vqoG.js";
4
+ import { t as s } from "./plus-Dl1rLeJR.js";
5
+ import { t as c } from "./refresh-cw-CWfERAit.js";
6
+ import { t as l } from "./star-YsVV3MNQ.js";
7
+ import { t as u } from "./users-g2N0eL-Z.js";
8
+ import { r as d } from "./graphqlClient-CdJyR_ed.js";
9
+ import { r as f } from "./useCustomers-bS3a4ytk.js";
10
+ import { i as p } from "./StatusBadge-CijYQXtb.js";
11
+ import { r as m } from "./formatters-_vJlC-47.js";
12
+ import { t as h } from "./navigation-BgnOfsVd.js";
13
+ import { jsx as g, jsxs as _ } from "react/jsx-runtime";
14
+ import { CTAOverflowMenu as v, EmphasisPanel as y, PagePurpose as b } from "@burdenoff/fe-libs/ui";
15
+ //#region src/movethewheels/pages/CustomersPage.tsx
16
+ function x() {
17
+ let { basePath: x, navigate: S } = d(), { customers: C, totalCustomers: w, isLoading: T, refetch: E } = f({ limit: 100 }), D = (e) => S?.(h(x, e));
18
+ return /* @__PURE__ */ _(e, {
19
+ title: "Customers",
20
+ subtitle: `${w} customers`,
21
+ icon: /* @__PURE__ */ g(u, { size: 24 }),
22
+ headerActions: /* @__PURE__ */ g(v, {
23
+ primary: {
24
+ label: "Add Customer",
25
+ icon: /* @__PURE__ */ g(s, { size: 16 }),
26
+ onSelect: () => D("customers/new")
27
+ },
28
+ actions: [{
29
+ label: "Refresh",
30
+ icon: /* @__PURE__ */ g(c, { size: 16 }),
31
+ onSelect: () => E()
32
+ }, {
33
+ label: "Export",
34
+ icon: /* @__PURE__ */ g(o, { size: 16 }),
35
+ onSelect: () => {}
36
+ }]
37
+ }),
38
+ children: [
39
+ /* @__PURE__ */ g(b, {
40
+ icon: /* @__PURE__ */ g(u, { size: 18 }),
41
+ 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."
42
+ }),
43
+ /* @__PURE__ */ _(y, { children: [/* @__PURE__ */ g("p", {
44
+ className: "text-sm font-medium text-text-secondary",
45
+ children: "Customer base at a glance"
46
+ }), /* @__PURE__ */ _("div", {
47
+ className: "mt-3 grid grid-cols-3 gap-4",
48
+ children: [
49
+ /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
50
+ className: "text-2xl font-bold text-text-primary tabular-nums",
51
+ children: w
52
+ }), /* @__PURE__ */ g("p", {
53
+ className: "text-xs text-text-secondary",
54
+ children: "Total customers"
55
+ })] }),
56
+ /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
57
+ className: "text-2xl font-bold text-text-primary tabular-nums",
58
+ children: C.filter((e) => e.isActive).length
59
+ }), /* @__PURE__ */ g("p", {
60
+ className: "text-xs text-text-secondary",
61
+ children: "Active"
62
+ })] }),
63
+ /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
64
+ className: "text-2xl font-bold text-text-primary tabular-nums",
65
+ children: C.filter((e) => e.type === "b2b").length
66
+ }), /* @__PURE__ */ g("p", {
67
+ className: "text-xs text-text-secondary",
68
+ children: "Business accounts"
69
+ })] })
70
+ ]
71
+ })] }),
72
+ /* @__PURE__ */ g(a, {
73
+ columns: [
74
+ {
75
+ id: "customer",
76
+ header: "Customer",
77
+ cell: (e) => /* @__PURE__ */ _("div", {
78
+ className: "flex items-center gap-3",
79
+ children: [/* @__PURE__ */ g(n, { children: /* @__PURE__ */ g(r, { children: e.name.split(" ").map((e) => e[0]).join("") }) }), /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
80
+ className: "font-medium",
81
+ children: e.name
82
+ }), /* @__PURE__ */ g("p", {
83
+ className: "text-sm text-text-secondary",
84
+ children: e.email
85
+ })] })]
86
+ })
87
+ },
88
+ {
89
+ id: "type",
90
+ header: "Type",
91
+ accessorKey: "type",
92
+ cell: (e) => /* @__PURE__ */ g(p, { type: e.type })
93
+ },
94
+ {
95
+ id: "company",
96
+ header: "Company",
97
+ accessorKey: "company",
98
+ cell: (e) => e.company || "-"
99
+ },
100
+ {
101
+ id: "phone",
102
+ header: "Phone",
103
+ accessorKey: "phone"
104
+ },
105
+ {
106
+ id: "location",
107
+ header: "Location",
108
+ cell: (e) => `${e.address.city}, ${e.address.state}`
109
+ },
110
+ {
111
+ id: "rating",
112
+ header: "Rating",
113
+ cell: (e) => /* @__PURE__ */ _("div", {
114
+ className: "flex items-center gap-1",
115
+ children: [/* @__PURE__ */ g(l, {
116
+ size: 14,
117
+ className: "text-yellow-500 fill-yellow-500"
118
+ }), /* @__PURE__ */ g("span", { children: e.rating.toFixed(1) })]
119
+ })
120
+ },
121
+ {
122
+ id: "status",
123
+ header: "Status",
124
+ cell: (e) => /* @__PURE__ */ g(t, {
125
+ variant: e.isActive ? "default" : "secondary",
126
+ children: e.isActive ? "Active" : "Inactive"
127
+ })
128
+ },
129
+ {
130
+ id: "created",
131
+ header: "Created",
132
+ accessorKey: "createdAt",
133
+ sortable: !0,
134
+ cell: (e) => m(e.createdAt, "short")
135
+ }
136
+ ],
137
+ data: C,
138
+ isLoading: T,
139
+ searchable: !0,
140
+ searchPlaceholder: "Search customers...",
141
+ searchFields: [
142
+ "name",
143
+ "email",
144
+ "company"
145
+ ],
146
+ onRowClick: (e) => D(`customers/${e.id}`),
147
+ getRowId: (e) => e.id,
148
+ emptyIllustration: "empty-people",
149
+ emptyTitle: "No customers yet",
150
+ emptyDescription: "Add your first customer to start booking deliveries for them.",
151
+ emptyAction: /* @__PURE__ */ _(i, {
152
+ onClick: () => D("customers/new"),
153
+ children: [/* @__PURE__ */ g(s, {
154
+ size: 16,
155
+ className: "mr-1.5"
156
+ }), "Add Customer"]
157
+ })
158
+ })
159
+ ]
160
+ });
161
+ }
162
+ //#endregion
163
+ export { x as default };