@contractspec/example.marketplace 3.7.7 → 3.8.4
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/README.md +1 -0
- package/dist/browser/index.js +316 -79
- package/dist/browser/marketplace.feature.js +175 -0
- package/dist/browser/ui/MarketplaceDashboard.js +293 -75
- package/dist/browser/ui/MarketplaceDashboard.visualizations.js +216 -0
- package/dist/browser/ui/index.js +309 -79
- package/dist/browser/ui/renderers/index.js +190 -4
- package/dist/browser/ui/renderers/marketplace.markdown.js +190 -4
- package/dist/browser/visualizations/catalog.js +126 -0
- package/dist/browser/visualizations/index.js +183 -0
- package/dist/browser/visualizations/selectors.js +177 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +316 -79
- package/dist/marketplace.feature.js +175 -0
- package/dist/node/index.js +316 -79
- package/dist/node/marketplace.feature.js +175 -0
- package/dist/node/ui/MarketplaceDashboard.js +293 -75
- package/dist/node/ui/MarketplaceDashboard.visualizations.js +216 -0
- package/dist/node/ui/index.js +309 -79
- package/dist/node/ui/renderers/index.js +190 -4
- package/dist/node/ui/renderers/marketplace.markdown.js +190 -4
- package/dist/node/visualizations/catalog.js +126 -0
- package/dist/node/visualizations/index.js +183 -0
- package/dist/node/visualizations/selectors.js +177 -0
- package/dist/ui/MarketplaceDashboard.js +293 -75
- package/dist/ui/MarketplaceDashboard.visualizations.d.ts +5 -0
- package/dist/ui/MarketplaceDashboard.visualizations.js +217 -0
- package/dist/ui/index.js +309 -79
- package/dist/ui/renderers/index.js +190 -4
- package/dist/ui/renderers/marketplace.markdown.d.ts +1 -1
- package/dist/ui/renderers/marketplace.markdown.js +190 -4
- package/dist/visualizations/catalog.d.ts +10 -0
- package/dist/visualizations/catalog.js +127 -0
- package/dist/visualizations/index.d.ts +2 -0
- package/dist/visualizations/index.js +184 -0
- package/dist/visualizations/selectors.d.ts +11 -0
- package/dist/visualizations/selectors.js +178 -0
- package/dist/visualizations/selectors.test.d.ts +1 -0
- package/package.json +66 -9
|
@@ -52,6 +52,220 @@ function useMarketplaceData(projectId = "local-project") {
|
|
|
52
52
|
};
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
+
// src/visualizations/catalog.ts
|
|
56
|
+
import {
|
|
57
|
+
defineVisualization,
|
|
58
|
+
VisualizationRegistry
|
|
59
|
+
} from "@contractspec/lib.contracts-spec/visualizations";
|
|
60
|
+
var ORDER_LIST_REF = {
|
|
61
|
+
key: "marketplace.order.list",
|
|
62
|
+
version: "1.0.0"
|
|
63
|
+
};
|
|
64
|
+
var PRODUCT_LIST_REF = {
|
|
65
|
+
key: "marketplace.product.list",
|
|
66
|
+
version: "1.0.0"
|
|
67
|
+
};
|
|
68
|
+
var META = {
|
|
69
|
+
version: "1.0.0",
|
|
70
|
+
domain: "marketplace",
|
|
71
|
+
stability: "experimental",
|
|
72
|
+
owners: ["@example.marketplace"],
|
|
73
|
+
tags: ["marketplace", "visualization", "commerce"]
|
|
74
|
+
};
|
|
75
|
+
var MarketplaceOrderStatusVisualization = defineVisualization({
|
|
76
|
+
meta: {
|
|
77
|
+
...META,
|
|
78
|
+
key: "marketplace.visualization.order-status",
|
|
79
|
+
title: "Order Status Breakdown",
|
|
80
|
+
description: "Distribution of current order states.",
|
|
81
|
+
goal: "Expose delivery and backlog mix at a glance.",
|
|
82
|
+
context: "Marketplace operations overview."
|
|
83
|
+
},
|
|
84
|
+
source: { primary: ORDER_LIST_REF, resultPath: "data" },
|
|
85
|
+
visualization: {
|
|
86
|
+
kind: "pie",
|
|
87
|
+
nameDimension: "status",
|
|
88
|
+
valueMeasure: "orders",
|
|
89
|
+
dimensions: [
|
|
90
|
+
{ key: "status", label: "Status", dataPath: "status", type: "category" }
|
|
91
|
+
],
|
|
92
|
+
measures: [
|
|
93
|
+
{ key: "orders", label: "Orders", dataPath: "orders", format: "number" }
|
|
94
|
+
],
|
|
95
|
+
table: { caption: "Order counts by status." }
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
var MarketplaceCategoryValueVisualization = defineVisualization({
|
|
99
|
+
meta: {
|
|
100
|
+
...META,
|
|
101
|
+
key: "marketplace.visualization.category-value",
|
|
102
|
+
title: "Category Value Comparison",
|
|
103
|
+
description: "Catalog value by product category derived from current pricing and stock.",
|
|
104
|
+
goal: "Compare where the marketplace catalog is concentrated.",
|
|
105
|
+
context: "Merchandising overview."
|
|
106
|
+
},
|
|
107
|
+
source: { primary: PRODUCT_LIST_REF, resultPath: "data" },
|
|
108
|
+
visualization: {
|
|
109
|
+
kind: "cartesian",
|
|
110
|
+
variant: "bar",
|
|
111
|
+
xDimension: "category",
|
|
112
|
+
yMeasures: ["catalogValue"],
|
|
113
|
+
dimensions: [
|
|
114
|
+
{
|
|
115
|
+
key: "category",
|
|
116
|
+
label: "Category",
|
|
117
|
+
dataPath: "category",
|
|
118
|
+
type: "category"
|
|
119
|
+
}
|
|
120
|
+
],
|
|
121
|
+
measures: [
|
|
122
|
+
{
|
|
123
|
+
key: "catalogValue",
|
|
124
|
+
label: "Catalog Value",
|
|
125
|
+
dataPath: "catalogValue",
|
|
126
|
+
format: "currency",
|
|
127
|
+
color: "#1d4ed8"
|
|
128
|
+
}
|
|
129
|
+
],
|
|
130
|
+
table: { caption: "Catalog value by product category." }
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
var MarketplaceOrderActivityVisualization = defineVisualization({
|
|
134
|
+
meta: {
|
|
135
|
+
...META,
|
|
136
|
+
key: "marketplace.visualization.order-activity",
|
|
137
|
+
title: "Recent Order Activity",
|
|
138
|
+
description: "Daily order volume from recent order creation timestamps.",
|
|
139
|
+
goal: "Show recent order activity trends.",
|
|
140
|
+
context: "Commerce operations trend monitoring."
|
|
141
|
+
},
|
|
142
|
+
source: { primary: ORDER_LIST_REF, resultPath: "data" },
|
|
143
|
+
visualization: {
|
|
144
|
+
kind: "cartesian",
|
|
145
|
+
variant: "line",
|
|
146
|
+
xDimension: "day",
|
|
147
|
+
yMeasures: ["orders"],
|
|
148
|
+
dimensions: [{ key: "day", label: "Day", dataPath: "day", type: "time" }],
|
|
149
|
+
measures: [
|
|
150
|
+
{
|
|
151
|
+
key: "orders",
|
|
152
|
+
label: "Orders",
|
|
153
|
+
dataPath: "orders",
|
|
154
|
+
format: "number",
|
|
155
|
+
color: "#0f766e"
|
|
156
|
+
}
|
|
157
|
+
],
|
|
158
|
+
table: { caption: "Daily order counts." }
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
var MarketplaceVisualizationSpecs = [
|
|
162
|
+
MarketplaceOrderStatusVisualization,
|
|
163
|
+
MarketplaceCategoryValueVisualization,
|
|
164
|
+
MarketplaceOrderActivityVisualization
|
|
165
|
+
];
|
|
166
|
+
var MarketplaceVisualizationRegistry = new VisualizationRegistry([
|
|
167
|
+
...MarketplaceVisualizationSpecs
|
|
168
|
+
]);
|
|
169
|
+
var MarketplaceVisualizationRefs = MarketplaceVisualizationSpecs.map((spec) => ({
|
|
170
|
+
key: spec.meta.key,
|
|
171
|
+
version: spec.meta.version
|
|
172
|
+
}));
|
|
173
|
+
|
|
174
|
+
// src/visualizations/selectors.ts
|
|
175
|
+
function toDayKey(value) {
|
|
176
|
+
const date = value instanceof Date ? value : new Date(value);
|
|
177
|
+
return date.toISOString().slice(0, 10);
|
|
178
|
+
}
|
|
179
|
+
function createMarketplaceVisualizationItems(products, orders) {
|
|
180
|
+
const orderStatus = new Map;
|
|
181
|
+
const orderActivity = new Map;
|
|
182
|
+
const categoryValue = new Map;
|
|
183
|
+
for (const order of orders) {
|
|
184
|
+
orderStatus.set(order.status, (orderStatus.get(order.status) ?? 0) + 1);
|
|
185
|
+
const day = toDayKey(order.createdAt);
|
|
186
|
+
orderActivity.set(day, (orderActivity.get(day) ?? 0) + 1);
|
|
187
|
+
}
|
|
188
|
+
for (const product of products) {
|
|
189
|
+
const category = product.category ?? "Uncategorized";
|
|
190
|
+
categoryValue.set(category, (categoryValue.get(category) ?? 0) + product.price * product.stock);
|
|
191
|
+
}
|
|
192
|
+
return [
|
|
193
|
+
{
|
|
194
|
+
key: "marketplace-order-status",
|
|
195
|
+
spec: MarketplaceOrderStatusVisualization,
|
|
196
|
+
data: {
|
|
197
|
+
data: Array.from(orderStatus.entries()).map(([status, count]) => ({
|
|
198
|
+
status,
|
|
199
|
+
orders: count
|
|
200
|
+
}))
|
|
201
|
+
},
|
|
202
|
+
title: "Order Status Breakdown",
|
|
203
|
+
description: "Status mix across the current order set.",
|
|
204
|
+
height: 260
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
key: "marketplace-category-value",
|
|
208
|
+
spec: MarketplaceCategoryValueVisualization,
|
|
209
|
+
data: {
|
|
210
|
+
data: Array.from(categoryValue.entries()).sort(([, left], [, right]) => right - left).map(([category, value]) => ({
|
|
211
|
+
category,
|
|
212
|
+
catalogValue: value
|
|
213
|
+
}))
|
|
214
|
+
},
|
|
215
|
+
title: "Category Value Comparison",
|
|
216
|
+
description: "Derived from current product pricing and stock."
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
key: "marketplace-order-activity",
|
|
220
|
+
spec: MarketplaceOrderActivityVisualization,
|
|
221
|
+
data: {
|
|
222
|
+
data: Array.from(orderActivity.entries()).sort(([left], [right]) => left.localeCompare(right)).map(([day, count]) => ({ day, orders: count }))
|
|
223
|
+
},
|
|
224
|
+
title: "Recent Order Activity",
|
|
225
|
+
description: "Daily order count from current order history."
|
|
226
|
+
}
|
|
227
|
+
];
|
|
228
|
+
}
|
|
229
|
+
// src/ui/MarketplaceDashboard.visualizations.tsx
|
|
230
|
+
import {
|
|
231
|
+
VisualizationCard,
|
|
232
|
+
VisualizationGrid
|
|
233
|
+
} from "@contractspec/lib.design-system";
|
|
234
|
+
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
235
|
+
"use client";
|
|
236
|
+
function MarketplaceVisualizationOverview({
|
|
237
|
+
products,
|
|
238
|
+
orders
|
|
239
|
+
}) {
|
|
240
|
+
const items = createMarketplaceVisualizationItems(products, orders);
|
|
241
|
+
return /* @__PURE__ */ jsxDEV("section", {
|
|
242
|
+
className: "space-y-3",
|
|
243
|
+
children: [
|
|
244
|
+
/* @__PURE__ */ jsxDEV("div", {
|
|
245
|
+
children: [
|
|
246
|
+
/* @__PURE__ */ jsxDEV("h3", {
|
|
247
|
+
className: "font-semibold text-lg",
|
|
248
|
+
children: "Commerce Visualizations"
|
|
249
|
+
}, undefined, false, undefined, this),
|
|
250
|
+
/* @__PURE__ */ jsxDEV("p", {
|
|
251
|
+
className: "text-muted-foreground text-sm",
|
|
252
|
+
children: "Order and catalog trends exposed through shared visualization contracts."
|
|
253
|
+
}, undefined, false, undefined, this)
|
|
254
|
+
]
|
|
255
|
+
}, undefined, true, undefined, this),
|
|
256
|
+
/* @__PURE__ */ jsxDEV(VisualizationGrid, {
|
|
257
|
+
children: items.map((item) => /* @__PURE__ */ jsxDEV(VisualizationCard, {
|
|
258
|
+
data: item.data,
|
|
259
|
+
description: item.description,
|
|
260
|
+
height: item.height,
|
|
261
|
+
spec: item.spec,
|
|
262
|
+
title: item.title
|
|
263
|
+
}, item.key, false, undefined, this))
|
|
264
|
+
}, undefined, false, undefined, this)
|
|
265
|
+
]
|
|
266
|
+
}, undefined, true, undefined, this);
|
|
267
|
+
}
|
|
268
|
+
|
|
55
269
|
// src/ui/MarketplaceDashboard.tsx
|
|
56
270
|
import {
|
|
57
271
|
Button,
|
|
@@ -61,7 +275,7 @@ import {
|
|
|
61
275
|
StatCardGroup
|
|
62
276
|
} from "@contractspec/lib.design-system";
|
|
63
277
|
import { useState as useState2 } from "react";
|
|
64
|
-
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
278
|
+
import { jsxDEV as jsxDEV2 } from "react/jsx-dev-runtime";
|
|
65
279
|
"use client";
|
|
66
280
|
var STATUS_COLORS = {
|
|
67
281
|
ACTIVE: "bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400",
|
|
@@ -93,32 +307,32 @@ function MarketplaceDashboard() {
|
|
|
93
307
|
{ id: "orders", label: "Orders", icon: "\uD83D\uDED2" }
|
|
94
308
|
];
|
|
95
309
|
if (loading) {
|
|
96
|
-
return /* @__PURE__ */
|
|
310
|
+
return /* @__PURE__ */ jsxDEV2(LoaderBlock, {
|
|
97
311
|
label: "Loading Marketplace..."
|
|
98
312
|
}, undefined, false, undefined, this);
|
|
99
313
|
}
|
|
100
314
|
if (error) {
|
|
101
|
-
return /* @__PURE__ */
|
|
315
|
+
return /* @__PURE__ */ jsxDEV2(ErrorState, {
|
|
102
316
|
title: "Failed to load Marketplace",
|
|
103
317
|
description: error.message,
|
|
104
318
|
onRetry: refetch,
|
|
105
319
|
retryLabel: "Retry"
|
|
106
320
|
}, undefined, false, undefined, this);
|
|
107
321
|
}
|
|
108
|
-
return /* @__PURE__ */
|
|
322
|
+
return /* @__PURE__ */ jsxDEV2("div", {
|
|
109
323
|
className: "space-y-6",
|
|
110
324
|
children: [
|
|
111
|
-
/* @__PURE__ */
|
|
325
|
+
/* @__PURE__ */ jsxDEV2("div", {
|
|
112
326
|
className: "flex items-center justify-between",
|
|
113
327
|
children: [
|
|
114
|
-
/* @__PURE__ */
|
|
328
|
+
/* @__PURE__ */ jsxDEV2("h2", {
|
|
115
329
|
className: "font-bold text-2xl",
|
|
116
330
|
children: "Marketplace"
|
|
117
331
|
}, undefined, false, undefined, this),
|
|
118
|
-
/* @__PURE__ */
|
|
332
|
+
/* @__PURE__ */ jsxDEV2(Button, {
|
|
119
333
|
onClick: () => alert("Create store modal"),
|
|
120
334
|
children: [
|
|
121
|
-
/* @__PURE__ */
|
|
335
|
+
/* @__PURE__ */ jsxDEV2("span", {
|
|
122
336
|
className: "mr-2",
|
|
123
337
|
children: "+"
|
|
124
338
|
}, undefined, false, undefined, this),
|
|
@@ -127,108 +341,112 @@ function MarketplaceDashboard() {
|
|
|
127
341
|
}, undefined, true, undefined, this)
|
|
128
342
|
]
|
|
129
343
|
}, undefined, true, undefined, this),
|
|
130
|
-
/* @__PURE__ */
|
|
344
|
+
/* @__PURE__ */ jsxDEV2(StatCardGroup, {
|
|
131
345
|
children: [
|
|
132
|
-
/* @__PURE__ */
|
|
346
|
+
/* @__PURE__ */ jsxDEV2(StatCard, {
|
|
133
347
|
label: "Stores",
|
|
134
348
|
value: stats.totalStores,
|
|
135
349
|
hint: `${stats.activeStores} active`
|
|
136
350
|
}, undefined, false, undefined, this),
|
|
137
|
-
/* @__PURE__ */
|
|
351
|
+
/* @__PURE__ */ jsxDEV2(StatCard, {
|
|
138
352
|
label: "Products",
|
|
139
353
|
value: stats.totalProducts,
|
|
140
354
|
hint: "listed"
|
|
141
355
|
}, undefined, false, undefined, this),
|
|
142
|
-
/* @__PURE__ */
|
|
356
|
+
/* @__PURE__ */ jsxDEV2(StatCard, {
|
|
143
357
|
label: "Orders",
|
|
144
358
|
value: stats.totalOrders,
|
|
145
359
|
hint: `${stats.pendingOrders} pending`
|
|
146
360
|
}, undefined, false, undefined, this),
|
|
147
|
-
/* @__PURE__ */
|
|
361
|
+
/* @__PURE__ */ jsxDEV2(StatCard, {
|
|
148
362
|
label: "Revenue",
|
|
149
363
|
value: formatCurrency(stats.totalRevenue),
|
|
150
364
|
hint: "total"
|
|
151
365
|
}, undefined, false, undefined, this)
|
|
152
366
|
]
|
|
153
367
|
}, undefined, true, undefined, this),
|
|
154
|
-
/* @__PURE__ */
|
|
368
|
+
/* @__PURE__ */ jsxDEV2(MarketplaceVisualizationOverview, {
|
|
369
|
+
orders,
|
|
370
|
+
products
|
|
371
|
+
}, undefined, false, undefined, this),
|
|
372
|
+
/* @__PURE__ */ jsxDEV2("nav", {
|
|
155
373
|
className: "flex gap-1 rounded-lg bg-muted p-1",
|
|
156
374
|
role: "tablist",
|
|
157
|
-
children: tabs.map((tab) => /* @__PURE__ */
|
|
375
|
+
children: tabs.map((tab) => /* @__PURE__ */ jsxDEV2(Button, {
|
|
158
376
|
type: "button",
|
|
159
377
|
role: "tab",
|
|
160
378
|
"aria-selected": activeTab === tab.id,
|
|
161
379
|
onClick: () => setActiveTab(tab.id),
|
|
162
380
|
className: `flex flex-1 items-center justify-center gap-2 rounded-md px-4 py-2 font-medium text-sm transition-colors ${activeTab === tab.id ? "bg-background text-foreground shadow-sm" : "text-muted-foreground hover:text-foreground"}`,
|
|
163
381
|
children: [
|
|
164
|
-
/* @__PURE__ */
|
|
382
|
+
/* @__PURE__ */ jsxDEV2("span", {
|
|
165
383
|
children: tab.icon
|
|
166
384
|
}, undefined, false, undefined, this),
|
|
167
385
|
tab.label
|
|
168
386
|
]
|
|
169
387
|
}, tab.id, true, undefined, this))
|
|
170
388
|
}, undefined, false, undefined, this),
|
|
171
|
-
/* @__PURE__ */
|
|
389
|
+
/* @__PURE__ */ jsxDEV2("div", {
|
|
172
390
|
className: "min-h-[400px]",
|
|
173
391
|
role: "tabpanel",
|
|
174
392
|
children: [
|
|
175
|
-
activeTab === "stores" && /* @__PURE__ */
|
|
393
|
+
activeTab === "stores" && /* @__PURE__ */ jsxDEV2("div", {
|
|
176
394
|
className: "rounded-lg border border-border",
|
|
177
|
-
children: /* @__PURE__ */
|
|
395
|
+
children: /* @__PURE__ */ jsxDEV2("table", {
|
|
178
396
|
className: "w-full",
|
|
179
397
|
children: [
|
|
180
|
-
/* @__PURE__ */
|
|
398
|
+
/* @__PURE__ */ jsxDEV2("thead", {
|
|
181
399
|
className: "border-border border-b bg-muted/30",
|
|
182
|
-
children: /* @__PURE__ */
|
|
400
|
+
children: /* @__PURE__ */ jsxDEV2("tr", {
|
|
183
401
|
children: [
|
|
184
|
-
/* @__PURE__ */
|
|
402
|
+
/* @__PURE__ */ jsxDEV2("th", {
|
|
185
403
|
className: "px-4 py-3 text-left font-medium text-sm",
|
|
186
404
|
children: "Store"
|
|
187
405
|
}, undefined, false, undefined, this),
|
|
188
|
-
/* @__PURE__ */
|
|
406
|
+
/* @__PURE__ */ jsxDEV2("th", {
|
|
189
407
|
className: "px-4 py-3 text-left font-medium text-sm",
|
|
190
408
|
children: "Status"
|
|
191
409
|
}, undefined, false, undefined, this),
|
|
192
|
-
/* @__PURE__ */
|
|
410
|
+
/* @__PURE__ */ jsxDEV2("th", {
|
|
193
411
|
className: "px-4 py-3 text-left font-medium text-sm",
|
|
194
412
|
children: "Rating"
|
|
195
413
|
}, undefined, false, undefined, this),
|
|
196
|
-
/* @__PURE__ */
|
|
414
|
+
/* @__PURE__ */ jsxDEV2("th", {
|
|
197
415
|
className: "px-4 py-3 text-left font-medium text-sm",
|
|
198
416
|
children: "Reviews"
|
|
199
417
|
}, undefined, false, undefined, this)
|
|
200
418
|
]
|
|
201
419
|
}, undefined, true, undefined, this)
|
|
202
420
|
}, undefined, false, undefined, this),
|
|
203
|
-
/* @__PURE__ */
|
|
421
|
+
/* @__PURE__ */ jsxDEV2("tbody", {
|
|
204
422
|
className: "divide-y divide-border",
|
|
205
423
|
children: [
|
|
206
|
-
stores.map((store) => /* @__PURE__ */
|
|
424
|
+
stores.map((store) => /* @__PURE__ */ jsxDEV2("tr", {
|
|
207
425
|
className: "hover:bg-muted/50",
|
|
208
426
|
children: [
|
|
209
|
-
/* @__PURE__ */
|
|
427
|
+
/* @__PURE__ */ jsxDEV2("td", {
|
|
210
428
|
className: "px-4 py-3",
|
|
211
429
|
children: [
|
|
212
|
-
/* @__PURE__ */
|
|
430
|
+
/* @__PURE__ */ jsxDEV2("div", {
|
|
213
431
|
className: "font-medium",
|
|
214
432
|
children: store.name
|
|
215
433
|
}, undefined, false, undefined, this),
|
|
216
|
-
/* @__PURE__ */
|
|
434
|
+
/* @__PURE__ */ jsxDEV2("div", {
|
|
217
435
|
className: "text-muted-foreground text-sm",
|
|
218
436
|
children: store.description
|
|
219
437
|
}, undefined, false, undefined, this)
|
|
220
438
|
]
|
|
221
439
|
}, undefined, true, undefined, this),
|
|
222
|
-
/* @__PURE__ */
|
|
440
|
+
/* @__PURE__ */ jsxDEV2("td", {
|
|
223
441
|
className: "px-4 py-3",
|
|
224
|
-
children: /* @__PURE__ */
|
|
442
|
+
children: /* @__PURE__ */ jsxDEV2("span", {
|
|
225
443
|
className: `inline-flex rounded-full px-2 py-0.5 font-medium text-xs ${STATUS_COLORS[store.status] ?? ""}`,
|
|
226
444
|
children: store.status
|
|
227
445
|
}, undefined, false, undefined, this)
|
|
228
446
|
}, undefined, false, undefined, this),
|
|
229
|
-
/* @__PURE__ */
|
|
447
|
+
/* @__PURE__ */ jsxDEV2("td", {
|
|
230
448
|
className: "px-4 py-3",
|
|
231
|
-
children: /* @__PURE__ */
|
|
449
|
+
children: /* @__PURE__ */ jsxDEV2("span", {
|
|
232
450
|
className: "flex items-center gap-1",
|
|
233
451
|
children: [
|
|
234
452
|
"⭐ ",
|
|
@@ -236,7 +454,7 @@ function MarketplaceDashboard() {
|
|
|
236
454
|
]
|
|
237
455
|
}, undefined, true, undefined, this)
|
|
238
456
|
}, undefined, false, undefined, this),
|
|
239
|
-
/* @__PURE__ */
|
|
457
|
+
/* @__PURE__ */ jsxDEV2("td", {
|
|
240
458
|
className: "px-4 py-3 text-muted-foreground text-sm",
|
|
241
459
|
children: [
|
|
242
460
|
store.reviewCount,
|
|
@@ -245,8 +463,8 @@ function MarketplaceDashboard() {
|
|
|
245
463
|
}, undefined, true, undefined, this)
|
|
246
464
|
]
|
|
247
465
|
}, store.id, true, undefined, this)),
|
|
248
|
-
stores.length === 0 && /* @__PURE__ */
|
|
249
|
-
children: /* @__PURE__ */
|
|
466
|
+
stores.length === 0 && /* @__PURE__ */ jsxDEV2("tr", {
|
|
467
|
+
children: /* @__PURE__ */ jsxDEV2("td", {
|
|
250
468
|
colSpan: 4,
|
|
251
469
|
className: "px-4 py-8 text-center text-muted-foreground",
|
|
252
470
|
children: "No stores found"
|
|
@@ -257,72 +475,72 @@ function MarketplaceDashboard() {
|
|
|
257
475
|
]
|
|
258
476
|
}, undefined, true, undefined, this)
|
|
259
477
|
}, undefined, false, undefined, this),
|
|
260
|
-
activeTab === "products" && /* @__PURE__ */
|
|
478
|
+
activeTab === "products" && /* @__PURE__ */ jsxDEV2("div", {
|
|
261
479
|
className: "rounded-lg border border-border",
|
|
262
|
-
children: /* @__PURE__ */
|
|
480
|
+
children: /* @__PURE__ */ jsxDEV2("table", {
|
|
263
481
|
className: "w-full",
|
|
264
482
|
children: [
|
|
265
|
-
/* @__PURE__ */
|
|
483
|
+
/* @__PURE__ */ jsxDEV2("thead", {
|
|
266
484
|
className: "border-border border-b bg-muted/30",
|
|
267
|
-
children: /* @__PURE__ */
|
|
485
|
+
children: /* @__PURE__ */ jsxDEV2("tr", {
|
|
268
486
|
children: [
|
|
269
|
-
/* @__PURE__ */
|
|
487
|
+
/* @__PURE__ */ jsxDEV2("th", {
|
|
270
488
|
className: "px-4 py-3 text-left font-medium text-sm",
|
|
271
489
|
children: "Product"
|
|
272
490
|
}, undefined, false, undefined, this),
|
|
273
|
-
/* @__PURE__ */
|
|
491
|
+
/* @__PURE__ */ jsxDEV2("th", {
|
|
274
492
|
className: "px-4 py-3 text-left font-medium text-sm",
|
|
275
493
|
children: "Price"
|
|
276
494
|
}, undefined, false, undefined, this),
|
|
277
|
-
/* @__PURE__ */
|
|
495
|
+
/* @__PURE__ */ jsxDEV2("th", {
|
|
278
496
|
className: "px-4 py-3 text-left font-medium text-sm",
|
|
279
497
|
children: "Stock"
|
|
280
498
|
}, undefined, false, undefined, this),
|
|
281
|
-
/* @__PURE__ */
|
|
499
|
+
/* @__PURE__ */ jsxDEV2("th", {
|
|
282
500
|
className: "px-4 py-3 text-left font-medium text-sm",
|
|
283
501
|
children: "Status"
|
|
284
502
|
}, undefined, false, undefined, this)
|
|
285
503
|
]
|
|
286
504
|
}, undefined, true, undefined, this)
|
|
287
505
|
}, undefined, false, undefined, this),
|
|
288
|
-
/* @__PURE__ */
|
|
506
|
+
/* @__PURE__ */ jsxDEV2("tbody", {
|
|
289
507
|
className: "divide-y divide-border",
|
|
290
508
|
children: [
|
|
291
|
-
products.map((product) => /* @__PURE__ */
|
|
509
|
+
products.map((product) => /* @__PURE__ */ jsxDEV2("tr", {
|
|
292
510
|
className: "hover:bg-muted/50",
|
|
293
511
|
children: [
|
|
294
|
-
/* @__PURE__ */
|
|
512
|
+
/* @__PURE__ */ jsxDEV2("td", {
|
|
295
513
|
className: "px-4 py-3",
|
|
296
514
|
children: [
|
|
297
|
-
/* @__PURE__ */
|
|
515
|
+
/* @__PURE__ */ jsxDEV2("div", {
|
|
298
516
|
className: "font-medium",
|
|
299
517
|
children: product.name
|
|
300
518
|
}, undefined, false, undefined, this),
|
|
301
|
-
/* @__PURE__ */
|
|
519
|
+
/* @__PURE__ */ jsxDEV2("div", {
|
|
302
520
|
className: "text-muted-foreground text-sm",
|
|
303
521
|
children: product.category
|
|
304
522
|
}, undefined, false, undefined, this)
|
|
305
523
|
]
|
|
306
524
|
}, undefined, true, undefined, this),
|
|
307
|
-
/* @__PURE__ */
|
|
525
|
+
/* @__PURE__ */ jsxDEV2("td", {
|
|
308
526
|
className: "px-4 py-3 font-mono",
|
|
309
527
|
children: formatCurrency(product.price, product.currency)
|
|
310
528
|
}, undefined, false, undefined, this),
|
|
311
|
-
/* @__PURE__ */
|
|
529
|
+
/* @__PURE__ */ jsxDEV2("td", {
|
|
312
530
|
className: "px-4 py-3",
|
|
313
531
|
children: product.stock
|
|
314
532
|
}, undefined, false, undefined, this),
|
|
315
|
-
/* @__PURE__ */
|
|
533
|
+
/* @__PURE__ */ jsxDEV2("td", {
|
|
316
534
|
className: "px-4 py-3",
|
|
317
|
-
children: /* @__PURE__ */
|
|
535
|
+
children: /* @__PURE__ */ jsxDEV2("span", {
|
|
318
536
|
className: `inline-flex rounded-full px-2 py-0.5 font-medium text-xs ${STATUS_COLORS[product.status] ?? ""}`,
|
|
319
537
|
children: product.status
|
|
320
538
|
}, undefined, false, undefined, this)
|
|
321
539
|
}, undefined, false, undefined, this)
|
|
322
540
|
]
|
|
323
541
|
}, product.id, true, undefined, this)),
|
|
324
|
-
products.length === 0 && /* @__PURE__ */
|
|
325
|
-
children: /* @__PURE__ */
|
|
542
|
+
products.length === 0 && /* @__PURE__ */ jsxDEV2("tr", {
|
|
543
|
+
children: /* @__PURE__ */ jsxDEV2("td", {
|
|
326
544
|
colSpan: 4,
|
|
327
545
|
className: "px-4 py-8 text-center text-muted-foreground",
|
|
328
546
|
children: "No products found"
|
|
@@ -333,71 +551,71 @@ function MarketplaceDashboard() {
|
|
|
333
551
|
]
|
|
334
552
|
}, undefined, true, undefined, this)
|
|
335
553
|
}, undefined, false, undefined, this),
|
|
336
|
-
activeTab === "orders" && /* @__PURE__ */
|
|
554
|
+
activeTab === "orders" && /* @__PURE__ */ jsxDEV2("div", {
|
|
337
555
|
className: "rounded-lg border border-border",
|
|
338
|
-
children: /* @__PURE__ */
|
|
556
|
+
children: /* @__PURE__ */ jsxDEV2("table", {
|
|
339
557
|
className: "w-full",
|
|
340
558
|
children: [
|
|
341
|
-
/* @__PURE__ */
|
|
559
|
+
/* @__PURE__ */ jsxDEV2("thead", {
|
|
342
560
|
className: "border-border border-b bg-muted/30",
|
|
343
|
-
children: /* @__PURE__ */
|
|
561
|
+
children: /* @__PURE__ */ jsxDEV2("tr", {
|
|
344
562
|
children: [
|
|
345
|
-
/* @__PURE__ */
|
|
563
|
+
/* @__PURE__ */ jsxDEV2("th", {
|
|
346
564
|
className: "px-4 py-3 text-left font-medium text-sm",
|
|
347
565
|
children: "Order ID"
|
|
348
566
|
}, undefined, false, undefined, this),
|
|
349
|
-
/* @__PURE__ */
|
|
567
|
+
/* @__PURE__ */ jsxDEV2("th", {
|
|
350
568
|
className: "px-4 py-3 text-left font-medium text-sm",
|
|
351
569
|
children: "Customer"
|
|
352
570
|
}, undefined, false, undefined, this),
|
|
353
|
-
/* @__PURE__ */
|
|
571
|
+
/* @__PURE__ */ jsxDEV2("th", {
|
|
354
572
|
className: "px-4 py-3 text-left font-medium text-sm",
|
|
355
573
|
children: "Total"
|
|
356
574
|
}, undefined, false, undefined, this),
|
|
357
|
-
/* @__PURE__ */
|
|
575
|
+
/* @__PURE__ */ jsxDEV2("th", {
|
|
358
576
|
className: "px-4 py-3 text-left font-medium text-sm",
|
|
359
577
|
children: "Status"
|
|
360
578
|
}, undefined, false, undefined, this),
|
|
361
|
-
/* @__PURE__ */
|
|
579
|
+
/* @__PURE__ */ jsxDEV2("th", {
|
|
362
580
|
className: "px-4 py-3 text-left font-medium text-sm",
|
|
363
581
|
children: "Date"
|
|
364
582
|
}, undefined, false, undefined, this)
|
|
365
583
|
]
|
|
366
584
|
}, undefined, true, undefined, this)
|
|
367
585
|
}, undefined, false, undefined, this),
|
|
368
|
-
/* @__PURE__ */
|
|
586
|
+
/* @__PURE__ */ jsxDEV2("tbody", {
|
|
369
587
|
className: "divide-y divide-border",
|
|
370
588
|
children: [
|
|
371
|
-
orders.map((order) => /* @__PURE__ */
|
|
589
|
+
orders.map((order) => /* @__PURE__ */ jsxDEV2("tr", {
|
|
372
590
|
className: "hover:bg-muted/50",
|
|
373
591
|
children: [
|
|
374
|
-
/* @__PURE__ */
|
|
592
|
+
/* @__PURE__ */ jsxDEV2("td", {
|
|
375
593
|
className: "px-4 py-3 font-mono text-sm",
|
|
376
594
|
children: order.id
|
|
377
595
|
}, undefined, false, undefined, this),
|
|
378
|
-
/* @__PURE__ */
|
|
596
|
+
/* @__PURE__ */ jsxDEV2("td", {
|
|
379
597
|
className: "px-4 py-3 text-sm",
|
|
380
598
|
children: order.customerId
|
|
381
599
|
}, undefined, false, undefined, this),
|
|
382
|
-
/* @__PURE__ */
|
|
600
|
+
/* @__PURE__ */ jsxDEV2("td", {
|
|
383
601
|
className: "px-4 py-3 font-mono",
|
|
384
602
|
children: formatCurrency(order.total, order.currency)
|
|
385
603
|
}, undefined, false, undefined, this),
|
|
386
|
-
/* @__PURE__ */
|
|
604
|
+
/* @__PURE__ */ jsxDEV2("td", {
|
|
387
605
|
className: "px-4 py-3",
|
|
388
|
-
children: /* @__PURE__ */
|
|
606
|
+
children: /* @__PURE__ */ jsxDEV2("span", {
|
|
389
607
|
className: `inline-flex rounded-full px-2 py-0.5 font-medium text-xs ${STATUS_COLORS[order.status] ?? ""}`,
|
|
390
608
|
children: order.status
|
|
391
609
|
}, undefined, false, undefined, this)
|
|
392
610
|
}, undefined, false, undefined, this),
|
|
393
|
-
/* @__PURE__ */
|
|
611
|
+
/* @__PURE__ */ jsxDEV2("td", {
|
|
394
612
|
className: "px-4 py-3 text-muted-foreground text-sm",
|
|
395
613
|
children: order.createdAt.toLocaleDateString()
|
|
396
614
|
}, undefined, false, undefined, this)
|
|
397
615
|
]
|
|
398
616
|
}, order.id, true, undefined, this)),
|
|
399
|
-
orders.length === 0 && /* @__PURE__ */
|
|
400
|
-
children: /* @__PURE__ */
|
|
617
|
+
orders.length === 0 && /* @__PURE__ */ jsxDEV2("tr", {
|
|
618
|
+
children: /* @__PURE__ */ jsxDEV2("td", {
|
|
401
619
|
colSpan: 5,
|
|
402
620
|
className: "px-4 py-8 text-center text-muted-foreground",
|
|
403
621
|
children: "No orders found"
|