@medialane/ui 0.28.0 → 0.29.1
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-collection-bar.cjs +135 -0
- package/dist/components/asset-collection-bar.cjs.map +1 -0
- package/dist/components/asset-collection-bar.d.cts +28 -0
- package/dist/components/asset-collection-bar.d.ts +28 -0
- package/dist/components/asset-collection-bar.js +101 -0
- package/dist/components/asset-collection-bar.js.map +1 -0
- package/dist/components/asset-marketplace-panel.cjs +284 -0
- package/dist/components/asset-marketplace-panel.cjs.map +1 -0
- package/dist/components/asset-marketplace-panel.d.cts +44 -0
- package/dist/components/asset-marketplace-panel.d.ts +44 -0
- package/dist/components/asset-marketplace-panel.js +270 -0
- package/dist/components/asset-marketplace-panel.js.map +1 -0
- package/dist/components/asset-top-sections.cjs +4 -9
- package/dist/components/asset-top-sections.cjs.map +1 -1
- package/dist/components/asset-top-sections.d.cts +1 -3
- package/dist/components/asset-top-sections.d.ts +1 -3
- package/dist/components/asset-top-sections.js +4 -9
- package/dist/components/asset-top-sections.js.map +1 -1
- package/dist/index.cjs +8 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +6 -1
- package/dist/index.js.map +1 -1
- package/dist/utils/format.cjs +17 -2
- package/dist/utils/format.cjs.map +1 -1
- package/dist/utils/format.d.cts +9 -1
- package/dist/utils/format.d.ts +9 -1
- package/dist/utils/format.js +15 -1
- package/dist/utils/format.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +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, 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 {\n cheapest?: ApiOrderLike;\n isOwner: boolean;\n isSignedIn: boolean;\n isProcessing: boolean;\n isERC1155: boolean;\n isMarketLoading?: boolean;\n myListing: ApiOrderLike | null;\n activeBids: ApiOrderLike[];\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: ApiOrderLike) => void;\n onAcceptBid: (order: ApiOrderLike) => void;\n onOpenListing: () => void;\n onOpenTransfer: () => void;\n onOpenPurchase: (order: ApiOrderLike) => 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({\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) {\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":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAwCI;AArCJ,0BAGO;AACP,2BAA6C;AAC7C,6BAA+B;AAC/B,oBAAsD;AACtD,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W,IAAI,CAAC,QACf,6CAAC,SAAwB,WAAU,4EACjC;AAAA,uDAAC,SAAI,WAAU,WACb;AAAA,wDAAC,OAAE,WAAU,qBACX,uDAAC,UAAK,WAAU,oCACb;AAAA,oDAAmB,IAAI,MAAM,SAAS;AAAA,cACvC,4CAAC,qCAAa,QAAQ,IAAI,MAAM,YAAY,IAAI,MAAM,IAAI;AAAA,eAC5D,GACF;AAAA,YACA,6CAAC,SAAI,WAAU,kCACb;AAAA,0DAAC,yCAAe,SAAS,IAAI,SAAS,OAAO,GAAG,UAAU,OAAO,WAAU,iCAAgC;AAAA,cAC3G,4CAAC,UAAK,WAAU,iCAAgC,kBAAC;AAAA,cACjD,6CAAC,SAAI,WAAU,yDACb;AAAA,4DAAC,6BAAM,WAAU,WAAU;AAAA,oBAC1B,uBAAU,IAAI,OAAO;AAAA,iBACxB;AAAA,eACF;AAAA,aACF;AAAA,UACA;AAAA,YAAC;AAAA;AAAA,cACC,UAAU;AAAA,cACV,SAAS,MAAM,YAAY,GAAG;AAAA,cAC9B,WAAU;AAAA,cAEV;AAAA,4DAAC,mCAAY,WAAU,eAAc;AAAA,gBAAE;AAAA;AAAA;AAAA,UAEzC;AAAA,aAxBQ,IAAI,SAyBd,CACD,GACH;AAAA,SACF,IACE;AAAA,OACN;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
/** Structural subset of `ApiOrder` (both apps' `@medialane/sdk` types satisfy this). */
|
|
5
|
+
interface ApiOrderLike {
|
|
6
|
+
orderHash: string;
|
|
7
|
+
offerer: string;
|
|
8
|
+
endTime: string;
|
|
9
|
+
price: {
|
|
10
|
+
formatted: string | null;
|
|
11
|
+
currency: string | null;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
interface AssetMarketplacePanelProps {
|
|
15
|
+
cheapest?: ApiOrderLike;
|
|
16
|
+
isOwner: boolean;
|
|
17
|
+
isSignedIn: boolean;
|
|
18
|
+
isProcessing: boolean;
|
|
19
|
+
isERC1155: boolean;
|
|
20
|
+
isMarketLoading?: boolean;
|
|
21
|
+
myListing: ApiOrderLike | null;
|
|
22
|
+
activeBids: ApiOrderLike[];
|
|
23
|
+
walletAddress?: string | null;
|
|
24
|
+
remixEnabled?: boolean;
|
|
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
|
+
/** Renders the sign-in/connect-wallet CTA for the given label (e.g. "Sign in to trade"). */
|
|
30
|
+
renderAuthAction: (label: string) => ReactNode;
|
|
31
|
+
/** Renders an inline help/info affordance for the given tooltip text. */
|
|
32
|
+
renderHelp: (content: string) => ReactNode;
|
|
33
|
+
onCancelClick: (order: ApiOrderLike) => void;
|
|
34
|
+
onAcceptBid: (order: ApiOrderLike) => void;
|
|
35
|
+
onOpenListing: () => void;
|
|
36
|
+
onOpenTransfer: () => void;
|
|
37
|
+
onOpenPurchase: (order: ApiOrderLike) => void;
|
|
38
|
+
onOpenOffer: () => void;
|
|
39
|
+
onOpenRemix?: () => void;
|
|
40
|
+
onProposeDeal?: () => void;
|
|
41
|
+
}
|
|
42
|
+
declare function AssetMarketplacePanel({ cheapest, isOwner, isSignedIn, isProcessing, isERC1155, isMarketLoading, myListing, activeBids, walletAddress, remixEnabled, showDealOption, floorPriceRaw, lastSaleRaw, renderAuthAction, renderHelp, onCancelClick, onAcceptBid, onOpenListing, onOpenTransfer, onOpenPurchase, onOpenOffer, onOpenRemix, onProposeDeal, }: AssetMarketplacePanelProps): react_jsx_runtime.JSX.Element;
|
|
43
|
+
|
|
44
|
+
export { type ApiOrderLike, AssetMarketplacePanel, type AssetMarketplacePanelProps };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
/** Structural subset of `ApiOrder` (both apps' `@medialane/sdk` types satisfy this). */
|
|
5
|
+
interface ApiOrderLike {
|
|
6
|
+
orderHash: string;
|
|
7
|
+
offerer: string;
|
|
8
|
+
endTime: string;
|
|
9
|
+
price: {
|
|
10
|
+
formatted: string | null;
|
|
11
|
+
currency: string | null;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
interface AssetMarketplacePanelProps {
|
|
15
|
+
cheapest?: ApiOrderLike;
|
|
16
|
+
isOwner: boolean;
|
|
17
|
+
isSignedIn: boolean;
|
|
18
|
+
isProcessing: boolean;
|
|
19
|
+
isERC1155: boolean;
|
|
20
|
+
isMarketLoading?: boolean;
|
|
21
|
+
myListing: ApiOrderLike | null;
|
|
22
|
+
activeBids: ApiOrderLike[];
|
|
23
|
+
walletAddress?: string | null;
|
|
24
|
+
remixEnabled?: boolean;
|
|
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
|
+
/** Renders the sign-in/connect-wallet CTA for the given label (e.g. "Sign in to trade"). */
|
|
30
|
+
renderAuthAction: (label: string) => ReactNode;
|
|
31
|
+
/** Renders an inline help/info affordance for the given tooltip text. */
|
|
32
|
+
renderHelp: (content: string) => ReactNode;
|
|
33
|
+
onCancelClick: (order: ApiOrderLike) => void;
|
|
34
|
+
onAcceptBid: (order: ApiOrderLike) => void;
|
|
35
|
+
onOpenListing: () => void;
|
|
36
|
+
onOpenTransfer: () => void;
|
|
37
|
+
onOpenPurchase: (order: ApiOrderLike) => void;
|
|
38
|
+
onOpenOffer: () => void;
|
|
39
|
+
onOpenRemix?: () => void;
|
|
40
|
+
onProposeDeal?: () => void;
|
|
41
|
+
}
|
|
42
|
+
declare function AssetMarketplacePanel({ cheapest, isOwner, isSignedIn, isProcessing, isERC1155, isMarketLoading, myListing, activeBids, walletAddress, remixEnabled, showDealOption, floorPriceRaw, lastSaleRaw, renderAuthAction, renderHelp, onCancelClick, onAcceptBid, onOpenListing, onOpenTransfer, onOpenPurchase, onOpenOffer, onOpenRemix, onProposeDeal, }: AssetMarketplacePanelProps): react_jsx_runtime.JSX.Element;
|
|
43
|
+
|
|
44
|
+
export { type ApiOrderLike, AssetMarketplacePanel, type AssetMarketplacePanelProps };
|
|
@@ -0,0 +1,270 @@
|
|
|
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
|
|
@@ -0,0 +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, 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 {\n cheapest?: ApiOrderLike;\n isOwner: boolean;\n isSignedIn: boolean;\n isProcessing: boolean;\n isERC1155: boolean;\n isMarketLoading?: boolean;\n myListing: ApiOrderLike | null;\n activeBids: ApiOrderLike[];\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: ApiOrderLike) => void;\n onAcceptBid: (order: ApiOrderLike) => void;\n onOpenListing: () => void;\n onOpenTransfer: () => void;\n onOpenPurchase: (order: ApiOrderLike) => 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({\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) {\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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AAAA,YACV,SAAS,MAAM,cAAc,KAAK;AAAA,YAElC;AAAA,kCAAC,KAAE,WAAU,eAAc;AAAA,cAAE;AAAA;AAAA;AAAA,QAE/B;AAAA,SACF,IACE;AAAA,MAEH,WAAW,WAAW,SAAS,IAC9B,qBAAC,SAAI,WAAU,uCACb;AAAA,6BAAC,OAAE,WAAU,wEAAuE;AAAA;AAAA,UAChE,WAAW;AAAA,UAAO;AAAA,WACtC;AAAA,QACA,oBAAC,SAAI,WAAU,aACZ,qBAAW,IAAI,CAAC,QACf,qBAAC,SAAwB,WAAU,4EACjC;AAAA,+BAAC,SAAI,WAAU,WACb;AAAA,gCAAC,OAAE,WAAU,qBACX,+BAAC,UAAK,WAAU,oCACb;AAAA,iCAAmB,IAAI,MAAM,SAAS;AAAA,cACvC,oBAAC,gBAAa,QAAQ,IAAI,MAAM,YAAY,IAAI,MAAM,IAAI;AAAA,eAC5D,GACF;AAAA,YACA,qBAAC,SAAI,WAAU,kCACb;AAAA,kCAAC,kBAAe,SAAS,IAAI,SAAS,OAAO,GAAG,UAAU,OAAO,WAAU,iCAAgC;AAAA,cAC3G,oBAAC,UAAK,WAAU,iCAAgC,kBAAC;AAAA,cACjD,qBAAC,SAAI,WAAU,yDACb;AAAA,oCAAC,SAAM,WAAU,WAAU;AAAA,gBAC1B,UAAU,IAAI,OAAO;AAAA,iBACxB;AAAA,eACF;AAAA,aACF;AAAA,UACA;AAAA,YAAC;AAAA;AAAA,cACC,UAAU;AAAA,cACV,SAAS,MAAM,YAAY,GAAG;AAAA,cAC9B,WAAU;AAAA,cAEV;AAAA,oCAAC,eAAY,WAAU,eAAc;AAAA,gBAAE;AAAA;AAAA;AAAA,UAEzC;AAAA,aAxBQ,IAAI,SAyBd,CACD,GACH;AAAA,SACF,IACE;AAAA,OACN;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -38,7 +38,6 @@ var import_jsx_runtime = require("react/jsx-runtime");
|
|
|
38
38
|
var import_image = __toESM(require("next/image"), 1);
|
|
39
39
|
var import_link = __toESM(require("next/link"), 1);
|
|
40
40
|
var import_framer_motion = require("framer-motion");
|
|
41
|
-
var import_ip_type_badge = require("./ip-type-badge.js");
|
|
42
41
|
var import_address_display = require("./address-display.js");
|
|
43
42
|
var import_parent_attribution_banner = require("./parent-attribution-banner.js");
|
|
44
43
|
var import_lucide_react = require("lucide-react");
|
|
@@ -87,7 +86,6 @@ function AssetMediaColumn({
|
|
|
87
86
|
function AssetHeaderBlock({
|
|
88
87
|
name,
|
|
89
88
|
description,
|
|
90
|
-
ipType,
|
|
91
89
|
showMultiEditionBadge = false,
|
|
92
90
|
parentContract,
|
|
93
91
|
parentTokenId,
|
|
@@ -102,13 +100,10 @@ function AssetHeaderBlock({
|
|
|
102
100
|
parentName: `Token #${parentTokenId}`
|
|
103
101
|
}
|
|
104
102
|
) }) : null,
|
|
105
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
"Multi-edition"
|
|
110
|
-
] }) : null
|
|
111
|
-
] }),
|
|
103
|
+
showMultiEditionBadge ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex items-center gap-2 flex-wrap mb-2", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "inline-flex items-center gap-1 text-[11px] font-semibold px-2.5 py-1 rounded-full border border-violet-500/30 bg-violet-500/10 text-violet-500", children: [
|
|
104
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Layers, { className: "h-3 w-3" }),
|
|
105
|
+
"Multi-edition"
|
|
106
|
+
] }) }) : null,
|
|
112
107
|
ownerAddress ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "mb-1 flex items-center gap-1.5 text-xs text-muted-foreground", children: [
|
|
113
108
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "font-semibold uppercase tracking-wider", children: "Owner" }),
|
|
114
109
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/asset-top-sections.tsx"],"sourcesContent":["\"use client\";\n\nimport Image from \"next/image\";\nimport Link from \"next/link\";\nimport { motion } from \"framer-motion\";\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/components/asset-top-sections.tsx"],"sourcesContent":["\"use client\";\n\nimport Image from \"next/image\";\nimport Link from \"next/link\";\nimport { motion } from \"framer-motion\";\nimport { AddressDisplay } from \"./address-display.js\";\nimport { ParentAttributionBanner } from \"./parent-attribution-banner.js\";\nimport { Layers, Users } from \"lucide-react\";\n\ninterface AssetMediaColumnProps {\n shouldReduce: boolean;\n image: string;\n imageAlt: string;\n imgError: boolean;\n onImageError: () => void;\n fallback: React.ReactNode;\n stats?: Array<{\n value: string;\n label: string;\n icon: React.ReactNode;\n }>;\n}\n\nexport function AssetMediaColumn({\n shouldReduce,\n image,\n imageAlt,\n imgError,\n onImageError,\n fallback,\n stats,\n}: AssetMediaColumnProps) {\n return (\n <motion.div\n initial={shouldReduce ? false : { scale: 1.0, opacity: 0 }}\n animate={{ scale: 1.02, opacity: 1 }}\n transition={{ duration: 0.6, ease: \"easeOut\" }}\n className=\"overflow-hidden rounded-xl lg:sticky lg:top-16\"\n >\n <div className=\"rounded-2xl overflow-hidden border border-border bg-muted\">\n {image && !imgError ? (\n <Image\n src={image}\n alt={imageAlt}\n width={0}\n height={0}\n sizes=\"(max-width: 1024px) 100vw, 66vw\"\n className=\"w-full h-auto\"\n onError={onImageError}\n crossOrigin=\"anonymous\"\n priority\n />\n ) : (\n fallback\n )}\n </div>\n\n {stats && stats.length > 0 ? (\n <div className={`grid gap-3 mt-4 ${stats.length === 2 ? \"grid-cols-2\" : \"grid-cols-1\"}`}>\n {stats.map((stat) => (\n <div key={stat.label} className=\"rounded-xl border border-border bg-muted/20 p-4 text-center\">\n <p className=\"text-2xl font-black\">{stat.value}</p>\n <div className=\"flex items-center justify-center gap-1 text-xs text-muted-foreground mt-1\">\n {stat.icon}\n {stat.label}\n </div>\n </div>\n ))}\n </div>\n ) : null}\n </motion.div>\n );\n}\n\ninterface AssetHeaderBlockProps {\n name: string;\n description?: string | null;\n showMultiEditionBadge?: boolean;\n parentContract?: string | null;\n parentTokenId?: string | null;\n ownerAddress?: string | null;\n}\n\nexport function AssetHeaderBlock({\n name,\n description,\n showMultiEditionBadge = false,\n parentContract,\n parentTokenId,\n ownerAddress,\n}: AssetHeaderBlockProps) {\n return (\n <div>\n {parentContract && parentTokenId ? (\n <div className=\"mb-3\">\n <ParentAttributionBanner\n parentContract={parentContract}\n parentTokenId={parentTokenId}\n parentName={`Token #${parentTokenId}`}\n />\n </div>\n ) : null}\n {showMultiEditionBadge ? (\n <div className=\"flex items-center gap-2 flex-wrap mb-2\">\n <span className=\"inline-flex items-center gap-1 text-[11px] font-semibold px-2.5 py-1 rounded-full border border-violet-500/30 bg-violet-500/10 text-violet-500\">\n <Layers className=\"h-3 w-3\" />\n Multi-edition\n </span>\n </div>\n ) : null}\n {ownerAddress ? (\n <div className=\"mb-1 flex items-center gap-1.5 text-xs text-muted-foreground\">\n <span className=\"font-semibold uppercase tracking-wider\">Owner</span>\n <Link\n href={`/creator/${ownerAddress}`}\n className=\"hover:text-primary transition-colors font-medium\"\n >\n <AddressDisplay address={ownerAddress} />\n </Link>\n </div>\n ) : null}\n <h1 className=\"text-3xl lg:text-5xl font-bold\">{name}</h1>\n {description ? (\n <p className=\"text-sm text-muted-foreground leading-relaxed mt-1\">{description}</p>\n ) : null}\n </div>\n );\n}\n\nexport function buildEditionStats(totalEditions: number, uniqueOwners: number) {\n return [\n {\n value: totalEditions.toLocaleString(),\n label: \"editions minted\",\n icon: <Layers className=\"h-3 w-3\" />,\n },\n {\n value: uniqueOwners.toLocaleString(),\n label: \"unique owners\",\n icon: <Users className=\"h-3 w-3\" />,\n },\n ];\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;A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,4CAAC,SAAI,WAAU,QACb;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA,YAAY,UAAU,aAAa;AAAA;AAAA,IACrC,GACF,IACE;AAAA,IACH,wBACC,4CAAC,SAAI,WAAU,0CACb,uDAAC,UAAK,WAAU,kJACd;AAAA,kDAAC,8BAAO,WAAU,WAAU;AAAA,MAAE;AAAA,OAEhC,GACF,IACE;AAAA,IACH,eACC,6CAAC,SAAI,WAAU,gEACb;AAAA,kDAAC,UAAK,WAAU,0CAAyC,mBAAK;AAAA,MAC9D;AAAA,QAAC,YAAAC;AAAA,QAAA;AAAA,UACC,MAAM,YAAY,YAAY;AAAA,UAC9B,WAAU;AAAA,UAEV,sDAAC,yCAAe,SAAS,cAAc;AAAA;AAAA,MACzC;AAAA,OACF,IACE;AAAA,IACJ,4CAAC,QAAG,WAAU,kCAAkC,gBAAK;AAAA,IACpD,cACC,4CAAC,OAAE,WAAU,sDAAsD,uBAAY,IAC7E;AAAA,KACN;AAEJ;AAEO,SAAS,kBAAkB,eAAuB,cAAsB;AAC7E,SAAO;AAAA,IACL;AAAA,MACE,OAAO,cAAc,eAAe;AAAA,MACpC,OAAO;AAAA,MACP,MAAM,4CAAC,8BAAO,WAAU,WAAU;AAAA,IACpC;AAAA,IACA;AAAA,MACE,OAAO,aAAa,eAAe;AAAA,MACnC,OAAO;AAAA,MACP,MAAM,4CAAC,6BAAM,WAAU,WAAU;AAAA,IACnC;AAAA,EACF;AACF;","names":["Image","Link"]}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { IPType } from '../data/ip.cjs';
|
|
3
2
|
|
|
4
3
|
interface AssetMediaColumnProps {
|
|
5
4
|
shouldReduce: boolean;
|
|
@@ -18,13 +17,12 @@ declare function AssetMediaColumn({ shouldReduce, image, imageAlt, imgError, onI
|
|
|
18
17
|
interface AssetHeaderBlockProps {
|
|
19
18
|
name: string;
|
|
20
19
|
description?: string | null;
|
|
21
|
-
ipType?: IPType | string | null;
|
|
22
20
|
showMultiEditionBadge?: boolean;
|
|
23
21
|
parentContract?: string | null;
|
|
24
22
|
parentTokenId?: string | null;
|
|
25
23
|
ownerAddress?: string | null;
|
|
26
24
|
}
|
|
27
|
-
declare function AssetHeaderBlock({ name, description,
|
|
25
|
+
declare function AssetHeaderBlock({ name, description, showMultiEditionBadge, parentContract, parentTokenId, ownerAddress, }: AssetHeaderBlockProps): react_jsx_runtime.JSX.Element;
|
|
28
26
|
declare function buildEditionStats(totalEditions: number, uniqueOwners: number): {
|
|
29
27
|
value: string;
|
|
30
28
|
label: string;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { IPType } from '../data/ip.js';
|
|
3
2
|
|
|
4
3
|
interface AssetMediaColumnProps {
|
|
5
4
|
shouldReduce: boolean;
|
|
@@ -18,13 +17,12 @@ declare function AssetMediaColumn({ shouldReduce, image, imageAlt, imgError, onI
|
|
|
18
17
|
interface AssetHeaderBlockProps {
|
|
19
18
|
name: string;
|
|
20
19
|
description?: string | null;
|
|
21
|
-
ipType?: IPType | string | null;
|
|
22
20
|
showMultiEditionBadge?: boolean;
|
|
23
21
|
parentContract?: string | null;
|
|
24
22
|
parentTokenId?: string | null;
|
|
25
23
|
ownerAddress?: string | null;
|
|
26
24
|
}
|
|
27
|
-
declare function AssetHeaderBlock({ name, description,
|
|
25
|
+
declare function AssetHeaderBlock({ name, description, showMultiEditionBadge, parentContract, parentTokenId, ownerAddress, }: AssetHeaderBlockProps): react_jsx_runtime.JSX.Element;
|
|
28
26
|
declare function buildEditionStats(totalEditions: number, uniqueOwners: number): {
|
|
29
27
|
value: string;
|
|
30
28
|
label: string;
|
|
@@ -3,7 +3,6 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import Image from "next/image";
|
|
4
4
|
import Link from "next/link";
|
|
5
5
|
import { motion } from "framer-motion";
|
|
6
|
-
import { IpTypeBadge } from "./ip-type-badge.js";
|
|
7
6
|
import { AddressDisplay } from "./address-display.js";
|
|
8
7
|
import { ParentAttributionBanner } from "./parent-attribution-banner.js";
|
|
9
8
|
import { Layers, Users } from "lucide-react";
|
|
@@ -52,7 +51,6 @@ function AssetMediaColumn({
|
|
|
52
51
|
function AssetHeaderBlock({
|
|
53
52
|
name,
|
|
54
53
|
description,
|
|
55
|
-
ipType,
|
|
56
54
|
showMultiEditionBadge = false,
|
|
57
55
|
parentContract,
|
|
58
56
|
parentTokenId,
|
|
@@ -67,13 +65,10 @@ function AssetHeaderBlock({
|
|
|
67
65
|
parentName: `Token #${parentTokenId}`
|
|
68
66
|
}
|
|
69
67
|
) }) : null,
|
|
70
|
-
/* @__PURE__ */
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
"Multi-edition"
|
|
75
|
-
] }) : null
|
|
76
|
-
] }),
|
|
68
|
+
showMultiEditionBadge ? /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2 flex-wrap mb-2", children: /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-1 text-[11px] font-semibold px-2.5 py-1 rounded-full border border-violet-500/30 bg-violet-500/10 text-violet-500", children: [
|
|
69
|
+
/* @__PURE__ */ jsx(Layers, { className: "h-3 w-3" }),
|
|
70
|
+
"Multi-edition"
|
|
71
|
+
] }) }) : null,
|
|
77
72
|
ownerAddress ? /* @__PURE__ */ jsxs("div", { className: "mb-1 flex items-center gap-1.5 text-xs text-muted-foreground", children: [
|
|
78
73
|
/* @__PURE__ */ jsx("span", { className: "font-semibold uppercase tracking-wider", children: "Owner" }),
|
|
79
74
|
/* @__PURE__ */ jsx(
|