@medialane/ui 0.29.2 → 0.30.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 (37) hide show
  1. package/dist/components/asset-top-sections.cjs +9 -4
  2. package/dist/components/asset-top-sections.cjs.map +1 -1
  3. package/dist/components/asset-top-sections.d.cts +3 -1
  4. package/dist/components/asset-top-sections.d.ts +3 -1
  5. package/dist/components/asset-top-sections.js +9 -4
  6. package/dist/components/asset-top-sections.js.map +1 -1
  7. package/dist/data/launchpad-services.cjs +30 -14
  8. package/dist/data/launchpad-services.cjs.map +1 -1
  9. package/dist/data/launchpad-services.d.cts +1 -1
  10. package/dist/data/launchpad-services.d.ts +1 -1
  11. package/dist/data/launchpad-services.js +30 -14
  12. package/dist/data/launchpad-services.js.map +1 -1
  13. package/dist/index.cjs +0 -8
  14. package/dist/index.cjs.map +1 -1
  15. package/dist/index.d.cts +2 -4
  16. package/dist/index.d.ts +2 -4
  17. package/dist/index.js +1 -6
  18. package/dist/index.js.map +1 -1
  19. package/dist/utils/format.cjs +2 -17
  20. package/dist/utils/format.cjs.map +1 -1
  21. package/dist/utils/format.d.cts +1 -9
  22. package/dist/utils/format.d.ts +1 -9
  23. package/dist/utils/format.js +1 -15
  24. package/dist/utils/format.js.map +1 -1
  25. package/package.json +1 -1
  26. package/dist/components/asset-collection-bar.cjs +0 -135
  27. package/dist/components/asset-collection-bar.cjs.map +0 -1
  28. package/dist/components/asset-collection-bar.d.cts +0 -28
  29. package/dist/components/asset-collection-bar.d.ts +0 -28
  30. package/dist/components/asset-collection-bar.js +0 -101
  31. package/dist/components/asset-collection-bar.js.map +0 -1
  32. package/dist/components/asset-marketplace-panel.cjs +0 -284
  33. package/dist/components/asset-marketplace-panel.cjs.map +0 -1
  34. package/dist/components/asset-marketplace-panel.d.cts +0 -44
  35. package/dist/components/asset-marketplace-panel.d.ts +0 -44
  36. package/dist/components/asset-marketplace-panel.js +0 -270
  37. package/dist/components/asset-marketplace-panel.js.map +0 -1
@@ -1,270 +0,0 @@
1
- "use client";
2
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
- import {
4
- ArrowRightLeft,
5
- CheckCircle,
6
- Clock,
7
- GitBranch,
8
- HandCoins,
9
- Loader2,
10
- ShoppingCart,
11
- Tag,
12
- X
13
- } from "lucide-react";
14
- import { CurrencyIcon, CurrencyAmount } from "./currency-icon.js";
15
- import { AddressDisplay } from "./address-display.js";
16
- import { formatDisplayPrice, parsePriceDisplay } from "../utils/format.js";
17
- import { timeUntil } from "../utils/time.js";
18
- const actionToneClass = {
19
- blue: "bg-brand-blue",
20
- orange: "bg-brand-orange",
21
- purple: "bg-brand-purple",
22
- destructive: "bg-destructive",
23
- transparent: "bg-transparent"
24
- };
25
- function ActionButton({ label, icon, onClick, tone, disabled = false, helpContent, renderHelp }) {
26
- return /* @__PURE__ */ jsx("div", { className: `btn-border-animated p-[1px] rounded-2xl ${disabled ? "opacity-40 pointer-events-none" : ""}`, children: /* @__PURE__ */ jsxs(
27
- "button",
28
- {
29
- className: `w-full h-10 rounded-[15px] flex items-center justify-center gap-2 px-3 text-sm font-semibold text-white transition-all hover:brightness-110 active:scale-[0.98] disabled:opacity-50 ${actionToneClass[tone]}`,
30
- disabled,
31
- onClick,
32
- children: [
33
- icon,
34
- label,
35
- helpContent ? renderHelp(helpContent) : null
36
- ]
37
- }
38
- ) });
39
- }
40
- function StatRow({ floorPriceRaw, lastSaleRaw }) {
41
- if (!floorPriceRaw && !lastSaleRaw) return null;
42
- const floor = floorPriceRaw ? parsePriceDisplay(floorPriceRaw) : null;
43
- const lastSale = lastSaleRaw ? parsePriceDisplay(lastSaleRaw) : null;
44
- return /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-4 text-xs text-muted-foreground", children: [
45
- /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1.5", children: [
46
- /* @__PURE__ */ jsx("span", { className: "uppercase tracking-wider font-semibold", children: "Floor" }),
47
- floor && floor.symbol ? /* @__PURE__ */ jsx(CurrencyAmount, { amount: floor.numStr, symbol: floor.symbol, iconSize: 12, amountClassName: "text-foreground font-semibold" }) : /* @__PURE__ */ jsx("span", { className: "text-foreground font-semibold", children: "\u2014" })
48
- ] }),
49
- /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1.5", children: [
50
- /* @__PURE__ */ jsx("span", { className: "uppercase tracking-wider font-semibold", children: "Last sale" }),
51
- lastSale && lastSale.symbol ? /* @__PURE__ */ jsx(CurrencyAmount, { amount: lastSale.numStr, symbol: lastSale.symbol, iconSize: 12, amountClassName: "text-foreground font-semibold" }) : /* @__PURE__ */ jsx("span", { className: "text-foreground font-semibold", children: "\u2014" })
52
- ] })
53
- ] });
54
- }
55
- function AssetMarketplacePanel({
56
- cheapest,
57
- isOwner,
58
- isSignedIn,
59
- isProcessing,
60
- isERC1155,
61
- isMarketLoading = false,
62
- myListing,
63
- activeBids,
64
- walletAddress,
65
- remixEnabled = false,
66
- showDealOption = false,
67
- floorPriceRaw,
68
- lastSaleRaw,
69
- renderAuthAction,
70
- renderHelp,
71
- onCancelClick,
72
- onAcceptBid,
73
- onOpenListing,
74
- onOpenTransfer,
75
- onOpenPurchase,
76
- onOpenOffer,
77
- onOpenRemix,
78
- onProposeDeal
79
- }) {
80
- const myBid = !isOwner && walletAddress ? activeBids.find((bid) => bid.offerer.toLowerCase() === walletAddress.toLowerCase()) ?? null : null;
81
- const canBuyMore = isERC1155 && isOwner && !!cheapest && !!walletAddress && cheapest.offerer.toLowerCase() !== walletAddress.toLowerCase();
82
- if (isMarketLoading && !cheapest) {
83
- return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
84
- /* @__PURE__ */ jsx("div", { className: "h-9 w-32 rounded-md bg-muted animate-pulse" }),
85
- /* @__PURE__ */ jsx("div", { className: "h-12 w-full rounded-2xl bg-muted animate-pulse" })
86
- ] });
87
- }
88
- return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
89
- /* @__PURE__ */ jsx(
90
- "div",
91
- {
92
- "aria-hidden": true,
93
- className: "aurora-purple pointer-events-none",
94
- style: { position: "absolute", width: 280, height: 280, top: -60, left: "20%" }
95
- }
96
- ),
97
- /* @__PURE__ */ jsxs("div", { className: "relative space-y-4", children: [
98
- cheapest ? /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
99
- /* @__PURE__ */ jsxs("div", { className: "flex items-baseline gap-2", children: [
100
- /* @__PURE__ */ jsx(CurrencyIcon, { symbol: cheapest.price.currency ?? "", size: 26 }),
101
- /* @__PURE__ */ jsx("span", { className: "text-4xl font-bold tracking-tight", children: formatDisplayPrice(cheapest.price.formatted) }),
102
- renderHelp(
103
- `${isOwner && !canBuyMore ? "Your listing" : "Current price"} \xB7 Expires ${timeUntil(cheapest.endTime)}`
104
- )
105
- ] }),
106
- /* @__PURE__ */ jsx(StatRow, { floorPriceRaw, lastSaleRaw }),
107
- isOwner ? /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
108
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-2", children: [
109
- myListing ? /* @__PURE__ */ jsx(
110
- ActionButton,
111
- {
112
- label: "Cancel",
113
- icon: isProcessing ? /* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ jsx(X, { className: "h-4 w-4" }),
114
- onClick: () => onCancelClick(myListing),
115
- disabled: isProcessing,
116
- tone: "destructive",
117
- renderHelp
118
- }
119
- ) : null,
120
- /* @__PURE__ */ jsx(ActionButton, { label: "List", icon: /* @__PURE__ */ jsx(Tag, { className: "h-4 w-4" }), onClick: onOpenListing, tone: "blue", renderHelp }),
121
- /* @__PURE__ */ jsx(ActionButton, { label: "Transfer", icon: /* @__PURE__ */ jsx(ArrowRightLeft, { className: "h-4 w-4" }), onClick: onOpenTransfer, tone: "orange", renderHelp }),
122
- remixEnabled && onOpenRemix ? /* @__PURE__ */ jsx(
123
- ActionButton,
124
- {
125
- label: "Remix",
126
- icon: /* @__PURE__ */ jsx(GitBranch, { className: "h-4 w-4" }),
127
- onClick: onOpenRemix,
128
- helpContent: "Build a licensed derivative of this digital asset \u2014 your remix is minted as a new onchain NFT linked to the original",
129
- tone: "purple",
130
- renderHelp
131
- }
132
- ) : null
133
- ] }),
134
- canBuyMore && /* @__PURE__ */ jsxs(Fragment, { children: [
135
- /* @__PURE__ */ jsx("div", { className: "border-t border-border/40 pt-2 mt-1" }),
136
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-2", children: [
137
- /* @__PURE__ */ jsx(ActionButton, { label: "Buy", icon: /* @__PURE__ */ jsx(ShoppingCart, { className: "h-4 w-4" }), onClick: () => onOpenPurchase(cheapest), tone: "transparent", renderHelp }),
138
- /* @__PURE__ */ jsx(ActionButton, { label: "Make offer", icon: /* @__PURE__ */ jsx(HandCoins, { className: "h-4 w-4" }), onClick: onOpenOffer, tone: "orange", renderHelp })
139
- ] })
140
- ] })
141
- ] }) : isSignedIn ? /* @__PURE__ */ jsxs(Fragment, { children: [
142
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-2", children: [
143
- /* @__PURE__ */ jsx(ActionButton, { label: "Buy", icon: /* @__PURE__ */ jsx(ShoppingCart, { className: "h-4 w-4" }), onClick: () => onOpenPurchase(cheapest), tone: "transparent", renderHelp }),
144
- /* @__PURE__ */ jsx(ActionButton, { label: "Make offer", icon: /* @__PURE__ */ jsx(HandCoins, { className: "h-4 w-4" }), onClick: onOpenOffer, tone: "orange", renderHelp }),
145
- remixEnabled && onOpenRemix ? /* @__PURE__ */ jsx(
146
- ActionButton,
147
- {
148
- label: "Remix",
149
- icon: /* @__PURE__ */ jsx(GitBranch, { className: "h-4 w-4" }),
150
- onClick: onOpenRemix,
151
- helpContent: "Create your own attributed derivative of this work.",
152
- tone: "purple",
153
- renderHelp
154
- }
155
- ) : null,
156
- showDealOption && onProposeDeal ? /* @__PURE__ */ jsx(
157
- ActionButton,
158
- {
159
- label: "License",
160
- icon: /* @__PURE__ */ jsx(HandCoins, { className: "h-4 w-4" }),
161
- onClick: onProposeDeal,
162
- helpContent: "Propose a license deal to the creator to use this work.",
163
- tone: "blue",
164
- renderHelp
165
- }
166
- ) : null
167
- ] }),
168
- !remixEnabled && !showDealOption ? /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground mt-2 leading-relaxed", children: "The creator marked this asset as no-derivatives." }) : null
169
- ] }) : renderAuthAction("Sign in to trade")
170
- ] }) : /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
171
- /* @__PURE__ */ jsx(StatRow, { floorPriceRaw, lastSaleRaw }),
172
- isOwner ? /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-2", children: [
173
- /* @__PURE__ */ jsx(ActionButton, { label: "List", icon: /* @__PURE__ */ jsx(Tag, { className: "h-4 w-4" }), onClick: onOpenListing, tone: "transparent", renderHelp }),
174
- /* @__PURE__ */ jsx(ActionButton, { label: "Transfer", icon: /* @__PURE__ */ jsx(ArrowRightLeft, { className: "h-4 w-4" }), onClick: onOpenTransfer, tone: "orange", renderHelp }),
175
- remixEnabled && onOpenRemix ? /* @__PURE__ */ jsx(
176
- ActionButton,
177
- {
178
- label: "Remix",
179
- icon: /* @__PURE__ */ jsx(GitBranch, { className: "h-4 w-4" }),
180
- onClick: onOpenRemix,
181
- helpContent: "Build a licensed derivative of this digital asset \u2014 your remix is minted as a new onchain NFT linked to the original",
182
- tone: "purple",
183
- renderHelp
184
- }
185
- ) : null
186
- ] }) : isSignedIn ? /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-2", children: [
187
- /* @__PURE__ */ jsx(ActionButton, { label: "Make offer", icon: /* @__PURE__ */ jsx(HandCoins, { className: "h-4 w-4" }), onClick: onOpenOffer, tone: "orange", renderHelp }),
188
- remixEnabled && onOpenRemix ? /* @__PURE__ */ jsx(
189
- ActionButton,
190
- {
191
- label: "Remix",
192
- icon: /* @__PURE__ */ jsx(GitBranch, { className: "h-4 w-4" }),
193
- onClick: onOpenRemix,
194
- helpContent: "Build a licensed derivative of this digital asset \u2014 your remix is minted as a new onchain NFT linked to the original",
195
- tone: "purple",
196
- renderHelp
197
- }
198
- ) : null
199
- ] }) : renderAuthAction("Sign in to make an offer")
200
- ] }),
201
- myBid ? /* @__PURE__ */ jsxs("div", { className: "rounded-xl bg-amber-500/8 px-4 py-3 flex items-center justify-between gap-3", children: [
202
- /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex items-center gap-2.5", children: [
203
- /* @__PURE__ */ jsx(HandCoins, { className: "h-4 w-4 text-amber-500 shrink-0" }),
204
- /* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
205
- /* @__PURE__ */ jsx("p", { className: "text-xs font-semibold text-amber-500", children: "Your active offer" }),
206
- /* @__PURE__ */ jsxs("p", { className: "text-xs text-muted-foreground flex items-center gap-1.5 mt-0.5", children: [
207
- /* @__PURE__ */ jsxs("span", { className: "font-bold text-foreground inline-flex items-center gap-1", children: [
208
- formatDisplayPrice(myBid.price.formatted),
209
- /* @__PURE__ */ jsx(CurrencyIcon, { symbol: myBid.price.currency ?? "", size: 12 })
210
- ] }),
211
- /* @__PURE__ */ jsx("span", { children: "\xB7" }),
212
- /* @__PURE__ */ jsx(Clock, { className: "h-3 w-3" }),
213
- timeUntil(myBid.endTime)
214
- ] })
215
- ] })
216
- ] }),
217
- /* @__PURE__ */ jsxs(
218
- "button",
219
- {
220
- className: "shrink-0 text-xs font-semibold text-red-400 hover:text-red-300 transition-colors flex items-center gap-1",
221
- onClick: () => onCancelClick(myBid),
222
- children: [
223
- /* @__PURE__ */ jsx(X, { className: "h-3.5 w-3.5" }),
224
- "Cancel"
225
- ]
226
- }
227
- )
228
- ] }) : null,
229
- isOwner && activeBids.length > 0 ? /* @__PURE__ */ jsxs("div", { className: "rounded-xl bg-card/40 p-5 space-y-3", children: [
230
- /* @__PURE__ */ jsxs("p", { className: "text-xs font-semibold uppercase tracking-wider text-muted-foreground", children: [
231
- "Incoming offers (",
232
- activeBids.length,
233
- ")"
234
- ] }),
235
- /* @__PURE__ */ jsx("div", { className: "space-y-2", children: activeBids.map((bid) => /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-3 rounded-lg bg-muted/30 px-3 py-2", children: [
236
- /* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
237
- /* @__PURE__ */ jsx("p", { className: "text-sm font-bold", children: /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-1.5", children: [
238
- formatDisplayPrice(bid.price.formatted),
239
- /* @__PURE__ */ jsx(CurrencyIcon, { symbol: bid.price.currency ?? "", size: 14 })
240
- ] }) }),
241
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 mt-0.5", children: [
242
- /* @__PURE__ */ jsx(AddressDisplay, { address: bid.offerer, chars: 4, showCopy: false, className: "text-xs text-muted-foreground" }),
243
- /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: "\xB7" }),
244
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [
245
- /* @__PURE__ */ jsx(Clock, { className: "h-3 w-3" }),
246
- timeUntil(bid.endTime)
247
- ] })
248
- ] })
249
- ] }),
250
- /* @__PURE__ */ jsxs(
251
- "button",
252
- {
253
- disabled: isProcessing,
254
- onClick: () => onAcceptBid(bid),
255
- className: "inline-flex items-center gap-1.5 rounded-lg bg-primary px-3 py-1.5 text-xs font-semibold text-primary-foreground disabled:opacity-50",
256
- children: [
257
- /* @__PURE__ */ jsx(CheckCircle, { className: "h-3.5 w-3.5" }),
258
- "Accept"
259
- ]
260
- }
261
- )
262
- ] }, bid.orderHash)) })
263
- ] }) : null
264
- ] })
265
- ] });
266
- }
267
- export {
268
- AssetMarketplacePanel
269
- };
270
- //# sourceMappingURL=asset-marketplace-panel.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/components/asset-marketplace-panel.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport {\n ArrowRightLeft, CheckCircle, Clock, GitBranch, HandCoins, Loader2,\n ShoppingCart, Tag, X,\n} from \"lucide-react\";\nimport { CurrencyIcon, CurrencyAmount } from \"./currency-icon.js\";\nimport { AddressDisplay } from \"./address-display.js\";\nimport { formatDisplayPrice, parsePriceDisplay } from \"../utils/format.js\";\nimport { timeUntil } from \"../utils/time.js\";\n\n/** Structural subset of `ApiOrder` (both apps' `@medialane/sdk` types satisfy this). */\nexport interface ApiOrderLike {\n orderHash: string;\n offerer: string;\n endTime: string;\n price: { formatted: string | null; currency: string | null };\n}\n\ninterface ActionButtonProps {\n label: string;\n icon: ReactNode;\n onClick: () => void;\n tone: \"blue\" | \"orange\" | \"purple\" | \"destructive\" | \"transparent\";\n disabled?: boolean;\n helpContent?: string;\n renderHelp: (content: string) => ReactNode;\n}\n\nconst actionToneClass: Record<ActionButtonProps[\"tone\"], string> = {\n blue: \"bg-brand-blue\",\n orange: \"bg-brand-orange\",\n purple: \"bg-brand-purple\",\n destructive: \"bg-destructive\",\n transparent: \"bg-transparent\",\n};\n\nfunction ActionButton({ label, icon, onClick, tone, disabled = false, helpContent, renderHelp }: ActionButtonProps) {\n return (\n <div className={`btn-border-animated p-[1px] rounded-2xl ${disabled ? \"opacity-40 pointer-events-none\" : \"\"}`}>\n <button\n className={`w-full h-10 rounded-[15px] flex items-center justify-center gap-2 px-3 text-sm font-semibold text-white transition-all hover:brightness-110 active:scale-[0.98] disabled:opacity-50 ${actionToneClass[tone]}`}\n disabled={disabled}\n onClick={onClick}\n >\n {icon}\n {label}\n {helpContent ? renderHelp(helpContent) : null}\n </button>\n </div>\n );\n}\n\nexport interface AssetMarketplacePanelProps<T extends ApiOrderLike = ApiOrderLike> {\n cheapest?: T;\n isOwner: boolean;\n isSignedIn: boolean;\n isProcessing: boolean;\n isERC1155: boolean;\n isMarketLoading?: boolean;\n myListing: T | null;\n activeBids: T[];\n walletAddress?: string | null;\n remixEnabled?: boolean;\n showDealOption?: boolean;\n /** Raw \"0.07 STRK\"-style strings — already resolved by the caller. `null`/undefined renders \"—\". */\n floorPriceRaw?: string | null;\n lastSaleRaw?: string | null;\n /** Renders the sign-in/connect-wallet CTA for the given label (e.g. \"Sign in to trade\"). */\n renderAuthAction: (label: string) => ReactNode;\n /** Renders an inline help/info affordance for the given tooltip text. */\n renderHelp: (content: string) => ReactNode;\n onCancelClick: (order: T) => void;\n onAcceptBid: (order: T) => void;\n onOpenListing: () => void;\n onOpenTransfer: () => void;\n onOpenPurchase: (order: T) => void;\n onOpenOffer: () => void;\n onOpenRemix?: () => void;\n onProposeDeal?: () => void;\n}\n\nfunction StatRow({ floorPriceRaw, lastSaleRaw }: { floorPriceRaw?: string | null; lastSaleRaw?: string | null }) {\n if (!floorPriceRaw && !lastSaleRaw) return null;\n const floor = floorPriceRaw ? parsePriceDisplay(floorPriceRaw) : null;\n const lastSale = lastSaleRaw ? parsePriceDisplay(lastSaleRaw) : null;\n return (\n <div className=\"flex items-center gap-4 text-xs text-muted-foreground\">\n <span className=\"flex items-center gap-1.5\">\n <span className=\"uppercase tracking-wider font-semibold\">Floor</span>\n {floor && floor.symbol ? (\n <CurrencyAmount amount={floor.numStr} symbol={floor.symbol} iconSize={12} amountClassName=\"text-foreground font-semibold\" />\n ) : (\n <span className=\"text-foreground font-semibold\">—</span>\n )}\n </span>\n <span className=\"flex items-center gap-1.5\">\n <span className=\"uppercase tracking-wider font-semibold\">Last sale</span>\n {lastSale && lastSale.symbol ? (\n <CurrencyAmount amount={lastSale.numStr} symbol={lastSale.symbol} iconSize={12} amountClassName=\"text-foreground font-semibold\" />\n ) : (\n <span className=\"text-foreground font-semibold\">—</span>\n )}\n </span>\n </div>\n );\n}\n\nexport function AssetMarketplacePanel<T extends ApiOrderLike = ApiOrderLike>({\n cheapest,\n isOwner,\n isSignedIn,\n isProcessing,\n isERC1155,\n isMarketLoading = false,\n myListing,\n activeBids,\n walletAddress,\n remixEnabled = false,\n showDealOption = false,\n floorPriceRaw,\n lastSaleRaw,\n renderAuthAction,\n renderHelp,\n onCancelClick,\n onAcceptBid,\n onOpenListing,\n onOpenTransfer,\n onOpenPurchase,\n onOpenOffer,\n onOpenRemix,\n onProposeDeal,\n}: AssetMarketplacePanelProps<T>) {\n const myBid = !isOwner && walletAddress\n ? activeBids.find((bid) => bid.offerer.toLowerCase() === walletAddress.toLowerCase()) ?? null\n : null;\n\n const canBuyMore =\n isERC1155 && isOwner && !!cheapest && !!walletAddress &&\n cheapest.offerer.toLowerCase() !== walletAddress.toLowerCase();\n\n if (isMarketLoading && !cheapest) {\n return (\n <div className=\"space-y-4\">\n <div className=\"h-9 w-32 rounded-md bg-muted animate-pulse\" />\n <div className=\"h-12 w-full rounded-2xl bg-muted animate-pulse\" />\n </div>\n );\n }\n\n return (\n <div className=\"relative\">\n {/* soft brand light-leak behind the trade zone — no hard border, per §III */}\n <div\n aria-hidden\n className=\"aurora-purple pointer-events-none\"\n style={{ position: \"absolute\", width: 280, height: 280, top: -60, left: \"20%\" }}\n />\n <div className=\"relative space-y-4\">\n {cheapest ? (\n <div className=\"space-y-4\">\n <div className=\"flex items-baseline gap-2\">\n <CurrencyIcon symbol={cheapest.price.currency ?? \"\"} size={26} />\n <span className=\"text-4xl font-bold tracking-tight\">\n {formatDisplayPrice(cheapest.price.formatted)}\n </span>\n {renderHelp(\n `${isOwner && !canBuyMore ? \"Your listing\" : \"Current price\"} · Expires ${timeUntil(cheapest.endTime)}`\n )}\n </div>\n\n <StatRow floorPriceRaw={floorPriceRaw} lastSaleRaw={lastSaleRaw} />\n\n {isOwner ? (\n <div className=\"space-y-2\">\n <div className=\"grid grid-cols-2 gap-2\">\n {myListing ? (\n <ActionButton\n label=\"Cancel\"\n icon={isProcessing ? <Loader2 className=\"h-4 w-4 animate-spin\" /> : <X className=\"h-4 w-4\" />}\n onClick={() => onCancelClick(myListing)}\n disabled={isProcessing}\n tone=\"destructive\"\n renderHelp={renderHelp}\n />\n ) : null}\n <ActionButton label=\"List\" icon={<Tag className=\"h-4 w-4\" />} onClick={onOpenListing} tone=\"blue\" renderHelp={renderHelp} />\n <ActionButton label=\"Transfer\" icon={<ArrowRightLeft className=\"h-4 w-4\" />} onClick={onOpenTransfer} tone=\"orange\" renderHelp={renderHelp} />\n {remixEnabled && onOpenRemix ? (\n <ActionButton\n label=\"Remix\"\n icon={<GitBranch className=\"h-4 w-4\" />}\n onClick={onOpenRemix}\n helpContent=\"Build a licensed derivative of this digital asset — your remix is minted as a new onchain NFT linked to the original\"\n tone=\"purple\"\n renderHelp={renderHelp}\n />\n ) : null}\n </div>\n\n {canBuyMore && (\n <>\n <div className=\"border-t border-border/40 pt-2 mt-1\" />\n <div className=\"grid grid-cols-2 gap-2\">\n <ActionButton label=\"Buy\" icon={<ShoppingCart className=\"h-4 w-4\" />} onClick={() => onOpenPurchase(cheapest!)} tone=\"transparent\" renderHelp={renderHelp} />\n <ActionButton label=\"Make offer\" icon={<HandCoins className=\"h-4 w-4\" />} onClick={onOpenOffer} tone=\"orange\" renderHelp={renderHelp} />\n </div>\n </>\n )}\n </div>\n ) : isSignedIn ? (\n <>\n <div className=\"grid grid-cols-2 gap-2\">\n <ActionButton label=\"Buy\" icon={<ShoppingCart className=\"h-4 w-4\" />} onClick={() => onOpenPurchase(cheapest)} tone=\"transparent\" renderHelp={renderHelp} />\n <ActionButton label=\"Make offer\" icon={<HandCoins className=\"h-4 w-4\" />} onClick={onOpenOffer} tone=\"orange\" renderHelp={renderHelp} />\n {remixEnabled && onOpenRemix ? (\n <ActionButton\n label=\"Remix\"\n icon={<GitBranch className=\"h-4 w-4\" />}\n onClick={onOpenRemix}\n helpContent=\"Create your own attributed derivative of this work.\"\n tone=\"purple\"\n renderHelp={renderHelp}\n />\n ) : null}\n {showDealOption && onProposeDeal ? (\n <ActionButton\n label=\"License\"\n icon={<HandCoins className=\"h-4 w-4\" />}\n onClick={onProposeDeal}\n helpContent=\"Propose a license deal to the creator to use this work.\"\n tone=\"blue\"\n renderHelp={renderHelp}\n />\n ) : null}\n </div>\n {!remixEnabled && !showDealOption ? (\n <p className=\"text-xs text-muted-foreground mt-2 leading-relaxed\">\n The creator marked this asset as no-derivatives.\n </p>\n ) : null}\n </>\n ) : (\n renderAuthAction(\"Sign in to trade\")\n )}\n </div>\n ) : (\n <div className=\"space-y-3\">\n <StatRow floorPriceRaw={floorPriceRaw} lastSaleRaw={lastSaleRaw} />\n {isOwner ? (\n <div className=\"grid grid-cols-2 gap-2\">\n <ActionButton label=\"List\" icon={<Tag className=\"h-4 w-4\" />} onClick={onOpenListing} tone=\"transparent\" renderHelp={renderHelp} />\n <ActionButton label=\"Transfer\" icon={<ArrowRightLeft className=\"h-4 w-4\" />} onClick={onOpenTransfer} tone=\"orange\" renderHelp={renderHelp} />\n {remixEnabled && onOpenRemix ? (\n <ActionButton\n label=\"Remix\"\n icon={<GitBranch className=\"h-4 w-4\" />}\n onClick={onOpenRemix}\n helpContent=\"Build a licensed derivative of this digital asset — your remix is minted as a new onchain NFT linked to the original\"\n tone=\"purple\"\n renderHelp={renderHelp}\n />\n ) : null}\n </div>\n ) : isSignedIn ? (\n <div className=\"grid grid-cols-2 gap-2\">\n <ActionButton label=\"Make offer\" icon={<HandCoins className=\"h-4 w-4\" />} onClick={onOpenOffer} tone=\"orange\" renderHelp={renderHelp} />\n {remixEnabled && onOpenRemix ? (\n <ActionButton\n label=\"Remix\"\n icon={<GitBranch className=\"h-4 w-4\" />}\n onClick={onOpenRemix}\n helpContent=\"Build a licensed derivative of this digital asset — your remix is minted as a new onchain NFT linked to the original\"\n tone=\"purple\"\n renderHelp={renderHelp}\n />\n ) : null}\n </div>\n ) : (\n renderAuthAction(\"Sign in to make an offer\")\n )}\n </div>\n )}\n\n {myBid ? (\n <div className=\"rounded-xl bg-amber-500/8 px-4 py-3 flex items-center justify-between gap-3\">\n <div className=\"min-w-0 flex items-center gap-2.5\">\n <HandCoins className=\"h-4 w-4 text-amber-500 shrink-0\" />\n <div className=\"min-w-0\">\n <p className=\"text-xs font-semibold text-amber-500\">Your active offer</p>\n <p className=\"text-xs text-muted-foreground flex items-center gap-1.5 mt-0.5\">\n <span className=\"font-bold text-foreground inline-flex items-center gap-1\">\n {formatDisplayPrice(myBid.price.formatted)}\n <CurrencyIcon symbol={myBid.price.currency ?? \"\"} size={12} />\n </span>\n <span>·</span>\n <Clock className=\"h-3 w-3\" />\n {timeUntil(myBid.endTime)}\n </p>\n </div>\n </div>\n <button\n className=\"shrink-0 text-xs font-semibold text-red-400 hover:text-red-300 transition-colors flex items-center gap-1\"\n onClick={() => onCancelClick(myBid)}\n >\n <X className=\"h-3.5 w-3.5\" />\n Cancel\n </button>\n </div>\n ) : null}\n\n {isOwner && activeBids.length > 0 ? (\n <div className=\"rounded-xl bg-card/40 p-5 space-y-3\">\n <p className=\"text-xs font-semibold uppercase tracking-wider text-muted-foreground\">\n Incoming offers ({activeBids.length})\n </p>\n <div className=\"space-y-2\">\n {activeBids.map((bid) => (\n <div key={bid.orderHash} className=\"flex items-center justify-between gap-3 rounded-lg bg-muted/30 px-3 py-2\">\n <div className=\"min-w-0\">\n <p className=\"text-sm font-bold\">\n <span className=\"inline-flex items-center gap-1.5\">\n {formatDisplayPrice(bid.price.formatted)}\n <CurrencyIcon symbol={bid.price.currency ?? \"\"} size={14} />\n </span>\n </p>\n <div className=\"flex items-center gap-2 mt-0.5\">\n <AddressDisplay address={bid.offerer} chars={4} showCopy={false} className=\"text-xs text-muted-foreground\" />\n <span className=\"text-xs text-muted-foreground\">·</span>\n <div className=\"flex items-center gap-1 text-xs text-muted-foreground\">\n <Clock className=\"h-3 w-3\" />\n {timeUntil(bid.endTime)}\n </div>\n </div>\n </div>\n <button\n disabled={isProcessing}\n onClick={() => onAcceptBid(bid)}\n className=\"inline-flex items-center gap-1.5 rounded-lg bg-primary px-3 py-1.5 text-xs font-semibold text-primary-foreground disabled:opacity-50\"\n >\n <CheckCircle className=\"h-3.5 w-3.5\" />\n Accept\n </button>\n </div>\n ))}\n </div>\n </div>\n ) : null}\n </div>\n </div>\n );\n}\n"],"mappings":";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