@contractspec/example.marketplace 1.57.0 → 1.58.0

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 (302) hide show
  1. package/dist/browser/docs/index.js +103 -0
  2. package/dist/browser/docs/marketplace.docblock.js +103 -0
  3. package/dist/browser/entities/index.js +721 -0
  4. package/dist/browser/entities/order.js +167 -0
  5. package/dist/browser/entities/payout.js +142 -0
  6. package/dist/browser/entities/product.js +152 -0
  7. package/dist/browser/entities/review.js +129 -0
  8. package/dist/browser/entities/store.js +97 -0
  9. package/dist/browser/example.js +42 -0
  10. package/dist/browser/handlers/index.js +303 -0
  11. package/dist/browser/handlers/marketplace.handlers.js +303 -0
  12. package/dist/browser/index.js +2016 -0
  13. package/dist/browser/marketplace.capability.js +40 -0
  14. package/dist/browser/marketplace.feature.js +137 -0
  15. package/dist/browser/order/index.js +307 -0
  16. package/dist/browser/order/order.enum.js +17 -0
  17. package/dist/browser/order/order.event.js +131 -0
  18. package/dist/browser/order/order.operations.js +172 -0
  19. package/dist/browser/order/order.presentation.js +153 -0
  20. package/dist/browser/order/order.schema.js +79 -0
  21. package/dist/browser/payout/index.js +152 -0
  22. package/dist/browser/payout/payout.enum.js +12 -0
  23. package/dist/browser/payout/payout.event.js +55 -0
  24. package/dist/browser/payout/payout.operations.js +94 -0
  25. package/dist/browser/payout/payout.presentation.js +111 -0
  26. package/dist/browser/payout/payout.schema.js +61 -0
  27. package/dist/browser/product/index.js +249 -0
  28. package/dist/browser/product/product.enum.js +13 -0
  29. package/dist/browser/product/product.event.js +74 -0
  30. package/dist/browser/product/product.operations.js +171 -0
  31. package/dist/browser/product/product.presentation.js +158 -0
  32. package/dist/browser/product/product.schema.js +84 -0
  33. package/dist/browser/review/index.js +206 -0
  34. package/dist/browser/review/review.enum.js +11 -0
  35. package/dist/browser/review/review.event.js +50 -0
  36. package/dist/browser/review/review.operations.js +152 -0
  37. package/dist/browser/review/review.presentation.js +123 -0
  38. package/dist/browser/review/review.schema.js +74 -0
  39. package/dist/browser/seeders/index.js +12 -0
  40. package/dist/browser/store/index.js +142 -0
  41. package/dist/browser/store/store.enum.js +11 -0
  42. package/dist/browser/store/store.event.js +52 -0
  43. package/dist/browser/store/store.operations.js +88 -0
  44. package/dist/browser/store/store.presentation.js +94 -0
  45. package/dist/browser/store/store.schema.js +43 -0
  46. package/dist/browser/tests/operations.test-spec.js +139 -0
  47. package/dist/browser/ui/MarketplaceDashboard.js +418 -0
  48. package/dist/browser/ui/hooks/index.js +59 -0
  49. package/dist/browser/ui/hooks/useMarketplaceData.js +56 -0
  50. package/dist/browser/ui/index.js +668 -0
  51. package/dist/browser/ui/renderers/index.js +248 -0
  52. package/dist/browser/ui/renderers/marketplace.markdown.js +248 -0
  53. package/dist/docs/index.d.ts +2 -1
  54. package/dist/docs/index.d.ts.map +1 -0
  55. package/dist/docs/index.js +104 -1
  56. package/dist/docs/marketplace.docblock.d.ts +2 -1
  57. package/dist/docs/marketplace.docblock.d.ts.map +1 -0
  58. package/dist/docs/marketplace.docblock.js +46 -57
  59. package/dist/entities/index.d.ts +302 -307
  60. package/dist/entities/index.d.ts.map +1 -1
  61. package/dist/entities/index.js +719 -43
  62. package/dist/entities/order.d.ts +77 -82
  63. package/dist/entities/order.d.ts.map +1 -1
  64. package/dist/entities/order.js +162 -167
  65. package/dist/entities/payout.d.ts +64 -69
  66. package/dist/entities/payout.d.ts.map +1 -1
  67. package/dist/entities/payout.js +137 -156
  68. package/dist/entities/product.d.ts +69 -74
  69. package/dist/entities/product.d.ts.map +1 -1
  70. package/dist/entities/product.js +148 -156
  71. package/dist/entities/review.d.ts +55 -60
  72. package/dist/entities/review.d.ts.map +1 -1
  73. package/dist/entities/review.js +124 -146
  74. package/dist/entities/store.d.ts +40 -45
  75. package/dist/entities/store.d.ts.map +1 -1
  76. package/dist/entities/store.js +94 -106
  77. package/dist/example.d.ts +2 -6
  78. package/dist/example.d.ts.map +1 -1
  79. package/dist/example.js +41 -55
  80. package/dist/handlers/index.d.ts +2 -2
  81. package/dist/handlers/index.d.ts.map +1 -0
  82. package/dist/handlers/index.js +304 -3
  83. package/dist/handlers/marketplace.handlers.d.ts +138 -137
  84. package/dist/handlers/marketplace.handlers.d.ts.map +1 -1
  85. package/dist/handlers/marketplace.handlers.js +284 -309
  86. package/dist/index.d.ts +13 -31
  87. package/dist/index.d.ts.map +1 -0
  88. package/dist/index.js +2017 -32
  89. package/dist/marketplace.capability.d.ts +3 -8
  90. package/dist/marketplace.capability.d.ts.map +1 -1
  91. package/dist/marketplace.capability.js +41 -34
  92. package/dist/marketplace.feature.d.ts +1 -6
  93. package/dist/marketplace.feature.d.ts.map +1 -1
  94. package/dist/marketplace.feature.js +136 -313
  95. package/dist/node/docs/index.js +103 -0
  96. package/dist/node/docs/marketplace.docblock.js +103 -0
  97. package/dist/node/entities/index.js +721 -0
  98. package/dist/node/entities/order.js +167 -0
  99. package/dist/node/entities/payout.js +142 -0
  100. package/dist/node/entities/product.js +152 -0
  101. package/dist/node/entities/review.js +129 -0
  102. package/dist/node/entities/store.js +97 -0
  103. package/dist/node/example.js +42 -0
  104. package/dist/node/handlers/index.js +303 -0
  105. package/dist/node/handlers/marketplace.handlers.js +303 -0
  106. package/dist/node/index.js +2016 -0
  107. package/dist/node/marketplace.capability.js +40 -0
  108. package/dist/node/marketplace.feature.js +137 -0
  109. package/dist/node/order/index.js +307 -0
  110. package/dist/node/order/order.enum.js +17 -0
  111. package/dist/node/order/order.event.js +131 -0
  112. package/dist/node/order/order.operations.js +172 -0
  113. package/dist/node/order/order.presentation.js +153 -0
  114. package/dist/node/order/order.schema.js +79 -0
  115. package/dist/node/payout/index.js +152 -0
  116. package/dist/node/payout/payout.enum.js +12 -0
  117. package/dist/node/payout/payout.event.js +55 -0
  118. package/dist/node/payout/payout.operations.js +94 -0
  119. package/dist/node/payout/payout.presentation.js +111 -0
  120. package/dist/node/payout/payout.schema.js +61 -0
  121. package/dist/node/product/index.js +249 -0
  122. package/dist/node/product/product.enum.js +13 -0
  123. package/dist/node/product/product.event.js +74 -0
  124. package/dist/node/product/product.operations.js +171 -0
  125. package/dist/node/product/product.presentation.js +158 -0
  126. package/dist/node/product/product.schema.js +84 -0
  127. package/dist/node/review/index.js +206 -0
  128. package/dist/node/review/review.enum.js +11 -0
  129. package/dist/node/review/review.event.js +50 -0
  130. package/dist/node/review/review.operations.js +152 -0
  131. package/dist/node/review/review.presentation.js +123 -0
  132. package/dist/node/review/review.schema.js +74 -0
  133. package/dist/node/seeders/index.js +12 -0
  134. package/dist/node/store/index.js +142 -0
  135. package/dist/node/store/store.enum.js +11 -0
  136. package/dist/node/store/store.event.js +52 -0
  137. package/dist/node/store/store.operations.js +88 -0
  138. package/dist/node/store/store.presentation.js +94 -0
  139. package/dist/node/store/store.schema.js +43 -0
  140. package/dist/node/tests/operations.test-spec.js +139 -0
  141. package/dist/node/ui/MarketplaceDashboard.js +418 -0
  142. package/dist/node/ui/hooks/index.js +59 -0
  143. package/dist/node/ui/hooks/useMarketplaceData.js +56 -0
  144. package/dist/node/ui/index.js +668 -0
  145. package/dist/node/ui/renderers/index.js +248 -0
  146. package/dist/node/ui/renderers/marketplace.markdown.js +248 -0
  147. package/dist/order/index.d.ts +8 -5
  148. package/dist/order/index.d.ts.map +1 -0
  149. package/dist/order/index.js +307 -5
  150. package/dist/order/order.enum.d.ts +1 -6
  151. package/dist/order/order.enum.d.ts.map +1 -1
  152. package/dist/order/order.enum.js +16 -20
  153. package/dist/order/order.event.d.ts +133 -139
  154. package/dist/order/order.event.d.ts.map +1 -1
  155. package/dist/order/order.event.js +121 -205
  156. package/dist/order/order.operations.d.ts +291 -297
  157. package/dist/order/order.operations.d.ts.map +1 -1
  158. package/dist/order/order.operations.js +169 -115
  159. package/dist/order/order.presentation.d.ts +3 -8
  160. package/dist/order/order.presentation.d.ts.map +1 -1
  161. package/dist/order/order.presentation.js +149 -81
  162. package/dist/order/order.schema.d.ts +143 -148
  163. package/dist/order/order.schema.d.ts.map +1 -1
  164. package/dist/order/order.schema.js +75 -150
  165. package/dist/payout/index.d.ts +8 -5
  166. package/dist/payout/index.d.ts.map +1 -0
  167. package/dist/payout/index.js +152 -5
  168. package/dist/payout/payout.enum.d.ts +1 -6
  169. package/dist/payout/payout.enum.d.ts.map +1 -1
  170. package/dist/payout/payout.enum.js +11 -15
  171. package/dist/payout/payout.event.d.ts +54 -60
  172. package/dist/payout/payout.event.d.ts.map +1 -1
  173. package/dist/payout/payout.event.js +51 -87
  174. package/dist/payout/payout.operations.d.ts +82 -88
  175. package/dist/payout/payout.operations.d.ts.map +1 -1
  176. package/dist/payout/payout.operations.js +92 -50
  177. package/dist/payout/payout.presentation.d.ts +2 -7
  178. package/dist/payout/payout.presentation.d.ts.map +1 -1
  179. package/dist/payout/payout.presentation.js +108 -56
  180. package/dist/payout/payout.schema.d.ts +139 -144
  181. package/dist/payout/payout.schema.d.ts.map +1 -1
  182. package/dist/payout/payout.schema.js +58 -112
  183. package/dist/product/index.d.ts +8 -5
  184. package/dist/product/index.d.ts.map +1 -0
  185. package/dist/product/index.js +249 -5
  186. package/dist/product/product.enum.d.ts +1 -6
  187. package/dist/product/product.enum.d.ts.map +1 -1
  188. package/dist/product/product.enum.js +12 -16
  189. package/dist/product/product.event.d.ts +63 -69
  190. package/dist/product/product.event.d.ts.map +1 -1
  191. package/dist/product/product.event.js +68 -113
  192. package/dist/product/product.operations.d.ts +225 -231
  193. package/dist/product/product.operations.d.ts.map +1 -1
  194. package/dist/product/product.operations.js +168 -104
  195. package/dist/product/product.presentation.d.ts +3 -8
  196. package/dist/product/product.presentation.d.ts.map +1 -1
  197. package/dist/product/product.presentation.js +154 -81
  198. package/dist/product/product.schema.d.ts +196 -201
  199. package/dist/product/product.schema.d.ts.map +1 -1
  200. package/dist/product/product.schema.js +80 -171
  201. package/dist/review/index.d.ts +8 -5
  202. package/dist/review/index.d.ts.map +1 -0
  203. package/dist/review/index.js +206 -5
  204. package/dist/review/review.enum.d.ts +1 -6
  205. package/dist/review/review.enum.d.ts.map +1 -1
  206. package/dist/review/review.enum.js +10 -14
  207. package/dist/review/review.event.d.ts +46 -52
  208. package/dist/review/review.event.d.ts.map +1 -1
  209. package/dist/review/review.event.js +46 -79
  210. package/dist/review/review.operations.d.ts +190 -196
  211. package/dist/review/review.operations.d.ts.map +1 -1
  212. package/dist/review/review.operations.js +149 -102
  213. package/dist/review/review.presentation.d.ts +2 -7
  214. package/dist/review/review.presentation.d.ts.map +1 -1
  215. package/dist/review/review.presentation.js +120 -56
  216. package/dist/review/review.schema.d.ts +164 -169
  217. package/dist/review/review.schema.d.ts.map +1 -1
  218. package/dist/review/review.schema.js +70 -151
  219. package/dist/seeders/index.d.ts +4 -8
  220. package/dist/seeders/index.d.ts.map +1 -1
  221. package/dist/seeders/index.js +11 -16
  222. package/dist/store/index.d.ts +8 -5
  223. package/dist/store/index.d.ts.map +1 -0
  224. package/dist/store/index.js +142 -5
  225. package/dist/store/store.enum.d.ts +1 -6
  226. package/dist/store/store.enum.d.ts.map +1 -1
  227. package/dist/store/store.enum.js +10 -14
  228. package/dist/store/store.event.d.ts +42 -48
  229. package/dist/store/store.event.d.ts.map +1 -1
  230. package/dist/store/store.event.js +48 -75
  231. package/dist/store/store.operations.d.ts +98 -104
  232. package/dist/store/store.operations.d.ts.map +1 -1
  233. package/dist/store/store.operations.js +86 -58
  234. package/dist/store/store.presentation.d.ts +2 -7
  235. package/dist/store/store.presentation.d.ts.map +1 -1
  236. package/dist/store/store.presentation.js +91 -56
  237. package/dist/store/store.schema.d.ts +70 -75
  238. package/dist/store/store.schema.d.ts.map +1 -1
  239. package/dist/store/store.schema.js +41 -90
  240. package/dist/tests/operations.test-spec.d.ts +5 -10
  241. package/dist/tests/operations.test-spec.d.ts.map +1 -1
  242. package/dist/tests/operations.test-spec.js +134 -146
  243. package/dist/ui/MarketplaceDashboard.d.ts +1 -6
  244. package/dist/ui/MarketplaceDashboard.d.ts.map +1 -1
  245. package/dist/ui/MarketplaceDashboard.js +413 -313
  246. package/dist/ui/hooks/index.d.ts +2 -2
  247. package/dist/ui/hooks/index.d.ts.map +1 -0
  248. package/dist/ui/hooks/index.js +59 -4
  249. package/dist/ui/hooks/useMarketplaceData.d.ts +16 -20
  250. package/dist/ui/hooks/useMarketplaceData.d.ts.map +1 -1
  251. package/dist/ui/hooks/useMarketplaceData.js +53 -60
  252. package/dist/ui/index.d.ts +7 -6
  253. package/dist/ui/index.d.ts.map +1 -0
  254. package/dist/ui/index.js +668 -5
  255. package/dist/ui/renderers/index.d.ts +2 -2
  256. package/dist/ui/renderers/index.d.ts.map +1 -0
  257. package/dist/ui/renderers/index.js +249 -3
  258. package/dist/ui/renderers/marketplace.markdown.d.ts +13 -14
  259. package/dist/ui/renderers/marketplace.markdown.d.ts.map +1 -1
  260. package/dist/ui/renderers/marketplace.markdown.js +241 -236
  261. package/package.json +528 -109
  262. package/dist/docs/marketplace.docblock.js.map +0 -1
  263. package/dist/entities/index.js.map +0 -1
  264. package/dist/entities/order.js.map +0 -1
  265. package/dist/entities/payout.js.map +0 -1
  266. package/dist/entities/product.js.map +0 -1
  267. package/dist/entities/review.js.map +0 -1
  268. package/dist/entities/store.js.map +0 -1
  269. package/dist/example.js.map +0 -1
  270. package/dist/handlers/marketplace.handlers.js.map +0 -1
  271. package/dist/marketplace.capability.js.map +0 -1
  272. package/dist/marketplace.feature.js.map +0 -1
  273. package/dist/order/order.enum.js.map +0 -1
  274. package/dist/order/order.event.js.map +0 -1
  275. package/dist/order/order.operations.js.map +0 -1
  276. package/dist/order/order.presentation.js.map +0 -1
  277. package/dist/order/order.schema.js.map +0 -1
  278. package/dist/payout/payout.enum.js.map +0 -1
  279. package/dist/payout/payout.event.js.map +0 -1
  280. package/dist/payout/payout.operations.js.map +0 -1
  281. package/dist/payout/payout.presentation.js.map +0 -1
  282. package/dist/payout/payout.schema.js.map +0 -1
  283. package/dist/product/product.enum.js.map +0 -1
  284. package/dist/product/product.event.js.map +0 -1
  285. package/dist/product/product.operations.js.map +0 -1
  286. package/dist/product/product.presentation.js.map +0 -1
  287. package/dist/product/product.schema.js.map +0 -1
  288. package/dist/review/review.enum.js.map +0 -1
  289. package/dist/review/review.event.js.map +0 -1
  290. package/dist/review/review.operations.js.map +0 -1
  291. package/dist/review/review.presentation.js.map +0 -1
  292. package/dist/review/review.schema.js.map +0 -1
  293. package/dist/seeders/index.js.map +0 -1
  294. package/dist/store/store.enum.js.map +0 -1
  295. package/dist/store/store.event.js.map +0 -1
  296. package/dist/store/store.operations.js.map +0 -1
  297. package/dist/store/store.presentation.js.map +0 -1
  298. package/dist/store/store.schema.js.map +0 -1
  299. package/dist/tests/operations.test-spec.js.map +0 -1
  300. package/dist/ui/MarketplaceDashboard.js.map +0 -1
  301. package/dist/ui/hooks/useMarketplaceData.js.map +0 -1
  302. package/dist/ui/renderers/marketplace.markdown.js.map +0 -1
@@ -1,319 +1,419 @@
1
- 'use client';
2
-
3
- import { useMarketplaceData } from "./hooks/useMarketplaceData.js";
4
- import { useState } from "react";
5
- import { Button, ErrorState, LoaderBlock, StatCard, StatCardGroup } from "@contractspec/lib.design-system";
6
- import { jsx, jsxs } from "react/jsx-runtime";
1
+ // @bun
2
+ // src/ui/hooks/useMarketplaceData.ts
3
+ import { useCallback, useEffect, useState } from "react";
4
+ import { useTemplateRuntime } from "@contractspec/lib.example-shared-ui";
5
+ "use client";
6
+ function useMarketplaceData(projectId = "local-project") {
7
+ const { handlers } = useTemplateRuntime();
8
+ const marketplace = handlers.marketplace;
9
+ const [stores, setStores] = useState([]);
10
+ const [products, setProducts] = useState([]);
11
+ const [orders, setOrders] = useState([]);
12
+ const [loading, setLoading] = useState(true);
13
+ const [error, setError] = useState(null);
14
+ const [totalRevenue, setTotalRevenue] = useState(0);
15
+ const fetchData = useCallback(async () => {
16
+ try {
17
+ setLoading(true);
18
+ setError(null);
19
+ const [storeResult, productResult, orderResult] = await Promise.all([
20
+ marketplace.listStores({ projectId, limit: 100 }),
21
+ marketplace.listProducts({ limit: 100 }),
22
+ marketplace.listOrders({ projectId, limit: 100 })
23
+ ]);
24
+ setStores(storeResult.stores);
25
+ setProducts(productResult.products);
26
+ setOrders(orderResult.orders);
27
+ setTotalRevenue(orderResult.totalRevenue);
28
+ } catch (err) {
29
+ setError(err instanceof Error ? err : new Error("Failed to load marketplace"));
30
+ } finally {
31
+ setLoading(false);
32
+ }
33
+ }, [marketplace, projectId]);
34
+ useEffect(() => {
35
+ fetchData();
36
+ }, [fetchData]);
37
+ const stats = {
38
+ totalStores: stores.length,
39
+ activeStores: stores.filter((s) => s.status === "ACTIVE").length,
40
+ totalProducts: products.length,
41
+ totalOrders: orders.length,
42
+ totalRevenue,
43
+ pendingOrders: orders.filter((o) => o.status === "PENDING").length
44
+ };
45
+ return {
46
+ stores,
47
+ products,
48
+ orders,
49
+ loading,
50
+ error,
51
+ stats,
52
+ refetch: fetchData
53
+ };
54
+ }
7
55
 
8
- //#region src/ui/MarketplaceDashboard.tsx
9
- /**
10
- * Marketplace Dashboard
11
- *
12
- * Interactive dashboard for the marketplace template.
13
- * Displays stores, products, and orders with stats.
14
- */
15
- const STATUS_COLORS = {
16
- ACTIVE: "bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400",
17
- PENDING: "bg-yellow-100 text-yellow-700 dark:bg-yellow-900/30 dark:text-yellow-400",
18
- SUSPENDED: "bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-400",
19
- DRAFT: "bg-gray-100 text-gray-700 dark:bg-gray-900/30 dark:text-gray-400",
20
- OUT_OF_STOCK: "bg-orange-100 text-orange-700 dark:bg-orange-900/30 dark:text-orange-400",
21
- ARCHIVED: "bg-gray-100 text-gray-700 dark:bg-gray-900/30 dark:text-gray-400",
22
- CONFIRMED: "bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",
23
- PROCESSING: "bg-indigo-100 text-indigo-700 dark:bg-indigo-900/30 dark:text-indigo-400",
24
- SHIPPED: "bg-purple-100 text-purple-700 dark:bg-purple-900/30 dark:text-purple-400",
25
- DELIVERED: "bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400",
26
- CANCELLED: "bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-400"
56
+ // src/ui/MarketplaceDashboard.tsx
57
+ import { useState as useState2 } from "react";
58
+ import {
59
+ Button,
60
+ ErrorState,
61
+ LoaderBlock,
62
+ StatCard,
63
+ StatCardGroup
64
+ } from "@contractspec/lib.design-system";
65
+ import { jsxDEV } from "react/jsx-dev-runtime";
66
+ "use client";
67
+ var STATUS_COLORS = {
68
+ ACTIVE: "bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400",
69
+ PENDING: "bg-yellow-100 text-yellow-700 dark:bg-yellow-900/30 dark:text-yellow-400",
70
+ SUSPENDED: "bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-400",
71
+ DRAFT: "bg-gray-100 text-gray-700 dark:bg-gray-900/30 dark:text-gray-400",
72
+ OUT_OF_STOCK: "bg-orange-100 text-orange-700 dark:bg-orange-900/30 dark:text-orange-400",
73
+ ARCHIVED: "bg-gray-100 text-gray-700 dark:bg-gray-900/30 dark:text-gray-400",
74
+ CONFIRMED: "bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",
75
+ PROCESSING: "bg-indigo-100 text-indigo-700 dark:bg-indigo-900/30 dark:text-indigo-400",
76
+ SHIPPED: "bg-purple-100 text-purple-700 dark:bg-purple-900/30 dark:text-purple-400",
77
+ DELIVERED: "bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400",
78
+ CANCELLED: "bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-400"
27
79
  };
28
80
  function formatCurrency(value, currency = "USD") {
29
- return new Intl.NumberFormat("en-US", {
30
- style: "currency",
31
- currency,
32
- minimumFractionDigits: 0,
33
- maximumFractionDigits: 2
34
- }).format(value);
81
+ return new Intl.NumberFormat("en-US", {
82
+ style: "currency",
83
+ currency,
84
+ minimumFractionDigits: 0,
85
+ maximumFractionDigits: 2
86
+ }).format(value);
35
87
  }
36
88
  function MarketplaceDashboard() {
37
- const [activeTab, setActiveTab] = useState("stores");
38
- const { stores, products, orders, loading, error, stats, refetch } = useMarketplaceData();
39
- const tabs = [
40
- {
41
- id: "stores",
42
- label: "Stores",
43
- icon: "🏪"
44
- },
45
- {
46
- id: "products",
47
- label: "Products",
48
- icon: "📦"
49
- },
50
- {
51
- id: "orders",
52
- label: "Orders",
53
- icon: "🛒"
54
- }
55
- ];
56
- if (loading) return /* @__PURE__ */ jsx(LoaderBlock, { label: "Loading Marketplace..." });
57
- if (error) return /* @__PURE__ */ jsx(ErrorState, {
58
- title: "Failed to load Marketplace",
59
- description: error.message,
60
- onRetry: refetch,
61
- retryLabel: "Retry"
62
- });
63
- return /* @__PURE__ */ jsxs("div", {
64
- className: "space-y-6",
65
- children: [
66
- /* @__PURE__ */ jsxs("div", {
67
- className: "flex items-center justify-between",
68
- children: [/* @__PURE__ */ jsx("h2", {
69
- className: "text-2xl font-bold",
70
- children: "Marketplace"
71
- }), /* @__PURE__ */ jsxs(Button, {
72
- onClick: () => alert("Create store modal"),
73
- children: [/* @__PURE__ */ jsx("span", {
74
- className: "mr-2",
75
- children: "+"
76
- }), " New Store"]
77
- })]
78
- }),
79
- /* @__PURE__ */ jsxs(StatCardGroup, { children: [
80
- /* @__PURE__ */ jsx(StatCard, {
81
- label: "Stores",
82
- value: stats.totalStores,
83
- hint: `${stats.activeStores} active`
84
- }),
85
- /* @__PURE__ */ jsx(StatCard, {
86
- label: "Products",
87
- value: stats.totalProducts,
88
- hint: "listed"
89
- }),
90
- /* @__PURE__ */ jsx(StatCard, {
91
- label: "Orders",
92
- value: stats.totalOrders,
93
- hint: `${stats.pendingOrders} pending`
94
- }),
95
- /* @__PURE__ */ jsx(StatCard, {
96
- label: "Revenue",
97
- value: formatCurrency(stats.totalRevenue),
98
- hint: "total"
99
- })
100
- ] }),
101
- /* @__PURE__ */ jsx("nav", {
102
- className: "bg-muted flex gap-1 rounded-lg p-1",
103
- role: "tablist",
104
- children: tabs.map((tab) => /* @__PURE__ */ jsxs(Button, {
105
- type: "button",
106
- role: "tab",
107
- "aria-selected": activeTab === tab.id,
108
- onClick: () => setActiveTab(tab.id),
109
- className: `flex flex-1 items-center justify-center gap-2 rounded-md px-4 py-2 text-sm font-medium transition-colors ${activeTab === tab.id ? "bg-background text-foreground shadow-sm" : "text-muted-foreground hover:text-foreground"}`,
110
- children: [/* @__PURE__ */ jsx("span", { children: tab.icon }), tab.label]
111
- }, tab.id))
112
- }),
113
- /* @__PURE__ */ jsxs("div", {
114
- className: "min-h-[400px]",
115
- role: "tabpanel",
116
- children: [
117
- activeTab === "stores" && /* @__PURE__ */ jsx("div", {
118
- className: "border-border rounded-lg border",
119
- children: /* @__PURE__ */ jsxs("table", {
120
- className: "w-full",
121
- children: [/* @__PURE__ */ jsx("thead", {
122
- className: "border-border bg-muted/30 border-b",
123
- children: /* @__PURE__ */ jsxs("tr", { children: [
124
- /* @__PURE__ */ jsx("th", {
125
- className: "px-4 py-3 text-left text-sm font-medium",
126
- children: "Store"
127
- }),
128
- /* @__PURE__ */ jsx("th", {
129
- className: "px-4 py-3 text-left text-sm font-medium",
130
- children: "Status"
131
- }),
132
- /* @__PURE__ */ jsx("th", {
133
- className: "px-4 py-3 text-left text-sm font-medium",
134
- children: "Rating"
135
- }),
136
- /* @__PURE__ */ jsx("th", {
137
- className: "px-4 py-3 text-left text-sm font-medium",
138
- children: "Reviews"
139
- })
140
- ] })
141
- }), /* @__PURE__ */ jsxs("tbody", {
142
- className: "divide-border divide-y",
143
- children: [stores.map((store) => /* @__PURE__ */ jsxs("tr", {
144
- className: "hover:bg-muted/50",
145
- children: [
146
- /* @__PURE__ */ jsxs("td", {
147
- className: "px-4 py-3",
148
- children: [/* @__PURE__ */ jsx("div", {
149
- className: "font-medium",
150
- children: store.name
151
- }), /* @__PURE__ */ jsx("div", {
152
- className: "text-muted-foreground text-sm",
153
- children: store.description
154
- })]
155
- }),
156
- /* @__PURE__ */ jsx("td", {
157
- className: "px-4 py-3",
158
- children: /* @__PURE__ */ jsx("span", {
159
- className: `inline-flex rounded-full px-2 py-0.5 text-xs font-medium ${STATUS_COLORS[store.status] ?? ""}`,
160
- children: store.status
161
- })
162
- }),
163
- /* @__PURE__ */ jsx("td", {
164
- className: "px-4 py-3",
165
- children: /* @__PURE__ */ jsxs("span", {
166
- className: "flex items-center gap-1",
167
- children: ["⭐ ", store.rating.toFixed(1)]
168
- })
169
- }),
170
- /* @__PURE__ */ jsxs("td", {
171
- className: "text-muted-foreground px-4 py-3 text-sm",
172
- children: [store.reviewCount, " reviews"]
173
- })
174
- ]
175
- }, store.id)), stores.length === 0 && /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", {
176
- colSpan: 4,
177
- className: "text-muted-foreground px-4 py-8 text-center",
178
- children: "No stores found"
179
- }) })]
180
- })]
181
- })
182
- }),
183
- activeTab === "products" && /* @__PURE__ */ jsx("div", {
184
- className: "border-border rounded-lg border",
185
- children: /* @__PURE__ */ jsxs("table", {
186
- className: "w-full",
187
- children: [/* @__PURE__ */ jsx("thead", {
188
- className: "border-border bg-muted/30 border-b",
189
- children: /* @__PURE__ */ jsxs("tr", { children: [
190
- /* @__PURE__ */ jsx("th", {
191
- className: "px-4 py-3 text-left text-sm font-medium",
192
- children: "Product"
193
- }),
194
- /* @__PURE__ */ jsx("th", {
195
- className: "px-4 py-3 text-left text-sm font-medium",
196
- children: "Price"
197
- }),
198
- /* @__PURE__ */ jsx("th", {
199
- className: "px-4 py-3 text-left text-sm font-medium",
200
- children: "Stock"
201
- }),
202
- /* @__PURE__ */ jsx("th", {
203
- className: "px-4 py-3 text-left text-sm font-medium",
204
- children: "Status"
205
- })
206
- ] })
207
- }), /* @__PURE__ */ jsxs("tbody", {
208
- className: "divide-border divide-y",
209
- children: [products.map((product) => /* @__PURE__ */ jsxs("tr", {
210
- className: "hover:bg-muted/50",
211
- children: [
212
- /* @__PURE__ */ jsxs("td", {
213
- className: "px-4 py-3",
214
- children: [/* @__PURE__ */ jsx("div", {
215
- className: "font-medium",
216
- children: product.name
217
- }), /* @__PURE__ */ jsx("div", {
218
- className: "text-muted-foreground text-sm",
219
- children: product.category
220
- })]
221
- }),
222
- /* @__PURE__ */ jsx("td", {
223
- className: "px-4 py-3 font-mono",
224
- children: formatCurrency(product.price, product.currency)
225
- }),
226
- /* @__PURE__ */ jsx("td", {
227
- className: "px-4 py-3",
228
- children: product.stock
229
- }),
230
- /* @__PURE__ */ jsx("td", {
231
- className: "px-4 py-3",
232
- children: /* @__PURE__ */ jsx("span", {
233
- className: `inline-flex rounded-full px-2 py-0.5 text-xs font-medium ${STATUS_COLORS[product.status] ?? ""}`,
234
- children: product.status
235
- })
236
- })
237
- ]
238
- }, product.id)), products.length === 0 && /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", {
239
- colSpan: 4,
240
- className: "text-muted-foreground px-4 py-8 text-center",
241
- children: "No products found"
242
- }) })]
243
- })]
244
- })
245
- }),
246
- activeTab === "orders" && /* @__PURE__ */ jsx("div", {
247
- className: "border-border rounded-lg border",
248
- children: /* @__PURE__ */ jsxs("table", {
249
- className: "w-full",
250
- children: [/* @__PURE__ */ jsx("thead", {
251
- className: "border-border bg-muted/30 border-b",
252
- children: /* @__PURE__ */ jsxs("tr", { children: [
253
- /* @__PURE__ */ jsx("th", {
254
- className: "px-4 py-3 text-left text-sm font-medium",
255
- children: "Order ID"
256
- }),
257
- /* @__PURE__ */ jsx("th", {
258
- className: "px-4 py-3 text-left text-sm font-medium",
259
- children: "Customer"
260
- }),
261
- /* @__PURE__ */ jsx("th", {
262
- className: "px-4 py-3 text-left text-sm font-medium",
263
- children: "Total"
264
- }),
265
- /* @__PURE__ */ jsx("th", {
266
- className: "px-4 py-3 text-left text-sm font-medium",
267
- children: "Status"
268
- }),
269
- /* @__PURE__ */ jsx("th", {
270
- className: "px-4 py-3 text-left text-sm font-medium",
271
- children: "Date"
272
- })
273
- ] })
274
- }), /* @__PURE__ */ jsxs("tbody", {
275
- className: "divide-border divide-y",
276
- children: [orders.map((order) => /* @__PURE__ */ jsxs("tr", {
277
- className: "hover:bg-muted/50",
278
- children: [
279
- /* @__PURE__ */ jsx("td", {
280
- className: "px-4 py-3 font-mono text-sm",
281
- children: order.id
282
- }),
283
- /* @__PURE__ */ jsx("td", {
284
- className: "px-4 py-3 text-sm",
285
- children: order.customerId
286
- }),
287
- /* @__PURE__ */ jsx("td", {
288
- className: "px-4 py-3 font-mono",
289
- children: formatCurrency(order.total, order.currency)
290
- }),
291
- /* @__PURE__ */ jsx("td", {
292
- className: "px-4 py-3",
293
- children: /* @__PURE__ */ jsx("span", {
294
- className: `inline-flex rounded-full px-2 py-0.5 text-xs font-medium ${STATUS_COLORS[order.status] ?? ""}`,
295
- children: order.status
296
- })
297
- }),
298
- /* @__PURE__ */ jsx("td", {
299
- className: "text-muted-foreground px-4 py-3 text-sm",
300
- children: order.createdAt.toLocaleDateString()
301
- })
302
- ]
303
- }, order.id)), orders.length === 0 && /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", {
304
- colSpan: 5,
305
- className: "text-muted-foreground px-4 py-8 text-center",
306
- children: "No orders found"
307
- }) })]
308
- })]
309
- })
310
- })
311
- ]
312
- })
313
- ]
314
- });
89
+ const [activeTab, setActiveTab] = useState2("stores");
90
+ const { stores, products, orders, loading, error, stats, refetch } = useMarketplaceData();
91
+ const tabs = [
92
+ { id: "stores", label: "Stores", icon: "\uD83C\uDFEA" },
93
+ { id: "products", label: "Products", icon: "\uD83D\uDCE6" },
94
+ { id: "orders", label: "Orders", icon: "\uD83D\uDED2" }
95
+ ];
96
+ if (loading) {
97
+ return /* @__PURE__ */ jsxDEV(LoaderBlock, {
98
+ label: "Loading Marketplace..."
99
+ }, undefined, false, undefined, this);
100
+ }
101
+ if (error) {
102
+ return /* @__PURE__ */ jsxDEV(ErrorState, {
103
+ title: "Failed to load Marketplace",
104
+ description: error.message,
105
+ onRetry: refetch,
106
+ retryLabel: "Retry"
107
+ }, undefined, false, undefined, this);
108
+ }
109
+ return /* @__PURE__ */ jsxDEV("div", {
110
+ className: "space-y-6",
111
+ children: [
112
+ /* @__PURE__ */ jsxDEV("div", {
113
+ className: "flex items-center justify-between",
114
+ children: [
115
+ /* @__PURE__ */ jsxDEV("h2", {
116
+ className: "text-2xl font-bold",
117
+ children: "Marketplace"
118
+ }, undefined, false, undefined, this),
119
+ /* @__PURE__ */ jsxDEV(Button, {
120
+ onClick: () => alert("Create store modal"),
121
+ children: [
122
+ /* @__PURE__ */ jsxDEV("span", {
123
+ className: "mr-2",
124
+ children: "+"
125
+ }, undefined, false, undefined, this),
126
+ " New Store"
127
+ ]
128
+ }, undefined, true, undefined, this)
129
+ ]
130
+ }, undefined, true, undefined, this),
131
+ /* @__PURE__ */ jsxDEV(StatCardGroup, {
132
+ children: [
133
+ /* @__PURE__ */ jsxDEV(StatCard, {
134
+ label: "Stores",
135
+ value: stats.totalStores,
136
+ hint: `${stats.activeStores} active`
137
+ }, undefined, false, undefined, this),
138
+ /* @__PURE__ */ jsxDEV(StatCard, {
139
+ label: "Products",
140
+ value: stats.totalProducts,
141
+ hint: "listed"
142
+ }, undefined, false, undefined, this),
143
+ /* @__PURE__ */ jsxDEV(StatCard, {
144
+ label: "Orders",
145
+ value: stats.totalOrders,
146
+ hint: `${stats.pendingOrders} pending`
147
+ }, undefined, false, undefined, this),
148
+ /* @__PURE__ */ jsxDEV(StatCard, {
149
+ label: "Revenue",
150
+ value: formatCurrency(stats.totalRevenue),
151
+ hint: "total"
152
+ }, undefined, false, undefined, this)
153
+ ]
154
+ }, undefined, true, undefined, this),
155
+ /* @__PURE__ */ jsxDEV("nav", {
156
+ className: "bg-muted flex gap-1 rounded-lg p-1",
157
+ role: "tablist",
158
+ children: tabs.map((tab) => /* @__PURE__ */ jsxDEV(Button, {
159
+ type: "button",
160
+ role: "tab",
161
+ "aria-selected": activeTab === tab.id,
162
+ onClick: () => setActiveTab(tab.id),
163
+ className: `flex flex-1 items-center justify-center gap-2 rounded-md px-4 py-2 text-sm font-medium transition-colors ${activeTab === tab.id ? "bg-background text-foreground shadow-sm" : "text-muted-foreground hover:text-foreground"}`,
164
+ children: [
165
+ /* @__PURE__ */ jsxDEV("span", {
166
+ children: tab.icon
167
+ }, undefined, false, undefined, this),
168
+ tab.label
169
+ ]
170
+ }, tab.id, true, undefined, this))
171
+ }, undefined, false, undefined, this),
172
+ /* @__PURE__ */ jsxDEV("div", {
173
+ className: "min-h-[400px]",
174
+ role: "tabpanel",
175
+ children: [
176
+ activeTab === "stores" && /* @__PURE__ */ jsxDEV("div", {
177
+ className: "border-border rounded-lg border",
178
+ children: /* @__PURE__ */ jsxDEV("table", {
179
+ className: "w-full",
180
+ children: [
181
+ /* @__PURE__ */ jsxDEV("thead", {
182
+ className: "border-border bg-muted/30 border-b",
183
+ children: /* @__PURE__ */ jsxDEV("tr", {
184
+ children: [
185
+ /* @__PURE__ */ jsxDEV("th", {
186
+ className: "px-4 py-3 text-left text-sm font-medium",
187
+ children: "Store"
188
+ }, undefined, false, undefined, this),
189
+ /* @__PURE__ */ jsxDEV("th", {
190
+ className: "px-4 py-3 text-left text-sm font-medium",
191
+ children: "Status"
192
+ }, undefined, false, undefined, this),
193
+ /* @__PURE__ */ jsxDEV("th", {
194
+ className: "px-4 py-3 text-left text-sm font-medium",
195
+ children: "Rating"
196
+ }, undefined, false, undefined, this),
197
+ /* @__PURE__ */ jsxDEV("th", {
198
+ className: "px-4 py-3 text-left text-sm font-medium",
199
+ children: "Reviews"
200
+ }, undefined, false, undefined, this)
201
+ ]
202
+ }, undefined, true, undefined, this)
203
+ }, undefined, false, undefined, this),
204
+ /* @__PURE__ */ jsxDEV("tbody", {
205
+ className: "divide-border divide-y",
206
+ children: [
207
+ stores.map((store) => /* @__PURE__ */ jsxDEV("tr", {
208
+ className: "hover:bg-muted/50",
209
+ children: [
210
+ /* @__PURE__ */ jsxDEV("td", {
211
+ className: "px-4 py-3",
212
+ children: [
213
+ /* @__PURE__ */ jsxDEV("div", {
214
+ className: "font-medium",
215
+ children: store.name
216
+ }, undefined, false, undefined, this),
217
+ /* @__PURE__ */ jsxDEV("div", {
218
+ className: "text-muted-foreground text-sm",
219
+ children: store.description
220
+ }, undefined, false, undefined, this)
221
+ ]
222
+ }, undefined, true, undefined, this),
223
+ /* @__PURE__ */ jsxDEV("td", {
224
+ className: "px-4 py-3",
225
+ children: /* @__PURE__ */ jsxDEV("span", {
226
+ className: `inline-flex rounded-full px-2 py-0.5 text-xs font-medium ${STATUS_COLORS[store.status] ?? ""}`,
227
+ children: store.status
228
+ }, undefined, false, undefined, this)
229
+ }, undefined, false, undefined, this),
230
+ /* @__PURE__ */ jsxDEV("td", {
231
+ className: "px-4 py-3",
232
+ children: /* @__PURE__ */ jsxDEV("span", {
233
+ className: "flex items-center gap-1",
234
+ children: [
235
+ "\u2B50 ",
236
+ store.rating.toFixed(1)
237
+ ]
238
+ }, undefined, true, undefined, this)
239
+ }, undefined, false, undefined, this),
240
+ /* @__PURE__ */ jsxDEV("td", {
241
+ className: "text-muted-foreground px-4 py-3 text-sm",
242
+ children: [
243
+ store.reviewCount,
244
+ " reviews"
245
+ ]
246
+ }, undefined, true, undefined, this)
247
+ ]
248
+ }, store.id, true, undefined, this)),
249
+ stores.length === 0 && /* @__PURE__ */ jsxDEV("tr", {
250
+ children: /* @__PURE__ */ jsxDEV("td", {
251
+ colSpan: 4,
252
+ className: "text-muted-foreground px-4 py-8 text-center",
253
+ children: "No stores found"
254
+ }, undefined, false, undefined, this)
255
+ }, undefined, false, undefined, this)
256
+ ]
257
+ }, undefined, true, undefined, this)
258
+ ]
259
+ }, undefined, true, undefined, this)
260
+ }, undefined, false, undefined, this),
261
+ activeTab === "products" && /* @__PURE__ */ jsxDEV("div", {
262
+ className: "border-border rounded-lg border",
263
+ children: /* @__PURE__ */ jsxDEV("table", {
264
+ className: "w-full",
265
+ children: [
266
+ /* @__PURE__ */ jsxDEV("thead", {
267
+ className: "border-border bg-muted/30 border-b",
268
+ children: /* @__PURE__ */ jsxDEV("tr", {
269
+ children: [
270
+ /* @__PURE__ */ jsxDEV("th", {
271
+ className: "px-4 py-3 text-left text-sm font-medium",
272
+ children: "Product"
273
+ }, undefined, false, undefined, this),
274
+ /* @__PURE__ */ jsxDEV("th", {
275
+ className: "px-4 py-3 text-left text-sm font-medium",
276
+ children: "Price"
277
+ }, undefined, false, undefined, this),
278
+ /* @__PURE__ */ jsxDEV("th", {
279
+ className: "px-4 py-3 text-left text-sm font-medium",
280
+ children: "Stock"
281
+ }, undefined, false, undefined, this),
282
+ /* @__PURE__ */ jsxDEV("th", {
283
+ className: "px-4 py-3 text-left text-sm font-medium",
284
+ children: "Status"
285
+ }, undefined, false, undefined, this)
286
+ ]
287
+ }, undefined, true, undefined, this)
288
+ }, undefined, false, undefined, this),
289
+ /* @__PURE__ */ jsxDEV("tbody", {
290
+ className: "divide-border divide-y",
291
+ children: [
292
+ products.map((product) => /* @__PURE__ */ jsxDEV("tr", {
293
+ className: "hover:bg-muted/50",
294
+ children: [
295
+ /* @__PURE__ */ jsxDEV("td", {
296
+ className: "px-4 py-3",
297
+ children: [
298
+ /* @__PURE__ */ jsxDEV("div", {
299
+ className: "font-medium",
300
+ children: product.name
301
+ }, undefined, false, undefined, this),
302
+ /* @__PURE__ */ jsxDEV("div", {
303
+ className: "text-muted-foreground text-sm",
304
+ children: product.category
305
+ }, undefined, false, undefined, this)
306
+ ]
307
+ }, undefined, true, undefined, this),
308
+ /* @__PURE__ */ jsxDEV("td", {
309
+ className: "px-4 py-3 font-mono",
310
+ children: formatCurrency(product.price, product.currency)
311
+ }, undefined, false, undefined, this),
312
+ /* @__PURE__ */ jsxDEV("td", {
313
+ className: "px-4 py-3",
314
+ children: product.stock
315
+ }, undefined, false, undefined, this),
316
+ /* @__PURE__ */ jsxDEV("td", {
317
+ className: "px-4 py-3",
318
+ children: /* @__PURE__ */ jsxDEV("span", {
319
+ className: `inline-flex rounded-full px-2 py-0.5 text-xs font-medium ${STATUS_COLORS[product.status] ?? ""}`,
320
+ children: product.status
321
+ }, undefined, false, undefined, this)
322
+ }, undefined, false, undefined, this)
323
+ ]
324
+ }, product.id, true, undefined, this)),
325
+ products.length === 0 && /* @__PURE__ */ jsxDEV("tr", {
326
+ children: /* @__PURE__ */ jsxDEV("td", {
327
+ colSpan: 4,
328
+ className: "text-muted-foreground px-4 py-8 text-center",
329
+ children: "No products found"
330
+ }, undefined, false, undefined, this)
331
+ }, undefined, false, undefined, this)
332
+ ]
333
+ }, undefined, true, undefined, this)
334
+ ]
335
+ }, undefined, true, undefined, this)
336
+ }, undefined, false, undefined, this),
337
+ activeTab === "orders" && /* @__PURE__ */ jsxDEV("div", {
338
+ className: "border-border rounded-lg border",
339
+ children: /* @__PURE__ */ jsxDEV("table", {
340
+ className: "w-full",
341
+ children: [
342
+ /* @__PURE__ */ jsxDEV("thead", {
343
+ className: "border-border bg-muted/30 border-b",
344
+ children: /* @__PURE__ */ jsxDEV("tr", {
345
+ children: [
346
+ /* @__PURE__ */ jsxDEV("th", {
347
+ className: "px-4 py-3 text-left text-sm font-medium",
348
+ children: "Order ID"
349
+ }, undefined, false, undefined, this),
350
+ /* @__PURE__ */ jsxDEV("th", {
351
+ className: "px-4 py-3 text-left text-sm font-medium",
352
+ children: "Customer"
353
+ }, undefined, false, undefined, this),
354
+ /* @__PURE__ */ jsxDEV("th", {
355
+ className: "px-4 py-3 text-left text-sm font-medium",
356
+ children: "Total"
357
+ }, undefined, false, undefined, this),
358
+ /* @__PURE__ */ jsxDEV("th", {
359
+ className: "px-4 py-3 text-left text-sm font-medium",
360
+ children: "Status"
361
+ }, undefined, false, undefined, this),
362
+ /* @__PURE__ */ jsxDEV("th", {
363
+ className: "px-4 py-3 text-left text-sm font-medium",
364
+ children: "Date"
365
+ }, undefined, false, undefined, this)
366
+ ]
367
+ }, undefined, true, undefined, this)
368
+ }, undefined, false, undefined, this),
369
+ /* @__PURE__ */ jsxDEV("tbody", {
370
+ className: "divide-border divide-y",
371
+ children: [
372
+ orders.map((order) => /* @__PURE__ */ jsxDEV("tr", {
373
+ className: "hover:bg-muted/50",
374
+ children: [
375
+ /* @__PURE__ */ jsxDEV("td", {
376
+ className: "px-4 py-3 font-mono text-sm",
377
+ children: order.id
378
+ }, undefined, false, undefined, this),
379
+ /* @__PURE__ */ jsxDEV("td", {
380
+ className: "px-4 py-3 text-sm",
381
+ children: order.customerId
382
+ }, undefined, false, undefined, this),
383
+ /* @__PURE__ */ jsxDEV("td", {
384
+ className: "px-4 py-3 font-mono",
385
+ children: formatCurrency(order.total, order.currency)
386
+ }, undefined, false, undefined, this),
387
+ /* @__PURE__ */ jsxDEV("td", {
388
+ className: "px-4 py-3",
389
+ children: /* @__PURE__ */ jsxDEV("span", {
390
+ className: `inline-flex rounded-full px-2 py-0.5 text-xs font-medium ${STATUS_COLORS[order.status] ?? ""}`,
391
+ children: order.status
392
+ }, undefined, false, undefined, this)
393
+ }, undefined, false, undefined, this),
394
+ /* @__PURE__ */ jsxDEV("td", {
395
+ className: "text-muted-foreground px-4 py-3 text-sm",
396
+ children: order.createdAt.toLocaleDateString()
397
+ }, undefined, false, undefined, this)
398
+ ]
399
+ }, order.id, true, undefined, this)),
400
+ orders.length === 0 && /* @__PURE__ */ jsxDEV("tr", {
401
+ children: /* @__PURE__ */ jsxDEV("td", {
402
+ colSpan: 5,
403
+ className: "text-muted-foreground px-4 py-8 text-center",
404
+ children: "No orders found"
405
+ }, undefined, false, undefined, this)
406
+ }, undefined, false, undefined, this)
407
+ ]
408
+ }, undefined, true, undefined, this)
409
+ ]
410
+ }, undefined, true, undefined, this)
411
+ }, undefined, false, undefined, this)
412
+ ]
413
+ }, undefined, true, undefined, this)
414
+ ]
415
+ }, undefined, true, undefined, this);
315
416
  }
316
-
317
- //#endregion
318
- export { MarketplaceDashboard };
319
- //# sourceMappingURL=MarketplaceDashboard.js.map
417
+ export {
418
+ MarketplaceDashboard
419
+ };