@burdenoff/microfe-movethewheels 2026.510.105

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 (208) hide show
  1. package/README.md +82 -0
  2. package/dist/AIAssistantPage-hD0VYJdH.js +210 -0
  3. package/dist/AnalyticsPage-DHTHCUtr.js +201 -0
  4. package/dist/CreateOrderPage-Cprg4Y9V.js +471 -0
  5. package/dist/CustomerDetailsPage-DNDEw7IW.js +239 -0
  6. package/dist/CustomersPage-CDjjeCEL.js +119 -0
  7. package/dist/DashboardPage-8iTPXRAG.js +374 -0
  8. package/dist/DataTable-CRIKfdIN.js +239 -0
  9. package/dist/DriverDetailsPage-CRyRCno7.js +297 -0
  10. package/dist/DriversPage-16O8fVmf.js +127 -0
  11. package/dist/FinancePage-BYUxK5dR.js +154 -0
  12. package/dist/FleetPage-CHYETCWT.js +293 -0
  13. package/dist/ImportExportPage-C3MKKxfc.js +232 -0
  14. package/dist/InventoryPage--822AxZM.js +223 -0
  15. package/dist/LiveTrackingPage-Dp3rTJDr.js +332 -0
  16. package/dist/MarketplacePage-DjEqudfM.js +192 -0
  17. package/dist/MetricCard-GTbxAk1a.js +135 -0
  18. package/dist/OrderDetailsPage-BIuYG0ub.js +398 -0
  19. package/dist/OrdersListPage-CW5V0Uvh.js +257 -0
  20. package/dist/PageLayout-B7b0vl0R.js +1894 -0
  21. package/dist/ProductDetailsPage-Q3X7AT-7.js +168 -0
  22. package/dist/ProductsPage-CUj9JpnW.js +131 -0
  23. package/dist/ReportsPage-DblO5CdJ.js +227 -0
  24. package/dist/RouteDetailsPage-CLctgk6A.js +240 -0
  25. package/dist/RoutesPage-8hrv6RWT.js +116 -0
  26. package/dist/SettingsPage-BJ5BQeqn.js +247 -0
  27. package/dist/StatusBadge-BrrwraIA.js +206 -0
  28. package/dist/TrackingPage-BGqHDh-w.js +322 -0
  29. package/dist/VehicleDetailsPage-XnDH4iQR.js +194 -0
  30. package/dist/VehiclesPage-Cs4XxHkA.js +127 -0
  31. package/dist/WarehouseDetailsPage-GemdMvr_.js +215 -0
  32. package/dist/WarehousesPage-QTiuDuXy.js +121 -0
  33. package/dist/arrow-left-6CiLhqVp.js +11 -0
  34. package/dist/box-BunB_4UH.js +18 -0
  35. package/dist/chart-column-DWwVEVQ-.js +22 -0
  36. package/dist/chevron-right-DhZVf20o.js +8 -0
  37. package/dist/circle-alert-D5f6RZxt.js +26 -0
  38. package/dist/circle-check-big-D-JMHcTe.js +11 -0
  39. package/dist/clock-CvwBKbQP.js +13 -0
  40. package/dist/dev/main.d.ts +1 -0
  41. package/dist/dollar-sign-CP9qeU5d.js +14 -0
  42. package/dist/download-CIuG04pJ.js +21 -0
  43. package/dist/file-text-Dd_thxkn.js +26 -0
  44. package/dist/filter-DyRMX9CU.js +8 -0
  45. package/dist/formatters-_vJlC-47.js +50 -0
  46. package/dist/generated/global-operations.d.ts +1 -0
  47. package/dist/generated/global-types.d.ts +20715 -0
  48. package/dist/generated/wspace-operations.d.ts +3704 -0
  49. package/dist/generated/wspace-types.d.ts +53362 -0
  50. package/dist/graphqlClient-CdJyR_ed.js +55 -0
  51. package/dist/index.d.ts +4 -0
  52. package/dist/index.js +772 -0
  53. package/dist/map-BqH1cBJi.js +18 -0
  54. package/dist/map-pin-CFBOmh-A.js +13 -0
  55. package/dist/movethewheels/MoveTheWheelsRoot.d.ts +25 -0
  56. package/dist/movethewheels/MoveTheWheelsRoutes.d.ts +7 -0
  57. package/dist/movethewheels/components/DataTable.d.ts +32 -0
  58. package/dist/movethewheels/components/MetricCard.d.ts +43 -0
  59. package/dist/movethewheels/components/PageLayout.d.ts +68 -0
  60. package/dist/movethewheels/components/StatusBadge.d.ts +49 -0
  61. package/dist/movethewheels/components/index.d.ts +10 -0
  62. package/dist/movethewheels/components/ui.d.ts +22 -0
  63. package/dist/movethewheels/constants/index.d.ts +24 -0
  64. package/dist/movethewheels/constants/mockData.d.ts +33 -0
  65. package/dist/movethewheels/hooks/index.d.ts +12 -0
  66. package/dist/movethewheels/hooks/useAnalytics.d.ts +118 -0
  67. package/dist/movethewheels/hooks/useCustomers.d.ts +37 -0
  68. package/dist/movethewheels/hooks/useFleet.d.ts +71 -0
  69. package/dist/movethewheels/hooks/useInventory.d.ts +60 -0
  70. package/dist/movethewheels/hooks/useOrders.d.ts +47 -0
  71. package/dist/movethewheels/hooks/useRoutes.d.ts +41 -0
  72. package/dist/movethewheels/hooks/useTracking.d.ts +69 -0
  73. package/dist/movethewheels/index.d.ts +30 -0
  74. package/dist/movethewheels/pages/AIAssistantPage.d.ts +4 -0
  75. package/dist/movethewheels/pages/AnalyticsPage.d.ts +4 -0
  76. package/dist/movethewheels/pages/CreateOrderPage.d.ts +6 -0
  77. package/dist/movethewheels/pages/CustomerDetailsPage.d.ts +4 -0
  78. package/dist/movethewheels/pages/CustomersPage.d.ts +4 -0
  79. package/dist/movethewheels/pages/DashboardPage.d.ts +6 -0
  80. package/dist/movethewheels/pages/DriverDetailsPage.d.ts +4 -0
  81. package/dist/movethewheels/pages/DriversPage.d.ts +4 -0
  82. package/dist/movethewheels/pages/FinancePage.d.ts +4 -0
  83. package/dist/movethewheels/pages/FleetPage.d.ts +6 -0
  84. package/dist/movethewheels/pages/ImportExportPage.d.ts +4 -0
  85. package/dist/movethewheels/pages/InventoryPage.d.ts +4 -0
  86. package/dist/movethewheels/pages/LiveTrackingPage.d.ts +6 -0
  87. package/dist/movethewheels/pages/MarketplacePage.d.ts +4 -0
  88. package/dist/movethewheels/pages/OrderDetailsPage.d.ts +6 -0
  89. package/dist/movethewheels/pages/OrdersListPage.d.ts +6 -0
  90. package/dist/movethewheels/pages/ProductDetailsPage.d.ts +4 -0
  91. package/dist/movethewheels/pages/ProductsPage.d.ts +4 -0
  92. package/dist/movethewheels/pages/ReportsPage.d.ts +4 -0
  93. package/dist/movethewheels/pages/RouteDetailsPage.d.ts +4 -0
  94. package/dist/movethewheels/pages/RoutesPage.d.ts +4 -0
  95. package/dist/movethewheels/pages/SettingsPage.d.ts +4 -0
  96. package/dist/movethewheels/pages/TrackingPage.d.ts +6 -0
  97. package/dist/movethewheels/pages/VehicleDetailsPage.d.ts +4 -0
  98. package/dist/movethewheels/pages/VehiclesPage.d.ts +4 -0
  99. package/dist/movethewheels/pages/WarehouseDetailsPage.d.ts +4 -0
  100. package/dist/movethewheels/pages/WarehousesPage.d.ts +4 -0
  101. package/dist/movethewheels/providers/MoveTheWheelsProvider.d.ts +16 -0
  102. package/dist/movethewheels/store/movethewheelsStore.d.ts +73 -0
  103. package/dist/movethewheels/types/index.d.ts +655 -0
  104. package/dist/movethewheels/utils/cn.d.ts +6 -0
  105. package/dist/movethewheels/utils/formatters.d.ts +60 -0
  106. package/dist/movethewheels/utils/graphqlClient.d.ts +11 -0
  107. package/dist/movethewheels/utils/index.d.ts +7 -0
  108. package/dist/movethewheels/utils/navigation.d.ts +23 -0
  109. package/dist/navigation-BgnOfsVd.js +6 -0
  110. package/dist/navigation-C2fY_aS9.js +8 -0
  111. package/dist/package-DVZbDRcV.js +22 -0
  112. package/dist/phone-KdwpVmC4.js +18 -0
  113. package/dist/plus-Bl7uX6Ji.js +11 -0
  114. package/dist/refresh-cw-BYjl3K-8.js +22 -0
  115. package/dist/route-Ce_poKFi.js +51 -0
  116. package/dist/save-C-qDVat-.js +18 -0
  117. package/dist/search-5pdn5eOO.js +13 -0
  118. package/dist/settings-C4kIDsYg.js +28 -0
  119. package/dist/square-pen-BwQ67vLE.js +11 -0
  120. package/dist/star-BlVsC3Ad.js +8 -0
  121. package/dist/store-DTmQT5M0.js +26 -0
  122. package/dist/trending-up-C1faflCI.js +11 -0
  123. package/dist/triangle-alert-CUoVAA4L.js +18 -0
  124. package/dist/truck-BmDAzu05.js +30 -0
  125. package/dist/useAnalytics-ph7eTIK6.js +297 -0
  126. package/dist/useCustomers-bS3a4ytk.js +186 -0
  127. package/dist/useFleet-BdETplNE.js +398 -0
  128. package/dist/useInventory-Dwn18FPz.js +323 -0
  129. package/dist/useOrders-D_3_hGMp.js +324 -0
  130. package/dist/useRoutes-v4aBaS-E.js +224 -0
  131. package/dist/useTracking-De2KIUNu.js +261 -0
  132. package/dist/user-BplzDrLP.js +13 -0
  133. package/dist/users-i-igmsP4.js +24 -0
  134. package/dist/warehouse-DewG0PXh.js +25 -0
  135. package/dist/wrench-CoSDEIC7.js +31 -0
  136. package/package.json +107 -0
  137. package/src/dev/main.tsx +110 -0
  138. package/src/dev/styles.css +139 -0
  139. package/src/generated/global-operations.ts +2 -0
  140. package/src/generated/global-types.ts +24048 -0
  141. package/src/generated/wspace-operations.ts +3734 -0
  142. package/src/generated/wspace-types.ts +60715 -0
  143. package/src/index.ts +4 -0
  144. package/src/movethewheels/MoveTheWheelsRoot.tsx +258 -0
  145. package/src/movethewheels/MoveTheWheelsRoutes.tsx +119 -0
  146. package/src/movethewheels/components/DataTable.tsx +367 -0
  147. package/src/movethewheels/components/MetricCard.tsx +180 -0
  148. package/src/movethewheels/components/PageLayout.tsx +234 -0
  149. package/src/movethewheels/components/StatusBadge.tsx +243 -0
  150. package/src/movethewheels/components/index.ts +26 -0
  151. package/src/movethewheels/components/ui.tsx +124 -0
  152. package/src/movethewheels/constants/index.ts +65 -0
  153. package/src/movethewheels/constants/mockData.ts +1342 -0
  154. package/src/movethewheels/hooks/index.ts +55 -0
  155. package/src/movethewheels/hooks/useAnalytics.ts +476 -0
  156. package/src/movethewheels/hooks/useCustomers.ts +359 -0
  157. package/src/movethewheels/hooks/useFleet.ts +778 -0
  158. package/src/movethewheels/hooks/useInventory.ts +632 -0
  159. package/src/movethewheels/hooks/useOrders.ts +703 -0
  160. package/src/movethewheels/hooks/useRoutes.ts +453 -0
  161. package/src/movethewheels/hooks/useTracking.ts +505 -0
  162. package/src/movethewheels/index.ts +68 -0
  163. package/src/movethewheels/pages/AIAssistantPage.tsx +160 -0
  164. package/src/movethewheels/pages/AnalyticsPage.tsx +190 -0
  165. package/src/movethewheels/pages/CreateOrderPage.tsx +454 -0
  166. package/src/movethewheels/pages/CustomerDetailsPage.tsx +207 -0
  167. package/src/movethewheels/pages/CustomersPage.tsx +115 -0
  168. package/src/movethewheels/pages/DashboardPage.tsx +414 -0
  169. package/src/movethewheels/pages/DriverDetailsPage.tsx +261 -0
  170. package/src/movethewheels/pages/DriversPage.tsx +118 -0
  171. package/src/movethewheels/pages/FinancePage.tsx +141 -0
  172. package/src/movethewheels/pages/FleetPage.tsx +289 -0
  173. package/src/movethewheels/pages/ImportExportPage.tsx +165 -0
  174. package/src/movethewheels/pages/InventoryPage.tsx +212 -0
  175. package/src/movethewheels/pages/LiveTrackingPage.tsx +325 -0
  176. package/src/movethewheels/pages/MarketplacePage.tsx +235 -0
  177. package/src/movethewheels/pages/OrderDetailsPage.tsx +387 -0
  178. package/src/movethewheels/pages/OrdersListPage.tsx +241 -0
  179. package/src/movethewheels/pages/ProductDetailsPage.tsx +155 -0
  180. package/src/movethewheels/pages/ProductsPage.tsx +124 -0
  181. package/src/movethewheels/pages/ReportsPage.tsx +164 -0
  182. package/src/movethewheels/pages/RouteDetailsPage.tsx +245 -0
  183. package/src/movethewheels/pages/RoutesPage.tsx +104 -0
  184. package/src/movethewheels/pages/SettingsPage.tsx +242 -0
  185. package/src/movethewheels/pages/TrackingPage.tsx +419 -0
  186. package/src/movethewheels/pages/VehicleDetailsPage.tsx +218 -0
  187. package/src/movethewheels/pages/VehiclesPage.tsx +124 -0
  188. package/src/movethewheels/pages/WarehouseDetailsPage.tsx +216 -0
  189. package/src/movethewheels/pages/WarehousesPage.tsx +122 -0
  190. package/src/movethewheels/providers/MoveTheWheelsProvider.tsx +66 -0
  191. package/src/movethewheels/store/movethewheelsStore.ts +136 -0
  192. package/src/movethewheels/types/index.ts +744 -0
  193. package/src/movethewheels/utils/cn.ts +9 -0
  194. package/src/movethewheels/utils/formatters.ts +215 -0
  195. package/src/movethewheels/utils/graphqlClient.ts +63 -0
  196. package/src/movethewheels/utils/index.ts +8 -0
  197. package/src/movethewheels/utils/navigation.ts +70 -0
  198. package/src/operations/global/.gitkeep +0 -0
  199. package/src/operations/wspace/movethewheels/fragments/core.graphql +191 -0
  200. package/src/operations/wspace/movethewheels/mutations/entities.graphql +87 -0
  201. package/src/operations/wspace/movethewheels/mutations/logistics.graphql +86 -0
  202. package/src/operations/wspace/movethewheels/mutations/marketplace-reports.graphql +81 -0
  203. package/src/operations/wspace/movethewheels/mutations/orders.graphql +21 -0
  204. package/src/operations/wspace/movethewheels/queries/dashboard.graphql +61 -0
  205. package/src/operations/wspace/movethewheels/queries/entities.graphql +83 -0
  206. package/src/operations/wspace/movethewheels/queries/logistics.graphql +84 -0
  207. package/src/operations/wspace/movethewheels/queries/marketplace-reports.graphql +40 -0
  208. package/src/operations/wspace/movethewheels/queries/orders.graphql +43 -0
package/src/index.ts ADDED
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Package entry point
3
+ */
4
+ export * from './movethewheels';
@@ -0,0 +1,258 @@
1
+ /**
2
+ * MoveTheWheels Root Component
3
+ *
4
+ * Main entry point for the MoveTheWheels microfrontend.
5
+ * Registers navigation items with the host shell and sets up providers.
6
+ */
7
+
8
+ import type { FC } from 'react';
9
+ import { useEffect } from 'react';
10
+ import {
11
+ Truck,
12
+ Package,
13
+ Users,
14
+ LayoutDashboard,
15
+ Map,
16
+ Warehouse,
17
+ Route,
18
+ BarChart3,
19
+ Settings,
20
+ Store,
21
+ Car,
22
+ UserCheck,
23
+ Boxes,
24
+ FileText,
25
+ DollarSign,
26
+ Globe,
27
+ Bot,
28
+ } from 'lucide-react';
29
+ import { MoveTheWheelsProvider } from './providers/MoveTheWheelsProvider';
30
+ import { FeatureFlagProvider } from '@burdenoff/fe-libs/shared/feature-flags';
31
+ import type { NavItem, MoveTheWheelsRootProps } from './types';
32
+ import { MoveTheWheelsRoutes } from './MoveTheWheelsRoutes';
33
+
34
+ /**
35
+ * Root component for the MoveTheWheels microfrontend.
36
+ *
37
+ * @example
38
+ * ```tsx
39
+ * import { MoveTheWheelsRoot } from '@burdenoff/microfe-movethewheels';
40
+ *
41
+ * function App() {
42
+ * return (
43
+ * <MoveTheWheelsRoot
44
+ * basePath="/movethewheels"
45
+ * navigate={(path) => router.push(path)}
46
+ * currentUser={currentUser}
47
+ * workspaceId="ws-123"
48
+ * apiGatewayUrl="https://api.example.com"
49
+ * authToken="token"
50
+ * />
51
+ * );
52
+ * }
53
+ * ```
54
+ */
55
+ export const MoveTheWheelsRoot: FC<MoveTheWheelsRootProps> = (props) => {
56
+ const { registerNavItems, registerFooterItems, basePath = '/' } = props;
57
+
58
+ // Helper to join paths correctly, avoiding double slashes
59
+ const joinPath = (base: string, path: string): string => {
60
+ const cleanBase = base.endsWith('/') ? base.slice(0, -1) : base;
61
+ const cleanPath = path.startsWith('/') ? path : `/${path}`;
62
+ return cleanBase + cleanPath;
63
+ };
64
+
65
+ // Register navigation items with the shell
66
+ useEffect(() => {
67
+ if (!registerNavItems) return;
68
+
69
+ const movethewheelsNavItem: NavItem = {
70
+ id: 'movethewheels',
71
+ label: 'MoveTheWheels',
72
+ path: basePath,
73
+ icon: <Truck size={20} />,
74
+ order: 25,
75
+ group: 'workspace',
76
+ children: [
77
+ {
78
+ id: 'mtw-dashboard',
79
+ label: 'Dashboard',
80
+ path: basePath,
81
+ icon: <LayoutDashboard size={16} />,
82
+ order: 1,
83
+ },
84
+ {
85
+ id: 'mtw-orders',
86
+ label: 'Orders',
87
+ path: joinPath(basePath, 'orders'),
88
+ icon: <Package size={16} />,
89
+ order: 2,
90
+ },
91
+ {
92
+ id: 'mtw-tracking',
93
+ label: 'Tracking',
94
+ path: joinPath(basePath, 'tracking'),
95
+ icon: <Map size={16} />,
96
+ order: 3,
97
+ },
98
+ {
99
+ id: 'mtw-fleet',
100
+ label: 'Fleet',
101
+ path: joinPath(basePath, 'fleet'),
102
+ icon: <Truck size={16} />,
103
+ order: 4,
104
+ children: [
105
+ {
106
+ id: 'mtw-fleet-overview',
107
+ label: 'Overview',
108
+ path: joinPath(basePath, 'fleet'),
109
+ icon: <LayoutDashboard size={14} />,
110
+ order: 1,
111
+ },
112
+ {
113
+ id: 'mtw-vehicles',
114
+ label: 'Vehicles',
115
+ path: joinPath(basePath, 'fleet/vehicles'),
116
+ icon: <Car size={14} />,
117
+ order: 2,
118
+ },
119
+ {
120
+ id: 'mtw-drivers',
121
+ label: 'Drivers',
122
+ path: joinPath(basePath, 'fleet/drivers'),
123
+ icon: <UserCheck size={14} />,
124
+ order: 3,
125
+ },
126
+ ],
127
+ },
128
+ {
129
+ id: 'mtw-inventory',
130
+ label: 'Inventory',
131
+ path: joinPath(basePath, 'inventory'),
132
+ icon: <Warehouse size={16} />,
133
+ order: 5,
134
+ children: [
135
+ {
136
+ id: 'mtw-inventory-overview',
137
+ label: 'Overview',
138
+ path: joinPath(basePath, 'inventory'),
139
+ icon: <LayoutDashboard size={14} />,
140
+ order: 1,
141
+ },
142
+ {
143
+ id: 'mtw-products',
144
+ label: 'Products',
145
+ path: joinPath(basePath, 'inventory/products'),
146
+ icon: <Boxes size={14} />,
147
+ order: 2,
148
+ },
149
+ {
150
+ id: 'mtw-warehouses',
151
+ label: 'Warehouses',
152
+ path: joinPath(basePath, 'inventory/warehouses'),
153
+ icon: <Warehouse size={14} />,
154
+ order: 3,
155
+ },
156
+ ],
157
+ },
158
+ {
159
+ id: 'mtw-customers',
160
+ label: 'Customers',
161
+ path: joinPath(basePath, 'customers'),
162
+ icon: <Users size={16} />,
163
+ order: 6,
164
+ },
165
+ {
166
+ id: 'mtw-routes',
167
+ label: 'Routes',
168
+ path: joinPath(basePath, 'routes'),
169
+ icon: <Route size={16} />,
170
+ order: 7,
171
+ },
172
+ {
173
+ id: 'mtw-analytics',
174
+ label: 'Analytics',
175
+ path: joinPath(basePath, 'analytics'),
176
+ icon: <BarChart3 size={16} />,
177
+ order: 8,
178
+ },
179
+ {
180
+ id: 'mtw-finance',
181
+ label: 'Finance',
182
+ path: joinPath(basePath, 'finance'),
183
+ icon: <DollarSign size={16} />,
184
+ order: 9,
185
+ },
186
+ {
187
+ id: 'mtw-marketplace',
188
+ label: 'Marketplace',
189
+ path: joinPath(basePath, 'marketplace'),
190
+ icon: <Store size={16} />,
191
+ order: 10,
192
+ },
193
+ {
194
+ id: 'mtw-import-export',
195
+ label: 'Import/Export',
196
+ path: joinPath(basePath, 'import-export'),
197
+ icon: <Globe size={16} />,
198
+ order: 11,
199
+ },
200
+ {
201
+ id: 'mtw-reports',
202
+ label: 'Reports',
203
+ path: joinPath(basePath, 'reports'),
204
+ icon: <FileText size={16} />,
205
+ order: 12,
206
+ },
207
+ {
208
+ id: 'mtw-ai-assistant',
209
+ label: 'AI Assistant',
210
+ path: joinPath(basePath, 'ai-assistant'),
211
+ icon: <Bot size={16} />,
212
+ order: 13,
213
+ },
214
+ {
215
+ id: 'mtw-settings',
216
+ label: 'Settings',
217
+ path: joinPath(basePath, 'settings'),
218
+ icon: <Settings size={16} />,
219
+ order: 99,
220
+ },
221
+ ],
222
+ };
223
+
224
+ // Register and get cleanup function
225
+ const cleanup = registerNavItems(movethewheelsNavItem);
226
+
227
+ // Return cleanup function to unregister on unmount
228
+ return cleanup;
229
+ }, [registerNavItems, basePath]);
230
+
231
+ // Register footer items
232
+ useEffect(() => {
233
+ if (!registerFooterItems) return;
234
+
235
+ const footerItems = [
236
+ {
237
+ id: 'mtw-status',
238
+ label: 'Logistics Ready',
239
+ type: 'status' as const,
240
+ order: 20,
241
+ section: 'left' as const,
242
+ },
243
+ ];
244
+
245
+ const cleanup = registerFooterItems(footerItems);
246
+ return cleanup;
247
+ }, [registerFooterItems]);
248
+
249
+ return (
250
+ <FeatureFlagProvider workspaceId={null} gateway="global" defaultEnabled={true}>
251
+ <MoveTheWheelsProvider {...props}>
252
+ <div className="movethewheels-root h-full">
253
+ <MoveTheWheelsRoutes />
254
+ </div>
255
+ </MoveTheWheelsProvider>
256
+ </FeatureFlagProvider>
257
+ );
258
+ };
@@ -0,0 +1,119 @@
1
+ /**
2
+ * MoveTheWheels Internal Routes
3
+ *
4
+ * Defines all internal routing for the microfrontend.
5
+ * Uses lazy loading for code splitting.
6
+ */
7
+
8
+ import { Routes, Route, Navigate } from 'react-router-dom';
9
+ import { lazy, Suspense } from 'react';
10
+
11
+ // Loading fallback
12
+ function PageLoader() {
13
+ return (
14
+ <div className="flex items-center justify-center min-h-[400px]">
15
+ <div className="flex flex-col items-center gap-3">
16
+ <div className="animate-spin rounded-full h-8 w-8 border-b-2 border-primary"></div>
17
+ <p className="text-sm text-muted-foreground">Loading...</p>
18
+ </div>
19
+ </div>
20
+ );
21
+ }
22
+
23
+ // Lazy-loaded pages
24
+ const DashboardPage = lazy(() => import('./pages/DashboardPage'));
25
+ const OrdersListPage = lazy(() => import('./pages/OrdersListPage'));
26
+ const OrderDetailsPage = lazy(() => import('./pages/OrderDetailsPage'));
27
+ const CreateOrderPage = lazy(() => import('./pages/CreateOrderPage'));
28
+ const TrackingPage = lazy(() => import('./pages/TrackingPage'));
29
+ const LiveTrackingPage = lazy(() => import('./pages/LiveTrackingPage'));
30
+ const FleetPage = lazy(() => import('./pages/FleetPage'));
31
+ const VehiclesPage = lazy(() => import('./pages/VehiclesPage'));
32
+ const VehicleDetailsPage = lazy(() => import('./pages/VehicleDetailsPage'));
33
+ const DriversPage = lazy(() => import('./pages/DriversPage'));
34
+ const DriverDetailsPage = lazy(() => import('./pages/DriverDetailsPage'));
35
+ const InventoryPage = lazy(() => import('./pages/InventoryPage'));
36
+ const ProductsPage = lazy(() => import('./pages/ProductsPage'));
37
+ const ProductDetailsPage = lazy(() => import('./pages/ProductDetailsPage'));
38
+ const WarehousesPage = lazy(() => import('./pages/WarehousesPage'));
39
+ const WarehouseDetailsPage = lazy(() => import('./pages/WarehouseDetailsPage'));
40
+ const CustomersPage = lazy(() => import('./pages/CustomersPage'));
41
+ const CustomerDetailsPage = lazy(() => import('./pages/CustomerDetailsPage'));
42
+ const RoutesPage = lazy(() => import('./pages/RoutesPage'));
43
+ const RouteDetailsPage = lazy(() => import('./pages/RouteDetailsPage'));
44
+ const AnalyticsPage = lazy(() => import('./pages/AnalyticsPage'));
45
+ const FinancePage = lazy(() => import('./pages/FinancePage'));
46
+ const MarketplacePage = lazy(() => import('./pages/MarketplacePage'));
47
+ const ImportExportPage = lazy(() => import('./pages/ImportExportPage'));
48
+ const ReportsPage = lazy(() => import('./pages/ReportsPage'));
49
+ const SettingsPage = lazy(() => import('./pages/SettingsPage'));
50
+ const AIAssistantPage = lazy(() => import('./pages/AIAssistantPage'));
51
+
52
+ export function MoveTheWheelsRoutes() {
53
+ return (
54
+ <Suspense fallback={<PageLoader />}>
55
+ <Routes>
56
+ {/* Dashboard */}
57
+ <Route index element={<DashboardPage />} />
58
+
59
+ {/* Orders */}
60
+ <Route path="orders" element={<OrdersListPage />} />
61
+ <Route path="orders/new" element={<CreateOrderPage />} />
62
+ <Route path="orders/:orderId" element={<OrderDetailsPage />} />
63
+ <Route path="orders/:orderId/edit" element={<CreateOrderPage />} />
64
+
65
+ {/* Tracking */}
66
+ <Route path="tracking" element={<TrackingPage />} />
67
+ <Route path="tracking/live" element={<LiveTrackingPage />} />
68
+
69
+ {/* Fleet */}
70
+ <Route path="fleet" element={<FleetPage />} />
71
+ <Route path="fleet/vehicles" element={<VehiclesPage />} />
72
+ <Route path="fleet/vehicles/:vehicleId" element={<VehicleDetailsPage />} />
73
+ <Route path="fleet/drivers" element={<DriversPage />} />
74
+ <Route path="fleet/drivers/:driverId" element={<DriverDetailsPage />} />
75
+
76
+ {/* Inventory */}
77
+ <Route path="inventory" element={<InventoryPage />} />
78
+ <Route path="inventory/products" element={<ProductsPage />} />
79
+ <Route path="inventory/products/:productId" element={<ProductDetailsPage />} />
80
+ <Route path="inventory/warehouses" element={<WarehousesPage />} />
81
+ <Route path="inventory/warehouses/:warehouseId" element={<WarehouseDetailsPage />} />
82
+
83
+ {/* Customers */}
84
+ <Route path="customers" element={<CustomersPage />} />
85
+ <Route path="customers/new" element={<CustomerDetailsPage />} />
86
+ <Route path="customers/:customerId" element={<CustomerDetailsPage />} />
87
+
88
+ {/* Routes */}
89
+ <Route path="routes" element={<RoutesPage />} />
90
+ <Route path="routes/new" element={<RouteDetailsPage />} />
91
+ <Route path="routes/:routeId" element={<RouteDetailsPage />} />
92
+
93
+ {/* Analytics */}
94
+ <Route path="analytics" element={<AnalyticsPage />} />
95
+
96
+ {/* Finance */}
97
+ <Route path="finance" element={<FinancePage />} />
98
+
99
+ {/* Marketplace */}
100
+ <Route path="marketplace" element={<MarketplacePage />} />
101
+
102
+ {/* Import/Export */}
103
+ <Route path="import-export" element={<ImportExportPage />} />
104
+
105
+ {/* Reports */}
106
+ <Route path="reports" element={<ReportsPage />} />
107
+
108
+ {/* AI Assistant */}
109
+ <Route path="ai-assistant" element={<AIAssistantPage />} />
110
+
111
+ {/* Settings */}
112
+ <Route path="settings" element={<SettingsPage />} />
113
+
114
+ {/* Catch-all - redirect to dashboard */}
115
+ <Route path="*" element={<Navigate to="" replace />} />
116
+ </Routes>
117
+ </Suspense>
118
+ );
119
+ }