@medialane/ui 0.110.0 → 0.112.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.
- package/dist/components/asset-marketplace-panel.cjs +45 -16
- package/dist/components/asset-marketplace-panel.cjs.map +1 -1
- package/dist/components/asset-marketplace-panel.d.cts +5 -3
- package/dist/components/asset-marketplace-panel.d.ts +5 -3
- package/dist/components/asset-marketplace-panel.js +46 -17
- package/dist/components/asset-marketplace-panel.js.map +1 -1
- package/dist/components/listing-card.cjs +25 -11
- package/dist/components/listing-card.cjs.map +1 -1
- package/dist/components/listing-card.js +27 -13
- package/dist/components/listing-card.js.map +1 -1
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/utils/format.cjs +5 -0
- package/dist/utils/format.cjs.map +1 -1
- package/dist/utils/format.d.cts +5 -1
- package/dist/utils/format.d.ts +5 -1
- package/dist/utils/format.js +4 -0
- package/dist/utils/format.js.map +1 -1
- package/package.json +1 -1
|
@@ -44,6 +44,40 @@ function StatRow({ floorPriceRaw, lastSaleRaw }) {
|
|
|
44
44
|
] })
|
|
45
45
|
] });
|
|
46
46
|
}
|
|
47
|
+
function CoinChip({ symbol, size }) {
|
|
48
|
+
const wrap = size === "md" ? "h-7 w-7" : "h-6 w-6";
|
|
49
|
+
const icon = size === "md" ? 16 : 13;
|
|
50
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: `grid ${wrap} shrink-0 place-items-center rounded-full bg-foreground/[0.06]`, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_currency_icon.CurrencyIcon, { symbol: symbol ?? "", size: icon }) });
|
|
51
|
+
}
|
|
52
|
+
function PrimaryPrice({
|
|
53
|
+
amountFormatted,
|
|
54
|
+
currency,
|
|
55
|
+
usdValue,
|
|
56
|
+
trailing
|
|
57
|
+
}) {
|
|
58
|
+
const cryptoDisplay = (0, import_format.formatDisplayPrice)(amountFormatted);
|
|
59
|
+
const displayFace = "font-[family-name:var(--font-display)] font-extrabold tracking-tight tabular-nums";
|
|
60
|
+
if (!usdValue) {
|
|
61
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-2.5", children: [
|
|
62
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(CoinChip, { symbol: currency, size: "md" }),
|
|
63
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: `${displayFace} text-4xl`, children: cryptoDisplay }),
|
|
64
|
+
trailing && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "ml-0.5", children: trailing })
|
|
65
|
+
] });
|
|
66
|
+
}
|
|
67
|
+
const stable = (0, import_format.isStableCurrency)(currency);
|
|
68
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-4", children: [
|
|
69
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: `${displayFace} text-4xl`, children: usdValue }),
|
|
70
|
+
!stable && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "h-7 w-px bg-border/60 shrink-0" }),
|
|
71
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "inline-flex items-center gap-2", children: [
|
|
72
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(CoinChip, { symbol: currency, size: stable ? "sm" : "md" }),
|
|
73
|
+
stable ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-sm font-semibold text-muted-foreground", children: currency }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "flex items-baseline gap-1.5", children: [
|
|
74
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: `${displayFace} text-2xl text-foreground/90`, children: cryptoDisplay }),
|
|
75
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-sm font-semibold text-muted-foreground/70", children: currency })
|
|
76
|
+
] })
|
|
77
|
+
] }),
|
|
78
|
+
trailing && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "ml-0.5", children: trailing })
|
|
79
|
+
] });
|
|
80
|
+
}
|
|
47
81
|
function AssetMarketplacePanel({
|
|
48
82
|
cheapest,
|
|
49
83
|
isOwner,
|
|
@@ -84,22 +118,17 @@ function AssetMarketplacePanel({
|
|
|
84
118
|
}
|
|
85
119
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "relative", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "relative space-y-4", children: [
|
|
86
120
|
cheapest ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-4", children: [
|
|
87
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
)
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
usdValue
|
|
99
|
-
] })
|
|
100
|
-
] }),
|
|
101
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(StatRow, { floorPriceRaw, lastSaleRaw })
|
|
102
|
-
] }),
|
|
121
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
122
|
+
PrimaryPrice,
|
|
123
|
+
{
|
|
124
|
+
amountFormatted: cheapest.price.formatted,
|
|
125
|
+
currency: cheapest.price.currency,
|
|
126
|
+
usdValue,
|
|
127
|
+
trailing: renderHelp(
|
|
128
|
+
`${isOwner && !canBuyMore ? "Your listing" : "Current price"} \xB7 Expires ${(0, import_time.timeUntil)(cheapest.endTime)}`
|
|
129
|
+
)
|
|
130
|
+
}
|
|
131
|
+
),
|
|
103
132
|
isOwner ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-2", children: [
|
|
104
133
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "grid grid-cols-2 gap-2", children: [
|
|
105
134
|
myListing ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
@@ -1 +1 @@
|
|
|
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, Handshake, Loader2,\n ShoppingCart, Tag, X,\n} from \"lucide-react\";\nimport { CurrencyIcon, CurrencyAmount } from \"./currency-icon.js\";\nimport { AddressDisplay } from \"./address-display.js\";\nimport { ActionButton } from \"./action-button.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\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 /**\n * Pre-formatted USD equivalent of `cheapest.price` (e.g. \"$12.34\"), computed\n * by the host from its own live rate feed — this package has no price-feed\n * access by design. Omit (or pass null) to render no USD line.\n */\n usdValue?: 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 /** Non-owner: propose a sponsorship deal on this asset. */\n showSponsorOption?: boolean;\n onOpenSponsorProposal?: () => void;\n /** Owner: open this asset for sponsorship bidding. */\n showSponsorSolicitOption?: boolean;\n onOpenSponsorSolicit?: () => void;\n}\n\n/** Floor + last-sale stats — each hides itself when its data is absent\n * (no dangling \"—\" placeholders), and the whole row disappears when\n * neither is available. */\nfunction StatRow({ floorPriceRaw, lastSaleRaw }: { floorPriceRaw?: string | null; lastSaleRaw?: string | null }) {\n const floor = floorPriceRaw ? parsePriceDisplay(floorPriceRaw) : null;\n const lastSale = lastSaleRaw ? parsePriceDisplay(lastSaleRaw) : null;\n if (!floor?.symbol && !lastSale?.symbol) return null;\n return (\n <div className=\"flex items-center gap-4 text-sm text-muted-foreground\">\n {floor?.symbol && (\n <span className=\"flex items-center gap-1.5\">\n <span>Floor</span>\n <CurrencyAmount amount={floor.numStr} symbol={floor.symbol} iconSize={12} amountClassName=\"text-foreground font-semibold\" />\n </span>\n )}\n {lastSale?.symbol && (\n <span className=\"flex items-center gap-1.5\">\n <span>Last sale</span>\n <CurrencyAmount amount={lastSale.numStr} symbol={lastSale.symbol} iconSize={12} amountClassName=\"text-foreground font-semibold\" />\n </span>\n )}\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 showSponsorOption = false,\n onOpenSponsorProposal,\n showSponsorSolicitOption = false,\n onOpenSponsorSolicit,\n floorPriceRaw,\n lastSaleRaw,\n usdValue,\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\n <div className=\"relative space-y-4\">\n {cheapest ? (\n <div className=\"space-y-4\">\n <div className=\"flex flex-wrap items-baseline gap-x-5 gap-y-1.5\">\n <div>\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 {usdValue && <p className=\"text-sm text-muted-foreground mt-0.5\">≈ {usdValue}</p>}\n </div>\n <StatRow floorPriceRaw={floorPriceRaw} lastSaleRaw={lastSaleRaw} />\n </div>\n\n {isOwner ? (\n <div className=\"space-y-2\">\n <div className=\"grid grid-cols-2 gap-2\">\n {myListing ? (\n <ActionButton big\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=\"red\"\n renderHelp={renderHelp}\n >\n Cancel Listing\n </ActionButton>\n ) : null}\n {/* ERC-721 has exactly one possible listing — once myListing exists,\n \"List on Marketplace\" is redundant next to \"Cancel Listing\" and\n reads as a broken/confusing pair. An ERC-1155 owner can still hold\n un-listed editions while one listing is active, so it stays for them. */}\n {(!myListing || isERC1155) ? (\n <ActionButton big tone=\"blue\" icon={<Tag className=\"h-4 w-4\" />} onClick={onOpenListing} renderHelp={renderHelp}>List on Marketplace</ActionButton>\n ) : null}\n <ActionButton big tone=\"orange\" icon={<ArrowRightLeft className=\"h-4 w-4\" />} onClick={onOpenTransfer} renderHelp={renderHelp}>Transfer</ActionButton>\n {remixEnabled && onOpenRemix ? (\n <ActionButton big\n action=\"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 renderHelp={renderHelp}\n >\n Remix\n </ActionButton>\n ) : null}\n {showSponsorSolicitOption && onOpenSponsorSolicit ? (\n <ActionButton big\n tone=\"blue\"\n icon={<Handshake className=\"h-4 w-4\" />}\n onClick={onOpenSponsorSolicit}\n helpContent=\"Let sponsors bid on a license for this asset.\"\n renderHelp={renderHelp}\n >\n Open for Sponsorship\n </ActionButton>\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 big action=\"buy\" icon={<ShoppingCart className=\"h-4 w-4\" />} onClick={() => onOpenPurchase(cheapest!)} renderHelp={renderHelp}>Buy</ActionButton>\n <ActionButton big action=\"offer\" icon={<HandCoins className=\"h-4 w-4\" />} onClick={onOpenOffer} renderHelp={renderHelp}>Make offer</ActionButton>\n </div>\n </>\n )}\n </div>\n ) : isSignedIn ? (\n <>\n <div className=\"grid grid-cols-2 gap-2\">\n <ActionButton big action=\"buy\" icon={<ShoppingCart className=\"h-4 w-4\" />} onClick={() => onOpenPurchase(cheapest)} renderHelp={renderHelp}>Buy</ActionButton>\n <ActionButton big action=\"offer\" icon={<HandCoins className=\"h-4 w-4\" />} onClick={onOpenOffer} renderHelp={renderHelp}>Make offer</ActionButton>\n {remixEnabled && onOpenRemix ? (\n <ActionButton big\n action=\"remix\"\n icon={<GitBranch className=\"h-4 w-4\" />}\n onClick={onOpenRemix}\n helpContent=\"Create your own attributed derivative of this work.\"\n renderHelp={renderHelp}\n >\n Remix\n </ActionButton>\n ) : null}\n {showDealOption && onProposeDeal ? (\n <ActionButton big\n action=\"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 renderHelp={renderHelp}\n >\n License\n </ActionButton>\n ) : null}\n {showSponsorOption && onOpenSponsorProposal ? (\n <ActionButton big\n tone=\"blue\"\n icon={<Handshake className=\"h-4 w-4\" />}\n onClick={onOpenSponsorProposal}\n helpContent=\"Propose to sponsor this creator's work — pay them directly for a license, no escrow.\"\n renderHelp={renderHelp}\n >\n Sponsor this IP\n </ActionButton>\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 big tone=\"blue\" icon={<Tag className=\"h-4 w-4\" />} onClick={onOpenListing} renderHelp={renderHelp}>List on Marketplace</ActionButton>\n <ActionButton big tone=\"orange\" icon={<ArrowRightLeft className=\"h-4 w-4\" />} onClick={onOpenTransfer} renderHelp={renderHelp}>Transfer</ActionButton>\n {remixEnabled && onOpenRemix ? (\n <ActionButton big\n action=\"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 renderHelp={renderHelp}\n >\n Remix\n </ActionButton>\n ) : null}\n {showSponsorSolicitOption && onOpenSponsorSolicit ? (\n <ActionButton big\n tone=\"blue\"\n icon={<Handshake className=\"h-4 w-4\" />}\n onClick={onOpenSponsorSolicit}\n helpContent=\"Let sponsors bid on a license for this asset.\"\n renderHelp={renderHelp}\n >\n Open for Sponsorship\n </ActionButton>\n ) : null}\n </div>\n ) : isSignedIn ? (\n <div className=\"grid grid-cols-2 gap-2\">\n <ActionButton big action=\"offer\" icon={<HandCoins className=\"h-4 w-4\" />} onClick={onOpenOffer} renderHelp={renderHelp}>Make offer</ActionButton>\n {remixEnabled && onOpenRemix ? (\n <ActionButton big\n action=\"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 renderHelp={renderHelp}\n >\n Remix\n </ActionButton>\n ) : null}\n {showSponsorOption && onOpenSponsorProposal ? (\n <ActionButton big\n tone=\"blue\"\n icon={<Handshake className=\"h-4 w-4\" />}\n onClick={onOpenSponsorProposal}\n helpContent=\"Propose to sponsor this creator's work — pay them directly for a license, no escrow.\"\n renderHelp={renderHelp}\n >\n Sponsor this IP\n </ActionButton>\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 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":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAwEQ;AArER,0BAGO;AACP,2BAA6C;AAC7C,6BAA+B;AAC/B,2BAA6B;AAC7B,oBAAsD;AACtD,kBAA0B;AAsD1B,SAAS,QAAQ,EAAE,eAAe,YAAY,GAAmE;AAC/G,QAAM,QAAQ,oBAAgB,iCAAkB,aAAa,IAAI;AACjE,QAAM,WAAW,kBAAc,iCAAkB,WAAW,IAAI;AAChE,MAAI,CAAC,OAA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C,yBAAE,WAAU,eAAc;AAAA,YAAE;AAAA;AAAA;AAAA,MAE/B;AAAA,OACF,IACE;AAAA,IAEH,WAAW,WAAW,SAAS,IAC9B,6CAAC,SAAI,WAAU,uCACb;AAAA,mDAAC,OAAE,WAAU,+CAA8C;AAAA;AAAA,QACvC,WAAW;AAAA,QAAO;AAAA,SACtC;AAAA,MACA,4CAAC,SAAI,WAAU,aACZ,qBAAW,IAAI,CAAC,QACf,6CAAC,SAAwB,WAAU,4EACjC;AAAA,qDAAC,SAAI,WAAU,WACb;AAAA,sDAAC,OAAE,WAAU,qBACX,uDAAC,UAAK,WAAU,oCACb;AAAA,kDAAmB,IAAI,MAAM,SAAS;AAAA,YACvC,4CAAC,qCAAa,QAAQ,IAAI,MAAM,YAAY,IAAI,MAAM,IAAI;AAAA,aAC5D,GACF;AAAA,UACA,6CAAC,SAAI,WAAU,kCACb;AAAA,wDAAC,yCAAe,SAAS,IAAI,SAAS,OAAO,GAAG,UAAU,OAAO,WAAU,iCAAgC;AAAA,YAC3G,4CAAC,UAAK,WAAU,iCAAgC,kBAAC;AAAA,YACjD,6CAAC,SAAI,WAAU,yDACb;AAAA,0DAAC,6BAAM,WAAU,WAAU;AAAA,kBAC1B,uBAAU,IAAI,OAAO;AAAA,eACxB;AAAA,aACF;AAAA,WACF;AAAA,QACA;AAAA,UAAC;AAAA;AAAA,YACC,UAAU;AAAA,YACV,SAAS,MAAM,YAAY,GAAG;AAAA,YAC9B,WAAU;AAAA,YAEV;AAAA,0DAAC,mCAAY,WAAU,eAAc;AAAA,cAAE;AAAA;AAAA;AAAA,QAEzC;AAAA,WAxBQ,IAAI,SAyBd,CACD,GACH;AAAA,OACF,IACE;AAAA,KACN,GACF;AAEJ;","names":[]}
|
|
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, Handshake, Loader2,\n ShoppingCart, Tag, X,\n} from \"lucide-react\";\nimport { CurrencyIcon, CurrencyAmount } from \"./currency-icon.js\";\nimport { AddressDisplay } from \"./address-display.js\";\nimport { ActionButton } from \"./action-button.js\";\nimport { formatDisplayPrice, parsePriceDisplay, isStableCurrency } 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\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 /**\n * Pre-formatted USD equivalent of `cheapest.price` (e.g. \"$12.34\"), computed\n * by the host from its own live rate feed — this package has no price-feed\n * access by design. Omit (or pass null) to render no USD line.\n */\n usdValue?: 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 /** Non-owner: propose a sponsorship deal on this asset. */\n showSponsorOption?: boolean;\n onOpenSponsorProposal?: () => void;\n /** Owner: open this asset for sponsorship bidding. */\n showSponsorSolicitOption?: boolean;\n onOpenSponsorSolicit?: () => void;\n /** Raw \"0.07 STRK\"-style strings — already resolved by the caller. Shown\n * only in the \"not currently listed\" fallback state (see StatRow) — the\n * active-listing price row dropped them to stay uncluttered. */\n floorPriceRaw?: string | null;\n lastSaleRaw?: string | null;\n}\n\n/** Floor + last-sale stats — each hides itself when its data is absent\n * (no dangling \"—\" placeholders), and the whole row disappears when\n * neither is available. Only used in the \"not currently listed\" state. */\nfunction StatRow({ floorPriceRaw, lastSaleRaw }: { floorPriceRaw?: string | null; lastSaleRaw?: string | null }) {\n const floor = floorPriceRaw ? parsePriceDisplay(floorPriceRaw) : null;\n const lastSale = lastSaleRaw ? parsePriceDisplay(lastSaleRaw) : null;\n if (!floor?.symbol && !lastSale?.symbol) return null;\n return (\n <div className=\"flex items-center gap-4 text-sm text-muted-foreground\">\n {floor?.symbol && (\n <span className=\"flex items-center gap-1.5\">\n <span>Floor</span>\n <CurrencyAmount amount={floor.numStr} symbol={floor.symbol} iconSize={12} amountClassName=\"text-foreground font-semibold\" />\n </span>\n )}\n {lastSale?.symbol && (\n <span className=\"flex items-center gap-1.5\">\n <span>Last sale</span>\n <CurrencyAmount amount={lastSale.numStr} symbol={lastSale.symbol} iconSize={12} amountClassName=\"text-foreground font-semibold\" />\n </span>\n )}\n </div>\n );\n}\n\n/** A currency icon in the soft circular chip used throughout the wallet UI —\n * reads as a coin, not a stray glyph floating next to text. */\nfunction CoinChip({ symbol, size }: { symbol: string | null; size: \"md\" | \"sm\" }) {\n const wrap = size === \"md\" ? \"h-7 w-7\" : \"h-6 w-6\";\n const icon = size === \"md\" ? 16 : 13;\n return (\n <span className={`grid ${wrap} shrink-0 place-items-center rounded-full bg-foreground/[0.06]`}>\n <CurrencyIcon symbol={symbol ?? \"\"} size={icon} />\n </span>\n );\n}\n\n/**\n * Dual price: fiat and the on-chain currency shown as equal-weight peers,\n * not primary/afterthought — io's audience spans non-crypto newcomers who\n * read fiat and crypto-native buyers who read the token amount. Both use\n * the brand display face at a real step-down in scale (4xl → 2xl) so the\n * pairing reads as \"two related numbers,\" not one dominant + one caption.\n * Falls back to crypto-only when no USD rate is available. When the\n * order's currency is itself a USD-pegged stablecoin, the crypto amount\n * collapses to a small currency badge — showing \"$12.00\" beside \"12.00\n * USDC\" would just be the same number twice.\n */\nfunction PrimaryPrice({\n amountFormatted,\n currency,\n usdValue,\n trailing,\n}: {\n amountFormatted: string | null;\n currency: string | null;\n usdValue?: string | null;\n trailing?: ReactNode;\n}) {\n const cryptoDisplay = formatDisplayPrice(amountFormatted);\n const displayFace = \"font-[family-name:var(--font-display)] font-extrabold tracking-tight tabular-nums\";\n\n if (!usdValue) {\n return (\n <div className=\"flex items-center gap-2.5\">\n <CoinChip symbol={currency} size=\"md\" />\n <span className={`${displayFace} text-4xl`}>{cryptoDisplay}</span>\n {trailing && <span className=\"ml-0.5\">{trailing}</span>}\n </div>\n );\n }\n\n const stable = isStableCurrency(currency);\n return (\n <div className=\"flex items-center gap-4\">\n <span className={`${displayFace} text-4xl`}>{usdValue}</span>\n {!stable && <span className=\"h-7 w-px bg-border/60 shrink-0\" />}\n <span className=\"inline-flex items-center gap-2\">\n <CoinChip symbol={currency} size={stable ? \"sm\" : \"md\"} />\n {stable ? (\n <span className=\"text-sm font-semibold text-muted-foreground\">{currency}</span>\n ) : (\n <span className=\"flex items-baseline gap-1.5\">\n <span className={`${displayFace} text-2xl text-foreground/90`}>{cryptoDisplay}</span>\n <span className=\"text-sm font-semibold text-muted-foreground/70\">{currency}</span>\n </span>\n )}\n </span>\n {trailing && <span className=\"ml-0.5\">{trailing}</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 showSponsorOption = false,\n onOpenSponsorProposal,\n showSponsorSolicitOption = false,\n onOpenSponsorSolicit,\n floorPriceRaw,\n lastSaleRaw,\n usdValue,\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\n <div className=\"relative space-y-4\">\n {cheapest ? (\n <div className=\"space-y-4\">\n <PrimaryPrice\n amountFormatted={cheapest.price.formatted}\n currency={cheapest.price.currency}\n usdValue={usdValue}\n trailing={renderHelp(\n `${isOwner && !canBuyMore ? \"Your listing\" : \"Current price\"} · Expires ${timeUntil(cheapest.endTime)}`\n )}\n />\n\n {isOwner ? (\n <div className=\"space-y-2\">\n <div className=\"grid grid-cols-2 gap-2\">\n {myListing ? (\n <ActionButton big\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=\"red\"\n renderHelp={renderHelp}\n >\n Cancel Listing\n </ActionButton>\n ) : null}\n {/* ERC-721 has exactly one possible listing — once myListing exists,\n \"List on Marketplace\" is redundant next to \"Cancel Listing\" and\n reads as a broken/confusing pair. An ERC-1155 owner can still hold\n un-listed editions while one listing is active, so it stays for them. */}\n {(!myListing || isERC1155) ? (\n <ActionButton big tone=\"blue\" icon={<Tag className=\"h-4 w-4\" />} onClick={onOpenListing} renderHelp={renderHelp}>List on Marketplace</ActionButton>\n ) : null}\n <ActionButton big tone=\"orange\" icon={<ArrowRightLeft className=\"h-4 w-4\" />} onClick={onOpenTransfer} renderHelp={renderHelp}>Transfer</ActionButton>\n {remixEnabled && onOpenRemix ? (\n <ActionButton big\n action=\"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 renderHelp={renderHelp}\n >\n Remix\n </ActionButton>\n ) : null}\n {showSponsorSolicitOption && onOpenSponsorSolicit ? (\n <ActionButton big\n tone=\"blue\"\n icon={<Handshake className=\"h-4 w-4\" />}\n onClick={onOpenSponsorSolicit}\n helpContent=\"Let sponsors bid on a license for this asset.\"\n renderHelp={renderHelp}\n >\n Open for Sponsorship\n </ActionButton>\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 big action=\"buy\" icon={<ShoppingCart className=\"h-4 w-4\" />} onClick={() => onOpenPurchase(cheapest!)} renderHelp={renderHelp}>Buy</ActionButton>\n <ActionButton big action=\"offer\" icon={<HandCoins className=\"h-4 w-4\" />} onClick={onOpenOffer} renderHelp={renderHelp}>Make offer</ActionButton>\n </div>\n </>\n )}\n </div>\n ) : isSignedIn ? (\n <>\n <div className=\"grid grid-cols-2 gap-2\">\n <ActionButton big action=\"buy\" icon={<ShoppingCart className=\"h-4 w-4\" />} onClick={() => onOpenPurchase(cheapest)} renderHelp={renderHelp}>Buy</ActionButton>\n <ActionButton big action=\"offer\" icon={<HandCoins className=\"h-4 w-4\" />} onClick={onOpenOffer} renderHelp={renderHelp}>Make offer</ActionButton>\n {remixEnabled && onOpenRemix ? (\n <ActionButton big\n action=\"remix\"\n icon={<GitBranch className=\"h-4 w-4\" />}\n onClick={onOpenRemix}\n helpContent=\"Create your own attributed derivative of this work.\"\n renderHelp={renderHelp}\n >\n Remix\n </ActionButton>\n ) : null}\n {showDealOption && onProposeDeal ? (\n <ActionButton big\n action=\"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 renderHelp={renderHelp}\n >\n License\n </ActionButton>\n ) : null}\n {showSponsorOption && onOpenSponsorProposal ? (\n <ActionButton big\n tone=\"blue\"\n icon={<Handshake className=\"h-4 w-4\" />}\n onClick={onOpenSponsorProposal}\n helpContent=\"Propose to sponsor this creator's work — pay them directly for a license, no escrow.\"\n renderHelp={renderHelp}\n >\n Sponsor this IP\n </ActionButton>\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 big tone=\"blue\" icon={<Tag className=\"h-4 w-4\" />} onClick={onOpenListing} renderHelp={renderHelp}>List on Marketplace</ActionButton>\n <ActionButton big tone=\"orange\" icon={<ArrowRightLeft className=\"h-4 w-4\" />} onClick={onOpenTransfer} renderHelp={renderHelp}>Transfer</ActionButton>\n {remixEnabled && onOpenRemix ? (\n <ActionButton big\n action=\"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 renderHelp={renderHelp}\n >\n Remix\n </ActionButton>\n ) : null}\n {showSponsorSolicitOption && onOpenSponsorSolicit ? (\n <ActionButton big\n tone=\"blue\"\n icon={<Handshake className=\"h-4 w-4\" />}\n onClick={onOpenSponsorSolicit}\n helpContent=\"Let sponsors bid on a license for this asset.\"\n renderHelp={renderHelp}\n >\n Open for Sponsorship\n </ActionButton>\n ) : null}\n </div>\n ) : isSignedIn ? (\n <div className=\"grid grid-cols-2 gap-2\">\n <ActionButton big action=\"offer\" icon={<HandCoins className=\"h-4 w-4\" />} onClick={onOpenOffer} renderHelp={renderHelp}>Make offer</ActionButton>\n {remixEnabled && onOpenRemix ? (\n <ActionButton big\n action=\"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 renderHelp={renderHelp}\n >\n Remix\n </ActionButton>\n ) : null}\n {showSponsorOption && onOpenSponsorProposal ? (\n <ActionButton big\n tone=\"blue\"\n icon={<Handshake className=\"h-4 w-4\" />}\n onClick={onOpenSponsorProposal}\n helpContent=\"Propose to sponsor this creator's work — pay them directly for a license, no escrow.\"\n renderHelp={renderHelp}\n >\n Sponsor this IP\n </ActionButton>\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 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":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA0EQ;AAvER,0BAGO;AACP,2BAA6C;AAC7C,6BAA+B;AAC/B,2BAA6B;AAC7B,oBAAwE;AACxE,kBAA0B;AAwD1B,SAAS,QAAQ,EAAE,eAAe,YAAY,GAAmE;AAC/G,QAAM,QAAQ,oBAAgB,iCAAkB,aAAa,IAAI;AACjE,QAAM,WAAW,kBAAc,iCAAkB,WAAW,IAAI;AAChE,MAAI,CAAC,OAAO,UAAU,CAAC,UAAU,OAAQ,QAAO;AAChD,SACE,6CAAC,SAAI,WAAU,yDACZ;AAAA,WAAO,UACN,6CAAC,UAAK,WAAU,6BACd;AAAA,kDAAC,UAAK,mBAAK;AAAA,MACX,4CAAC,uCAAe,QAAQ,MAAM,QAAQ,QAAQ,MAAM,QAAQ,UAAU,IAAI,iBAAgB,iCAAgC;AAAA,OAC5H;AAAA,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AAG,UAAU,OAAO,WAAU,iCAAgC;AAAA,YAC3G,4CAAC,UAAK,WAAU,iCAAgC,kBAAC;AAAA,YACjD,6CAAC,SAAI,WAAU,yDACb;AAAA,0DAAC,6BAAM,WAAU,WAAU;AAAA,kBAC1B,uBAAU,IAAI,OAAO;AAAA,eACxB;AAAA,aACF;AAAA,WACF;AAAA,QACA;AAAA,UAAC;AAAA;AAAA,YACC,UAAU;AAAA,YACV,SAAS,MAAM,YAAY,GAAG;AAAA,YAC9B,WAAU;AAAA,YAEV;AAAA,0DAAC,mCAAY,WAAU,eAAc;AAAA,cAAE;AAAA;AAAA;AAAA,QAEzC;AAAA,WAxBQ,IAAI,SAyBd,CACD,GACH;AAAA,OACF,IACE;AAAA,KACN,GACF;AAEJ;","names":[]}
|
|
@@ -23,9 +23,6 @@ interface AssetMarketplacePanelProps<T extends ApiOrderLike = ApiOrderLike> {
|
|
|
23
23
|
walletAddress?: string | null;
|
|
24
24
|
remixEnabled?: boolean;
|
|
25
25
|
showDealOption?: boolean;
|
|
26
|
-
/** Raw "0.07 STRK"-style strings — already resolved by the caller. `null`/undefined renders "—". */
|
|
27
|
-
floorPriceRaw?: string | null;
|
|
28
|
-
lastSaleRaw?: string | null;
|
|
29
26
|
/**
|
|
30
27
|
* Pre-formatted USD equivalent of `cheapest.price` (e.g. "$12.34"), computed
|
|
31
28
|
* by the host from its own live rate feed — this package has no price-feed
|
|
@@ -50,6 +47,11 @@ interface AssetMarketplacePanelProps<T extends ApiOrderLike = ApiOrderLike> {
|
|
|
50
47
|
/** Owner: open this asset for sponsorship bidding. */
|
|
51
48
|
showSponsorSolicitOption?: boolean;
|
|
52
49
|
onOpenSponsorSolicit?: () => void;
|
|
50
|
+
/** Raw "0.07 STRK"-style strings — already resolved by the caller. Shown
|
|
51
|
+
* only in the "not currently listed" fallback state (see StatRow) — the
|
|
52
|
+
* active-listing price row dropped them to stay uncluttered. */
|
|
53
|
+
floorPriceRaw?: string | null;
|
|
54
|
+
lastSaleRaw?: string | null;
|
|
53
55
|
}
|
|
54
56
|
declare function AssetMarketplacePanel<T extends ApiOrderLike = ApiOrderLike>({ cheapest, isOwner, isSignedIn, isProcessing, isERC1155, isMarketLoading, myListing, activeBids, walletAddress, remixEnabled, showDealOption, showSponsorOption, onOpenSponsorProposal, showSponsorSolicitOption, onOpenSponsorSolicit, floorPriceRaw, lastSaleRaw, usdValue, renderAuthAction, renderHelp, onCancelClick, onAcceptBid, onOpenListing, onOpenTransfer, onOpenPurchase, onOpenOffer, onOpenRemix, onProposeDeal, }: AssetMarketplacePanelProps<T>): react_jsx_runtime.JSX.Element;
|
|
55
57
|
|
|
@@ -23,9 +23,6 @@ interface AssetMarketplacePanelProps<T extends ApiOrderLike = ApiOrderLike> {
|
|
|
23
23
|
walletAddress?: string | null;
|
|
24
24
|
remixEnabled?: boolean;
|
|
25
25
|
showDealOption?: boolean;
|
|
26
|
-
/** Raw "0.07 STRK"-style strings — already resolved by the caller. `null`/undefined renders "—". */
|
|
27
|
-
floorPriceRaw?: string | null;
|
|
28
|
-
lastSaleRaw?: string | null;
|
|
29
26
|
/**
|
|
30
27
|
* Pre-formatted USD equivalent of `cheapest.price` (e.g. "$12.34"), computed
|
|
31
28
|
* by the host from its own live rate feed — this package has no price-feed
|
|
@@ -50,6 +47,11 @@ interface AssetMarketplacePanelProps<T extends ApiOrderLike = ApiOrderLike> {
|
|
|
50
47
|
/** Owner: open this asset for sponsorship bidding. */
|
|
51
48
|
showSponsorSolicitOption?: boolean;
|
|
52
49
|
onOpenSponsorSolicit?: () => void;
|
|
50
|
+
/** Raw "0.07 STRK"-style strings — already resolved by the caller. Shown
|
|
51
|
+
* only in the "not currently listed" fallback state (see StatRow) — the
|
|
52
|
+
* active-listing price row dropped them to stay uncluttered. */
|
|
53
|
+
floorPriceRaw?: string | null;
|
|
54
|
+
lastSaleRaw?: string | null;
|
|
53
55
|
}
|
|
54
56
|
declare function AssetMarketplacePanel<T extends ApiOrderLike = ApiOrderLike>({ cheapest, isOwner, isSignedIn, isProcessing, isERC1155, isMarketLoading, myListing, activeBids, walletAddress, remixEnabled, showDealOption, showSponsorOption, onOpenSponsorProposal, showSponsorSolicitOption, onOpenSponsorSolicit, floorPriceRaw, lastSaleRaw, usdValue, renderAuthAction, renderHelp, onCancelClick, onAcceptBid, onOpenListing, onOpenTransfer, onOpenPurchase, onOpenOffer, onOpenRemix, onProposeDeal, }: AssetMarketplacePanelProps<T>): react_jsx_runtime.JSX.Element;
|
|
55
57
|
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
import { CurrencyIcon, CurrencyAmount } from "./currency-icon.js";
|
|
16
16
|
import { AddressDisplay } from "./address-display.js";
|
|
17
17
|
import { ActionButton } from "./action-button.js";
|
|
18
|
-
import { formatDisplayPrice, parsePriceDisplay } from "../utils/format.js";
|
|
18
|
+
import { formatDisplayPrice, parsePriceDisplay, isStableCurrency } from "../utils/format.js";
|
|
19
19
|
import { timeUntil } from "../utils/time.js";
|
|
20
20
|
function StatRow({ floorPriceRaw, lastSaleRaw }) {
|
|
21
21
|
const floor = floorPriceRaw ? parsePriceDisplay(floorPriceRaw) : null;
|
|
@@ -32,6 +32,40 @@ function StatRow({ floorPriceRaw, lastSaleRaw }) {
|
|
|
32
32
|
] })
|
|
33
33
|
] });
|
|
34
34
|
}
|
|
35
|
+
function CoinChip({ symbol, size }) {
|
|
36
|
+
const wrap = size === "md" ? "h-7 w-7" : "h-6 w-6";
|
|
37
|
+
const icon = size === "md" ? 16 : 13;
|
|
38
|
+
return /* @__PURE__ */ jsx("span", { className: `grid ${wrap} shrink-0 place-items-center rounded-full bg-foreground/[0.06]`, children: /* @__PURE__ */ jsx(CurrencyIcon, { symbol: symbol ?? "", size: icon }) });
|
|
39
|
+
}
|
|
40
|
+
function PrimaryPrice({
|
|
41
|
+
amountFormatted,
|
|
42
|
+
currency,
|
|
43
|
+
usdValue,
|
|
44
|
+
trailing
|
|
45
|
+
}) {
|
|
46
|
+
const cryptoDisplay = formatDisplayPrice(amountFormatted);
|
|
47
|
+
const displayFace = "font-[family-name:var(--font-display)] font-extrabold tracking-tight tabular-nums";
|
|
48
|
+
if (!usdValue) {
|
|
49
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2.5", children: [
|
|
50
|
+
/* @__PURE__ */ jsx(CoinChip, { symbol: currency, size: "md" }),
|
|
51
|
+
/* @__PURE__ */ jsx("span", { className: `${displayFace} text-4xl`, children: cryptoDisplay }),
|
|
52
|
+
trailing && /* @__PURE__ */ jsx("span", { className: "ml-0.5", children: trailing })
|
|
53
|
+
] });
|
|
54
|
+
}
|
|
55
|
+
const stable = isStableCurrency(currency);
|
|
56
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-4", children: [
|
|
57
|
+
/* @__PURE__ */ jsx("span", { className: `${displayFace} text-4xl`, children: usdValue }),
|
|
58
|
+
!stable && /* @__PURE__ */ jsx("span", { className: "h-7 w-px bg-border/60 shrink-0" }),
|
|
59
|
+
/* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-2", children: [
|
|
60
|
+
/* @__PURE__ */ jsx(CoinChip, { symbol: currency, size: stable ? "sm" : "md" }),
|
|
61
|
+
stable ? /* @__PURE__ */ jsx("span", { className: "text-sm font-semibold text-muted-foreground", children: currency }) : /* @__PURE__ */ jsxs("span", { className: "flex items-baseline gap-1.5", children: [
|
|
62
|
+
/* @__PURE__ */ jsx("span", { className: `${displayFace} text-2xl text-foreground/90`, children: cryptoDisplay }),
|
|
63
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-semibold text-muted-foreground/70", children: currency })
|
|
64
|
+
] })
|
|
65
|
+
] }),
|
|
66
|
+
trailing && /* @__PURE__ */ jsx("span", { className: "ml-0.5", children: trailing })
|
|
67
|
+
] });
|
|
68
|
+
}
|
|
35
69
|
function AssetMarketplacePanel({
|
|
36
70
|
cheapest,
|
|
37
71
|
isOwner,
|
|
@@ -72,22 +106,17 @@ function AssetMarketplacePanel({
|
|
|
72
106
|
}
|
|
73
107
|
return /* @__PURE__ */ jsx("div", { className: "relative", children: /* @__PURE__ */ jsxs("div", { className: "relative space-y-4", children: [
|
|
74
108
|
cheapest ? /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
75
|
-
/* @__PURE__ */
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
)
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
usdValue
|
|
87
|
-
] })
|
|
88
|
-
] }),
|
|
89
|
-
/* @__PURE__ */ jsx(StatRow, { floorPriceRaw, lastSaleRaw })
|
|
90
|
-
] }),
|
|
109
|
+
/* @__PURE__ */ jsx(
|
|
110
|
+
PrimaryPrice,
|
|
111
|
+
{
|
|
112
|
+
amountFormatted: cheapest.price.formatted,
|
|
113
|
+
currency: cheapest.price.currency,
|
|
114
|
+
usdValue,
|
|
115
|
+
trailing: renderHelp(
|
|
116
|
+
`${isOwner && !canBuyMore ? "Your listing" : "Current price"} \xB7 Expires ${timeUntil(cheapest.endTime)}`
|
|
117
|
+
)
|
|
118
|
+
}
|
|
119
|
+
),
|
|
91
120
|
isOwner ? /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
92
121
|
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-2", children: [
|
|
93
122
|
myListing ? /* @__PURE__ */ jsx(
|
|
@@ -1 +1 @@
|
|
|
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, Handshake, Loader2,\n ShoppingCart, Tag, X,\n} from \"lucide-react\";\nimport { CurrencyIcon, CurrencyAmount } from \"./currency-icon.js\";\nimport { AddressDisplay } from \"./address-display.js\";\nimport { ActionButton } from \"./action-button.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\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 /**\n * Pre-formatted USD equivalent of `cheapest.price` (e.g. \"$12.34\"), computed\n * by the host from its own live rate feed — this package has no price-feed\n * access by design. Omit (or pass null) to render no USD line.\n */\n usdValue?: 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 /** Non-owner: propose a sponsorship deal on this asset. */\n showSponsorOption?: boolean;\n onOpenSponsorProposal?: () => void;\n /** Owner: open this asset for sponsorship bidding. */\n showSponsorSolicitOption?: boolean;\n onOpenSponsorSolicit?: () => void;\n}\n\n/** Floor + last-sale stats — each hides itself when its data is absent\n * (no dangling \"—\" placeholders), and the whole row disappears when\n * neither is available. */\nfunction StatRow({ floorPriceRaw, lastSaleRaw }: { floorPriceRaw?: string | null; lastSaleRaw?: string | null }) {\n const floor = floorPriceRaw ? parsePriceDisplay(floorPriceRaw) : null;\n const lastSale = lastSaleRaw ? parsePriceDisplay(lastSaleRaw) : null;\n if (!floor?.symbol && !lastSale?.symbol) return null;\n return (\n <div className=\"flex items-center gap-4 text-sm text-muted-foreground\">\n {floor?.symbol && (\n <span className=\"flex items-center gap-1.5\">\n <span>Floor</span>\n <CurrencyAmount amount={floor.numStr} symbol={floor.symbol} iconSize={12} amountClassName=\"text-foreground font-semibold\" />\n </span>\n )}\n {lastSale?.symbol && (\n <span className=\"flex items-center gap-1.5\">\n <span>Last sale</span>\n <CurrencyAmount amount={lastSale.numStr} symbol={lastSale.symbol} iconSize={12} amountClassName=\"text-foreground font-semibold\" />\n </span>\n )}\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 showSponsorOption = false,\n onOpenSponsorProposal,\n showSponsorSolicitOption = false,\n onOpenSponsorSolicit,\n floorPriceRaw,\n lastSaleRaw,\n usdValue,\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\n <div className=\"relative space-y-4\">\n {cheapest ? (\n <div className=\"space-y-4\">\n <div className=\"flex flex-wrap items-baseline gap-x-5 gap-y-1.5\">\n <div>\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 {usdValue && <p className=\"text-sm text-muted-foreground mt-0.5\">≈ {usdValue}</p>}\n </div>\n <StatRow floorPriceRaw={floorPriceRaw} lastSaleRaw={lastSaleRaw} />\n </div>\n\n {isOwner ? (\n <div className=\"space-y-2\">\n <div className=\"grid grid-cols-2 gap-2\">\n {myListing ? (\n <ActionButton big\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=\"red\"\n renderHelp={renderHelp}\n >\n Cancel Listing\n </ActionButton>\n ) : null}\n {/* ERC-721 has exactly one possible listing — once myListing exists,\n \"List on Marketplace\" is redundant next to \"Cancel Listing\" and\n reads as a broken/confusing pair. An ERC-1155 owner can still hold\n un-listed editions while one listing is active, so it stays for them. */}\n {(!myListing || isERC1155) ? (\n <ActionButton big tone=\"blue\" icon={<Tag className=\"h-4 w-4\" />} onClick={onOpenListing} renderHelp={renderHelp}>List on Marketplace</ActionButton>\n ) : null}\n <ActionButton big tone=\"orange\" icon={<ArrowRightLeft className=\"h-4 w-4\" />} onClick={onOpenTransfer} renderHelp={renderHelp}>Transfer</ActionButton>\n {remixEnabled && onOpenRemix ? (\n <ActionButton big\n action=\"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 renderHelp={renderHelp}\n >\n Remix\n </ActionButton>\n ) : null}\n {showSponsorSolicitOption && onOpenSponsorSolicit ? (\n <ActionButton big\n tone=\"blue\"\n icon={<Handshake className=\"h-4 w-4\" />}\n onClick={onOpenSponsorSolicit}\n helpContent=\"Let sponsors bid on a license for this asset.\"\n renderHelp={renderHelp}\n >\n Open for Sponsorship\n </ActionButton>\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 big action=\"buy\" icon={<ShoppingCart className=\"h-4 w-4\" />} onClick={() => onOpenPurchase(cheapest!)} renderHelp={renderHelp}>Buy</ActionButton>\n <ActionButton big action=\"offer\" icon={<HandCoins className=\"h-4 w-4\" />} onClick={onOpenOffer} renderHelp={renderHelp}>Make offer</ActionButton>\n </div>\n </>\n )}\n </div>\n ) : isSignedIn ? (\n <>\n <div className=\"grid grid-cols-2 gap-2\">\n <ActionButton big action=\"buy\" icon={<ShoppingCart className=\"h-4 w-4\" />} onClick={() => onOpenPurchase(cheapest)} renderHelp={renderHelp}>Buy</ActionButton>\n <ActionButton big action=\"offer\" icon={<HandCoins className=\"h-4 w-4\" />} onClick={onOpenOffer} renderHelp={renderHelp}>Make offer</ActionButton>\n {remixEnabled && onOpenRemix ? (\n <ActionButton big\n action=\"remix\"\n icon={<GitBranch className=\"h-4 w-4\" />}\n onClick={onOpenRemix}\n helpContent=\"Create your own attributed derivative of this work.\"\n renderHelp={renderHelp}\n >\n Remix\n </ActionButton>\n ) : null}\n {showDealOption && onProposeDeal ? (\n <ActionButton big\n action=\"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 renderHelp={renderHelp}\n >\n License\n </ActionButton>\n ) : null}\n {showSponsorOption && onOpenSponsorProposal ? (\n <ActionButton big\n tone=\"blue\"\n icon={<Handshake className=\"h-4 w-4\" />}\n onClick={onOpenSponsorProposal}\n helpContent=\"Propose to sponsor this creator's work — pay them directly for a license, no escrow.\"\n renderHelp={renderHelp}\n >\n Sponsor this IP\n </ActionButton>\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 big tone=\"blue\" icon={<Tag className=\"h-4 w-4\" />} onClick={onOpenListing} renderHelp={renderHelp}>List on Marketplace</ActionButton>\n <ActionButton big tone=\"orange\" icon={<ArrowRightLeft className=\"h-4 w-4\" />} onClick={onOpenTransfer} renderHelp={renderHelp}>Transfer</ActionButton>\n {remixEnabled && onOpenRemix ? (\n <ActionButton big\n action=\"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 renderHelp={renderHelp}\n >\n Remix\n </ActionButton>\n ) : null}\n {showSponsorSolicitOption && onOpenSponsorSolicit ? (\n <ActionButton big\n tone=\"blue\"\n icon={<Handshake className=\"h-4 w-4\" />}\n onClick={onOpenSponsorSolicit}\n helpContent=\"Let sponsors bid on a license for this asset.\"\n renderHelp={renderHelp}\n >\n Open for Sponsorship\n </ActionButton>\n ) : null}\n </div>\n ) : isSignedIn ? (\n <div className=\"grid grid-cols-2 gap-2\">\n <ActionButton big action=\"offer\" icon={<HandCoins className=\"h-4 w-4\" />} onClick={onOpenOffer} renderHelp={renderHelp}>Make offer</ActionButton>\n {remixEnabled && onOpenRemix ? (\n <ActionButton big\n action=\"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 renderHelp={renderHelp}\n >\n Remix\n </ActionButton>\n ) : null}\n {showSponsorOption && onOpenSponsorProposal ? (\n <ActionButton big\n tone=\"blue\"\n icon={<Handshake className=\"h-4 w-4\" />}\n onClick={onOpenSponsorProposal}\n helpContent=\"Propose to sponsor this creator's work — pay them directly for a license, no escrow.\"\n renderHelp={renderHelp}\n >\n Sponsor this IP\n </ActionButton>\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 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":";AAwEQ,SAmIU,UAlIR,KADF;AArER;AAAA,EACE;AAAA,EAAgB;AAAA,EAAa;AAAA,EAAO;AAAA,EAAW;AAAA,EAAW;AAAA,EAAW;AAAA,EACrE;AAAA,EAAc;AAAA,EAAK;AAAA,OACd;AACP,SAAS,cAAc,sBAAsB;AAC7C,SAAS,sBAAsB;AAC/B,SAAS,oBAAoB;AAC7B,SAAS,oBAAoB,yBAAyB;AACtD,SAAS,iBAAiB;AAsD1B,SAAS,QAAQ,EAAE,eAAe,YAAY,GAAmE;AAC/G,QAAM,QAAQ,gBAAgB,kBAAkB,aAAa,IAAI;AACjE,QAAM,WAAW,cAAc,kBAAkB,WAAW,IAAI;AAChE,MAAI,CAAC,OAAO,UAAU,CAAC,UAAU,OAAQ,QAAO;AAChD,SACE,qBAAC,SAAI,WAAU,yDACZ;AAAA,WAAO,UACN,qBAAC,UAAK,WAAU,6BACd;AAAA,0BAAC,UAAK,mBAAK;AAAA,MACX,oBAAC,kBAAe,QAAQ,MAAM,QAAQ,QAAQ,MAAM,QAAQ,UAAU,IAAI,iBAAgB,iCAAgC;AAAA,OAC5H;AAAA,IAED,UAAU,UACT,qBAAC,UAAK,WAAU,6BACd;AAAA,0BAAC,UAAK,uBAAS;AA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OAAE,WAAU,qBACX,+BAAC,UAAK,WAAU,oCACb;AAAA,+BAAmB,IAAI,MAAM,SAAS;AAAA,YACvC,oBAAC,gBAAa,QAAQ,IAAI,MAAM,YAAY,IAAI,MAAM,IAAI;AAAA,aAC5D,GACF;AAAA,UACA,qBAAC,SAAI,WAAU,kCACb;AAAA,gCAAC,kBAAe,SAAS,IAAI,SAAS,OAAO,GAAG,UAAU,OAAO,WAAU,iCAAgC;AAAA,YAC3G,oBAAC,UAAK,WAAU,iCAAgC,kBAAC;AAAA,YACjD,qBAAC,SAAI,WAAU,yDACb;AAAA,kCAAC,SAAM,WAAU,WAAU;AAAA,cAC1B,UAAU,IAAI,OAAO;AAAA,eACxB;AAAA,aACF;AAAA,WACF;AAAA,QACA;AAAA,UAAC;AAAA;AAAA,YACC,UAAU;AAAA,YACV,SAAS,MAAM,YAAY,GAAG;AAAA,YAC9B,WAAU;AAAA,YAEV;AAAA,kCAAC,eAAY,WAAU,eAAc;AAAA,cAAE;AAAA;AAAA;AAAA,QAEzC;AAAA,WAxBQ,IAAI,SAyBd,CACD,GACH;AAAA,OACF,IACE;AAAA,KACN,GACF;AAEJ;","names":[]}
|
|
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, Handshake, Loader2,\n ShoppingCart, Tag, X,\n} from \"lucide-react\";\nimport { CurrencyIcon, CurrencyAmount } from \"./currency-icon.js\";\nimport { AddressDisplay } from \"./address-display.js\";\nimport { ActionButton } from \"./action-button.js\";\nimport { formatDisplayPrice, parsePriceDisplay, isStableCurrency } 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\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 /**\n * Pre-formatted USD equivalent of `cheapest.price` (e.g. \"$12.34\"), computed\n * by the host from its own live rate feed — this package has no price-feed\n * access by design. Omit (or pass null) to render no USD line.\n */\n usdValue?: 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 /** Non-owner: propose a sponsorship deal on this asset. */\n showSponsorOption?: boolean;\n onOpenSponsorProposal?: () => void;\n /** Owner: open this asset for sponsorship bidding. */\n showSponsorSolicitOption?: boolean;\n onOpenSponsorSolicit?: () => void;\n /** Raw \"0.07 STRK\"-style strings — already resolved by the caller. Shown\n * only in the \"not currently listed\" fallback state (see StatRow) — the\n * active-listing price row dropped them to stay uncluttered. */\n floorPriceRaw?: string | null;\n lastSaleRaw?: string | null;\n}\n\n/** Floor + last-sale stats — each hides itself when its data is absent\n * (no dangling \"—\" placeholders), and the whole row disappears when\n * neither is available. Only used in the \"not currently listed\" state. */\nfunction StatRow({ floorPriceRaw, lastSaleRaw }: { floorPriceRaw?: string | null; lastSaleRaw?: string | null }) {\n const floor = floorPriceRaw ? parsePriceDisplay(floorPriceRaw) : null;\n const lastSale = lastSaleRaw ? parsePriceDisplay(lastSaleRaw) : null;\n if (!floor?.symbol && !lastSale?.symbol) return null;\n return (\n <div className=\"flex items-center gap-4 text-sm text-muted-foreground\">\n {floor?.symbol && (\n <span className=\"flex items-center gap-1.5\">\n <span>Floor</span>\n <CurrencyAmount amount={floor.numStr} symbol={floor.symbol} iconSize={12} amountClassName=\"text-foreground font-semibold\" />\n </span>\n )}\n {lastSale?.symbol && (\n <span className=\"flex items-center gap-1.5\">\n <span>Last sale</span>\n <CurrencyAmount amount={lastSale.numStr} symbol={lastSale.symbol} iconSize={12} amountClassName=\"text-foreground font-semibold\" />\n </span>\n )}\n </div>\n );\n}\n\n/** A currency icon in the soft circular chip used throughout the wallet UI —\n * reads as a coin, not a stray glyph floating next to text. */\nfunction CoinChip({ symbol, size }: { symbol: string | null; size: \"md\" | \"sm\" }) {\n const wrap = size === \"md\" ? \"h-7 w-7\" : \"h-6 w-6\";\n const icon = size === \"md\" ? 16 : 13;\n return (\n <span className={`grid ${wrap} shrink-0 place-items-center rounded-full bg-foreground/[0.06]`}>\n <CurrencyIcon symbol={symbol ?? \"\"} size={icon} />\n </span>\n );\n}\n\n/**\n * Dual price: fiat and the on-chain currency shown as equal-weight peers,\n * not primary/afterthought — io's audience spans non-crypto newcomers who\n * read fiat and crypto-native buyers who read the token amount. Both use\n * the brand display face at a real step-down in scale (4xl → 2xl) so the\n * pairing reads as \"two related numbers,\" not one dominant + one caption.\n * Falls back to crypto-only when no USD rate is available. When the\n * order's currency is itself a USD-pegged stablecoin, the crypto amount\n * collapses to a small currency badge — showing \"$12.00\" beside \"12.00\n * USDC\" would just be the same number twice.\n */\nfunction PrimaryPrice({\n amountFormatted,\n currency,\n usdValue,\n trailing,\n}: {\n amountFormatted: string | null;\n currency: string | null;\n usdValue?: string | null;\n trailing?: ReactNode;\n}) {\n const cryptoDisplay = formatDisplayPrice(amountFormatted);\n const displayFace = \"font-[family-name:var(--font-display)] font-extrabold tracking-tight tabular-nums\";\n\n if (!usdValue) {\n return (\n <div className=\"flex items-center gap-2.5\">\n <CoinChip symbol={currency} size=\"md\" />\n <span className={`${displayFace} text-4xl`}>{cryptoDisplay}</span>\n {trailing && <span className=\"ml-0.5\">{trailing}</span>}\n </div>\n );\n }\n\n const stable = isStableCurrency(currency);\n return (\n <div className=\"flex items-center gap-4\">\n <span className={`${displayFace} text-4xl`}>{usdValue}</span>\n {!stable && <span className=\"h-7 w-px bg-border/60 shrink-0\" />}\n <span className=\"inline-flex items-center gap-2\">\n <CoinChip symbol={currency} size={stable ? \"sm\" : \"md\"} />\n {stable ? (\n <span className=\"text-sm font-semibold text-muted-foreground\">{currency}</span>\n ) : (\n <span className=\"flex items-baseline gap-1.5\">\n <span className={`${displayFace} text-2xl text-foreground/90`}>{cryptoDisplay}</span>\n <span className=\"text-sm font-semibold text-muted-foreground/70\">{currency}</span>\n </span>\n )}\n </span>\n {trailing && <span className=\"ml-0.5\">{trailing}</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 showSponsorOption = false,\n onOpenSponsorProposal,\n showSponsorSolicitOption = false,\n onOpenSponsorSolicit,\n floorPriceRaw,\n lastSaleRaw,\n usdValue,\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\n <div className=\"relative space-y-4\">\n {cheapest ? (\n <div className=\"space-y-4\">\n <PrimaryPrice\n amountFormatted={cheapest.price.formatted}\n currency={cheapest.price.currency}\n usdValue={usdValue}\n trailing={renderHelp(\n `${isOwner && !canBuyMore ? \"Your listing\" : \"Current price\"} · Expires ${timeUntil(cheapest.endTime)}`\n )}\n />\n\n {isOwner ? (\n <div className=\"space-y-2\">\n <div className=\"grid grid-cols-2 gap-2\">\n {myListing ? (\n <ActionButton big\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=\"red\"\n renderHelp={renderHelp}\n >\n Cancel Listing\n </ActionButton>\n ) : null}\n {/* ERC-721 has exactly one possible listing — once myListing exists,\n \"List on Marketplace\" is redundant next to \"Cancel Listing\" and\n reads as a broken/confusing pair. An ERC-1155 owner can still hold\n un-listed editions while one listing is active, so it stays for them. */}\n {(!myListing || isERC1155) ? (\n <ActionButton big tone=\"blue\" icon={<Tag className=\"h-4 w-4\" />} onClick={onOpenListing} renderHelp={renderHelp}>List on Marketplace</ActionButton>\n ) : null}\n <ActionButton big tone=\"orange\" icon={<ArrowRightLeft className=\"h-4 w-4\" />} onClick={onOpenTransfer} renderHelp={renderHelp}>Transfer</ActionButton>\n {remixEnabled && onOpenRemix ? (\n <ActionButton big\n action=\"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 renderHelp={renderHelp}\n >\n Remix\n </ActionButton>\n ) : null}\n {showSponsorSolicitOption && onOpenSponsorSolicit ? (\n <ActionButton big\n tone=\"blue\"\n icon={<Handshake className=\"h-4 w-4\" />}\n onClick={onOpenSponsorSolicit}\n helpContent=\"Let sponsors bid on a license for this asset.\"\n renderHelp={renderHelp}\n >\n Open for Sponsorship\n </ActionButton>\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 big action=\"buy\" icon={<ShoppingCart className=\"h-4 w-4\" />} onClick={() => onOpenPurchase(cheapest!)} renderHelp={renderHelp}>Buy</ActionButton>\n <ActionButton big action=\"offer\" icon={<HandCoins className=\"h-4 w-4\" />} onClick={onOpenOffer} renderHelp={renderHelp}>Make offer</ActionButton>\n </div>\n </>\n )}\n </div>\n ) : isSignedIn ? (\n <>\n <div className=\"grid grid-cols-2 gap-2\">\n <ActionButton big action=\"buy\" icon={<ShoppingCart className=\"h-4 w-4\" />} onClick={() => onOpenPurchase(cheapest)} renderHelp={renderHelp}>Buy</ActionButton>\n <ActionButton big action=\"offer\" icon={<HandCoins className=\"h-4 w-4\" />} onClick={onOpenOffer} renderHelp={renderHelp}>Make offer</ActionButton>\n {remixEnabled && onOpenRemix ? (\n <ActionButton big\n action=\"remix\"\n icon={<GitBranch className=\"h-4 w-4\" />}\n onClick={onOpenRemix}\n helpContent=\"Create your own attributed derivative of this work.\"\n renderHelp={renderHelp}\n >\n Remix\n </ActionButton>\n ) : null}\n {showDealOption && onProposeDeal ? (\n <ActionButton big\n action=\"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 renderHelp={renderHelp}\n >\n License\n </ActionButton>\n ) : null}\n {showSponsorOption && onOpenSponsorProposal ? (\n <ActionButton big\n tone=\"blue\"\n icon={<Handshake className=\"h-4 w-4\" />}\n onClick={onOpenSponsorProposal}\n helpContent=\"Propose to sponsor this creator's work — pay them directly for a license, no escrow.\"\n renderHelp={renderHelp}\n >\n Sponsor this IP\n </ActionButton>\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 big tone=\"blue\" icon={<Tag className=\"h-4 w-4\" />} onClick={onOpenListing} renderHelp={renderHelp}>List on Marketplace</ActionButton>\n <ActionButton big tone=\"orange\" icon={<ArrowRightLeft className=\"h-4 w-4\" />} onClick={onOpenTransfer} renderHelp={renderHelp}>Transfer</ActionButton>\n {remixEnabled && onOpenRemix ? (\n <ActionButton big\n action=\"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 renderHelp={renderHelp}\n >\n Remix\n </ActionButton>\n ) : null}\n {showSponsorSolicitOption && onOpenSponsorSolicit ? (\n <ActionButton big\n tone=\"blue\"\n icon={<Handshake className=\"h-4 w-4\" />}\n onClick={onOpenSponsorSolicit}\n helpContent=\"Let sponsors bid on a license for this asset.\"\n renderHelp={renderHelp}\n >\n Open for Sponsorship\n </ActionButton>\n ) : null}\n </div>\n ) : isSignedIn ? (\n <div className=\"grid grid-cols-2 gap-2\">\n <ActionButton big action=\"offer\" icon={<HandCoins className=\"h-4 w-4\" />} onClick={onOpenOffer} renderHelp={renderHelp}>Make offer</ActionButton>\n {remixEnabled && onOpenRemix ? (\n <ActionButton big\n action=\"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 renderHelp={renderHelp}\n >\n Remix\n </ActionButton>\n ) : null}\n {showSponsorOption && onOpenSponsorProposal ? (\n <ActionButton big\n tone=\"blue\"\n icon={<Handshake className=\"h-4 w-4\" />}\n onClick={onOpenSponsorProposal}\n helpContent=\"Propose to sponsor this creator's work — pay them directly for a license, no escrow.\"\n renderHelp={renderHelp}\n >\n Sponsor this IP\n </ActionButton>\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 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":";AA0EQ,SAgMU,UA/LR,KADF;AAvER;AAAA,EACE;AAAA,EAAgB;AAAA,EAAa;AAAA,EAAO;AAAA,EAAW;AAAA,EAAW;AAAA,EAAW;AAAA,EACrE;AAAA,EAAc;AAAA,EAAK;AAAA,OACd;AACP,SAAS,cAAc,sBAAsB;AAC7C,SAAS,sBAAsB;AAC/B,SAAS,oBAAoB;AAC7B,SAAS,oBAAoB,mBAAmB,wBAAwB;AACxE,SAAS,iBAAiB;AAwD1B,SAAS,QAAQ,EAAE,eAAe,YAAY,GAAmE;AAC/G,QAAM,QAAQ,gBAAgB,kBAAkB,aAAa,IAAI;AACjE,QAAM,WAAW,cAAc,kBAAkB,WAAW,IAAI;AAChE,MAAI,CAAC,OAAO,UAAU,CAAC,UAAU,OAAQ,QAAO;AAChD,SACE,qBAAC,SAAI,WAAU,yDACZ;AAAA,WAAO,UACN,qBAAC,UAAK,WAAU,6BACd;AAAA,0BAAC,UAAK,mBAAK;AAAA,MACX,oBAAC,kBAAe,QAAQ,MAAM,QAAQ,QAAQ,MAAM,QAAQ,UAAU,IAAI,iBAAgB,iCAAgC;AAAA,OAC5H;AAAA,IAED,UAAU,UACT,qBAAC,UAAK,WAAU,6BACd;AAAA,0BAAC,UAAK,uBAAS;AAAA,MACf,oBAAC,kBAAe,QAAQ,SAAS,QAAQ,QAAQ,SAAS,QAAQ,UAAU,IAAI,iBAAgB,iCAAgC;AAAA,OAClI;AAAA,KAEJ;AAEJ;AAIA,SAAS,SAAS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AA;AAAA,YACC,UAAU;AAAA,YACV,SAAS,MAAM,YAAY,GAAG;AAAA,YAC9B,WAAU;AAAA,YAEV;AAAA,kCAAC,eAAY,WAAU,eAAc;AAAA,cAAE;AAAA;AAAA;AAAA,QAEzC;AAAA,WAxBQ,IAAI,SAyBd,CACD,GACH;AAAA,OACF,IACE;AAAA,KACN,GACF;AAEJ;","names":[]}
|
|
@@ -45,6 +45,29 @@ var import_ipfs = require("../utils/ipfs.js");
|
|
|
45
45
|
var import_format = require("../utils/format.js");
|
|
46
46
|
var import_time = require("../utils/time.js");
|
|
47
47
|
var import_living_render_collections = require("../data/living-render-collections.js");
|
|
48
|
+
function PriceLine({
|
|
49
|
+
amountFormatted,
|
|
50
|
+
currency,
|
|
51
|
+
usdValue,
|
|
52
|
+
compact = false
|
|
53
|
+
}) {
|
|
54
|
+
if (!amountFormatted) return null;
|
|
55
|
+
if (!usdValue) {
|
|
56
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { className: compact ? "text-2xs font-bold price-value inline-flex items-center gap-1" : "text-lg font-bold price-value leading-none inline-flex items-center gap-1.5 mt-1.5", children: [
|
|
57
|
+
currency && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_currency_icon.CurrencyIcon, { symbol: currency, size: compact ? 11 : 18 }),
|
|
58
|
+
(0, import_format.formatDisplayPrice)(amountFormatted),
|
|
59
|
+
!compact && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "sr-only", children: currency })
|
|
60
|
+
] });
|
|
61
|
+
}
|
|
62
|
+
const stable = (0, import_format.isStableCurrency)(currency);
|
|
63
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
64
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: compact ? "text-2xs font-bold price-value" : "text-lg font-bold price-value leading-none mt-1.5", children: usdValue }),
|
|
65
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { className: compact ? "text-2xs text-muted-foreground/70 inline-flex items-center gap-1" : "text-2xs text-muted-foreground/60 mt-0.5 inline-flex items-center gap-1", children: [
|
|
66
|
+
currency && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_currency_icon.CurrencyIcon, { symbol: currency, size: compact ? 10 : 11 }),
|
|
67
|
+
stable ? currency : `${(0, import_format.formatDisplayPrice)(amountFormatted)} ${currency}`
|
|
68
|
+
] })
|
|
69
|
+
] });
|
|
70
|
+
}
|
|
48
71
|
function ListingCard({ order: rawOrder, inCart = false, onBuy, onCart, overflowMenu, primaryAction, compact = false, imageUrl, usdValue }) {
|
|
49
72
|
const order = rawOrder;
|
|
50
73
|
const [imgError, setImgError] = (0, import_react.useState)(false);
|
|
@@ -77,11 +100,7 @@ function ListingCard({ order: rawOrder, inCart = false, onBuy, onCart, overflowM
|
|
|
77
100
|
) }),
|
|
78
101
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "p-2.5 space-y-0.5", children: [
|
|
79
102
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs font-semibold truncate", children: name }),
|
|
80
|
-
|
|
81
|
-
order.price.currency && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_currency_icon.CurrencyIcon, { symbol: order.price.currency, size: 11 }),
|
|
82
|
-
(0, import_format.formatDisplayPrice)(order.price.formatted)
|
|
83
|
-
] }),
|
|
84
|
-
usdValue && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-2xs text-muted-foreground/70", children: usdValue }),
|
|
103
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(PriceLine, { amountFormatted: order.price?.formatted, currency: order.price?.currency, usdValue, compact: true }),
|
|
85
104
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-2xs text-muted-foreground", children: (0, import_time.timeAgo)(order.createdAt) })
|
|
86
105
|
] })
|
|
87
106
|
] }) });
|
|
@@ -113,12 +132,7 @@ function ListingCard({ order: rawOrder, inCart = false, onBuy, onCart, overflowM
|
|
|
113
132
|
order.price?.formatted && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-end justify-between gap-2", children: [
|
|
114
133
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "min-w-0", children: [
|
|
115
134
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-2xs uppercase tracking-widest text-muted-foreground/55 leading-none", children: isListing ? "Price" : "Offer" }),
|
|
116
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
117
|
-
order.price.currency && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_currency_icon.CurrencyIcon, { symbol: order.price.currency, size: 18 }),
|
|
118
|
-
(0, import_format.formatDisplayPrice)(order.price.formatted),
|
|
119
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "sr-only", children: order.price.currency })
|
|
120
|
-
] }),
|
|
121
|
-
usdValue && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-2xs text-muted-foreground/60 mt-0.5", children: usdValue })
|
|
135
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(PriceLine, { amountFormatted: order.price.formatted, currency: order.price.currency, usdValue })
|
|
122
136
|
] }),
|
|
123
137
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-2xs text-muted-foreground/60 whitespace-nowrap shrink-0", children: (0, import_time.timeAgo)(order.createdAt) })
|
|
124
138
|
] }),
|