@medialane/ui 0.198.1 → 0.199.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/account/input-otp.d.cts +2 -2
- package/dist/components/account/input-otp.d.ts +2 -2
- package/dist/components/asset-access-cards.cjs +75 -0
- package/dist/components/asset-access-cards.cjs.map +1 -0
- package/dist/components/asset-access-cards.d.cts +16 -0
- package/dist/components/asset-access-cards.d.ts +16 -0
- package/dist/components/asset-access-cards.js +50 -0
- package/dist/components/asset-access-cards.js.map +1 -0
- package/dist/components/asset-marketplace-panel.cjs +6 -4
- package/dist/components/asset-marketplace-panel.cjs.map +1 -1
- package/dist/components/asset-marketplace-panel.d.cts +7 -2
- package/dist/components/asset-marketplace-panel.d.ts +7 -2
- package/dist/components/asset-marketplace-panel.js +6 -4
- package/dist/components/asset-marketplace-panel.js.map +1 -1
- package/dist/components/button.d.cts +2 -2
- package/dist/components/button.d.ts +2 -2
- package/dist/components/fast-mint/fast-mint.d.cts +2 -2
- package/dist/components/fast-mint/fast-mint.d.ts +2 -2
- package/dist/components/medialane-app.cjs.map +1 -1
- package/dist/components/medialane-app.d.cts +12 -3
- package/dist/components/medialane-app.d.ts +12 -3
- package/dist/components/medialane-app.js.map +1 -1
- package/dist/components/sheet.d.cts +1 -1
- package/dist/components/sheet.d.ts +1 -1
- 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.map +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as input_otp from 'input-otp';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
|
|
4
|
-
declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "
|
|
4
|
+
declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange" | "value" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
|
|
5
5
|
value?: string;
|
|
6
6
|
onChange?: (newValue: string) => unknown;
|
|
7
7
|
maxLength: number;
|
|
@@ -14,7 +14,7 @@ declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHT
|
|
|
14
14
|
} & {
|
|
15
15
|
render: (props: input_otp.RenderProps) => React.ReactNode;
|
|
16
16
|
children?: never;
|
|
17
|
-
} & React.RefAttributes<HTMLInputElement>, "ref"> | Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "
|
|
17
|
+
} & React.RefAttributes<HTMLInputElement>, "ref"> | Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange" | "value" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
|
|
18
18
|
value?: string;
|
|
19
19
|
onChange?: (newValue: string) => unknown;
|
|
20
20
|
maxLength: number;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as input_otp from 'input-otp';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
|
|
4
|
-
declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "
|
|
4
|
+
declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange" | "value" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
|
|
5
5
|
value?: string;
|
|
6
6
|
onChange?: (newValue: string) => unknown;
|
|
7
7
|
maxLength: number;
|
|
@@ -14,7 +14,7 @@ declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHT
|
|
|
14
14
|
} & {
|
|
15
15
|
render: (props: input_otp.RenderProps) => React.ReactNode;
|
|
16
16
|
children?: never;
|
|
17
|
-
} & React.RefAttributes<HTMLInputElement>, "ref"> | Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "
|
|
17
|
+
} & React.RefAttributes<HTMLInputElement>, "ref"> | Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange" | "value" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
|
|
18
18
|
value?: string;
|
|
19
19
|
onChange?: (newValue: string) => unknown;
|
|
20
20
|
maxLength: number;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
var asset_access_cards_exports = {};
|
|
21
|
+
__export(asset_access_cards_exports, {
|
|
22
|
+
AssetAccessCards: () => AssetAccessCards,
|
|
23
|
+
CompanionAppCard: () => CompanionAppCard
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(asset_access_cards_exports);
|
|
26
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
27
|
+
var import_lucide_react = require("lucide-react");
|
|
28
|
+
var import_sdk = require("@medialane/sdk");
|
|
29
|
+
var import_medialane_app = require("./medialane-app.js");
|
|
30
|
+
var import_cn = require("../utils/cn.js");
|
|
31
|
+
const CARD = "group flex h-full w-full items-start gap-3 rounded-2xl border border-transparent p-4 text-left transition-colors";
|
|
32
|
+
function CardBody({ icon: Icon, iconClassName, title, description }) {
|
|
33
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
34
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: (0, import_cn.cn)("mt-0.5 flex h-9 w-9 shrink-0 items-center justify-center rounded-xl bg-gradient-to-br text-white", iconClassName), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, { className: "h-[18px] w-[18px]" }) }),
|
|
35
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
36
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm font-bold leading-snug", children: title }),
|
|
37
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "mt-0.5 text-xs leading-relaxed text-muted-foreground", children: description }) : null
|
|
38
|
+
] })
|
|
39
|
+
] });
|
|
40
|
+
}
|
|
41
|
+
function CompanionAppCard({ asset }) {
|
|
42
|
+
const { companion } = (0, import_medialane_app.useMedialaneApp)();
|
|
43
|
+
if (!companion) return null;
|
|
44
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
45
|
+
"a",
|
|
46
|
+
{
|
|
47
|
+
href: `${companion.origin}${(0, import_sdk.assetHref)(asset.chain.toUpperCase(), asset.contractAddress, asset.tokenId)}`,
|
|
48
|
+
target: "_blank",
|
|
49
|
+
rel: "noopener noreferrer",
|
|
50
|
+
className: (0, import_cn.cn)(CARD, "bg-gradient-to-br from-brand-rose/15 via-brand-orange/10 to-transparent hover:border-brand-orange/30"),
|
|
51
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CardBody, { icon: companion.icon, iconClassName: "from-brand-rose to-brand-orange", title: companion.title, description: companion.description })
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
function AssetAccessCards({ asset }) {
|
|
56
|
+
const { onRequireWallet, connectLabel = "Sign in", connectDescription, companion } = (0, import_medialane_app.useMedialaneApp)();
|
|
57
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: (0, import_cn.cn)("grid grid-cols-1 gap-3 items-stretch", companion && "sm:grid-cols-2"), children: [
|
|
58
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
59
|
+
"button",
|
|
60
|
+
{
|
|
61
|
+
type: "button",
|
|
62
|
+
onClick: onRequireWallet,
|
|
63
|
+
className: (0, import_cn.cn)(CARD, "bg-gradient-to-br from-brand-blue/15 via-brand-purple/10 to-transparent hover:border-brand-purple/30"),
|
|
64
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CardBody, { icon: import_lucide_react.Wallet, iconClassName: "from-brand-blue to-brand-purple", title: connectLabel, description: connectDescription })
|
|
65
|
+
}
|
|
66
|
+
),
|
|
67
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(CompanionAppCard, { asset })
|
|
68
|
+
] });
|
|
69
|
+
}
|
|
70
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
71
|
+
0 && (module.exports = {
|
|
72
|
+
AssetAccessCards,
|
|
73
|
+
CompanionAppCard
|
|
74
|
+
});
|
|
75
|
+
//# sourceMappingURL=asset-access-cards.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/asset-access-cards.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ElementType } from \"react\";\nimport { Wallet } from \"lucide-react\";\nimport { assetHref, type Chain } from \"@medialane/sdk\";\nimport { useMedialaneApp, type AssetRef } from \"./medialane-app.js\";\nimport { cn } from \"../utils/cn.js\";\n\nconst CARD = \"group flex h-full w-full items-start gap-3 rounded-2xl border border-transparent p-4 text-left transition-colors\";\n\nfunction CardBody({ icon: Icon, iconClassName, title, description }: { icon: ElementType; iconClassName: string; title: string; description?: string }) {\n return (\n <>\n <div className={cn(\"mt-0.5 flex h-9 w-9 shrink-0 items-center justify-center rounded-xl bg-gradient-to-br text-white\", iconClassName)}>\n <Icon className=\"h-[18px] w-[18px]\" />\n </div>\n <div className=\"min-w-0 flex-1\">\n <p className=\"text-sm font-bold leading-snug\">{title}</p>\n {description ? <p className=\"mt-0.5 text-xs leading-relaxed text-muted-foreground\">{description}</p> : null}\n </div>\n </>\n );\n}\n\nexport function CompanionAppCard({ asset }: { asset: AssetRef }) {\n const { companion } = useMedialaneApp();\n if (!companion) return null;\n return (\n <a\n href={`${companion.origin}${assetHref(asset.chain.toUpperCase() as Chain, asset.contractAddress, asset.tokenId)}`}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className={cn(CARD, \"bg-gradient-to-br from-brand-rose/15 via-brand-orange/10 to-transparent hover:border-brand-orange/30\")}\n >\n <CardBody icon={companion.icon} iconClassName=\"from-brand-rose to-brand-orange\" title={companion.title} description={companion.description} />\n </a>\n );\n}\n\nexport function AssetAccessCards({ asset }: { asset: AssetRef }) {\n const { onRequireWallet, connectLabel = \"Sign in\", connectDescription, companion } = useMedialaneApp();\n return (\n <div className={cn(\"grid grid-cols-1 gap-3 items-stretch\", companion && \"sm:grid-cols-2\")}>\n <button\n type=\"button\"\n onClick={onRequireWallet}\n className={cn(CARD, \"bg-gradient-to-br from-brand-blue/15 via-brand-purple/10 to-transparent hover:border-brand-purple/30\")}\n >\n <CardBody icon={Wallet} iconClassName=\"from-brand-blue to-brand-purple\" title={connectLabel} description={connectDescription} />\n </button>\n <CompanionAppCard asset={asset} />\n </div>\n );\n}\n\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYI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AC,oBAAiB,OAAc;AAAA,KAClC;AAEJ;","names":[]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { AssetRef } from './medialane-app.cjs';
|
|
3
|
+
import 'react';
|
|
4
|
+
import '@medialane/sdk/starknet';
|
|
5
|
+
import './fast-mint/types.cjs';
|
|
6
|
+
import 'starknet';
|
|
7
|
+
import '@medialane/sdk';
|
|
8
|
+
|
|
9
|
+
declare function CompanionAppCard({ asset }: {
|
|
10
|
+
asset: AssetRef;
|
|
11
|
+
}): react_jsx_runtime.JSX.Element | null;
|
|
12
|
+
declare function AssetAccessCards({ asset }: {
|
|
13
|
+
asset: AssetRef;
|
|
14
|
+
}): react_jsx_runtime.JSX.Element;
|
|
15
|
+
|
|
16
|
+
export { AssetAccessCards, CompanionAppCard };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { AssetRef } from './medialane-app.js';
|
|
3
|
+
import 'react';
|
|
4
|
+
import '@medialane/sdk/starknet';
|
|
5
|
+
import './fast-mint/types.js';
|
|
6
|
+
import 'starknet';
|
|
7
|
+
import '@medialane/sdk';
|
|
8
|
+
|
|
9
|
+
declare function CompanionAppCard({ asset }: {
|
|
10
|
+
asset: AssetRef;
|
|
11
|
+
}): react_jsx_runtime.JSX.Element | null;
|
|
12
|
+
declare function AssetAccessCards({ asset }: {
|
|
13
|
+
asset: AssetRef;
|
|
14
|
+
}): react_jsx_runtime.JSX.Element;
|
|
15
|
+
|
|
16
|
+
export { AssetAccessCards, CompanionAppCard };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Wallet } from "lucide-react";
|
|
4
|
+
import { assetHref } from "@medialane/sdk";
|
|
5
|
+
import { useMedialaneApp } from "./medialane-app.js";
|
|
6
|
+
import { cn } from "../utils/cn.js";
|
|
7
|
+
const CARD = "group flex h-full w-full items-start gap-3 rounded-2xl border border-transparent p-4 text-left transition-colors";
|
|
8
|
+
function CardBody({ icon: Icon, iconClassName, title, description }) {
|
|
9
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
10
|
+
/* @__PURE__ */ jsx("div", { className: cn("mt-0.5 flex h-9 w-9 shrink-0 items-center justify-center rounded-xl bg-gradient-to-br text-white", iconClassName), children: /* @__PURE__ */ jsx(Icon, { className: "h-[18px] w-[18px]" }) }),
|
|
11
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
12
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm font-bold leading-snug", children: title }),
|
|
13
|
+
description ? /* @__PURE__ */ jsx("p", { className: "mt-0.5 text-xs leading-relaxed text-muted-foreground", children: description }) : null
|
|
14
|
+
] })
|
|
15
|
+
] });
|
|
16
|
+
}
|
|
17
|
+
function CompanionAppCard({ asset }) {
|
|
18
|
+
const { companion } = useMedialaneApp();
|
|
19
|
+
if (!companion) return null;
|
|
20
|
+
return /* @__PURE__ */ jsx(
|
|
21
|
+
"a",
|
|
22
|
+
{
|
|
23
|
+
href: `${companion.origin}${assetHref(asset.chain.toUpperCase(), asset.contractAddress, asset.tokenId)}`,
|
|
24
|
+
target: "_blank",
|
|
25
|
+
rel: "noopener noreferrer",
|
|
26
|
+
className: cn(CARD, "bg-gradient-to-br from-brand-rose/15 via-brand-orange/10 to-transparent hover:border-brand-orange/30"),
|
|
27
|
+
children: /* @__PURE__ */ jsx(CardBody, { icon: companion.icon, iconClassName: "from-brand-rose to-brand-orange", title: companion.title, description: companion.description })
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
function AssetAccessCards({ asset }) {
|
|
32
|
+
const { onRequireWallet, connectLabel = "Sign in", connectDescription, companion } = useMedialaneApp();
|
|
33
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("grid grid-cols-1 gap-3 items-stretch", companion && "sm:grid-cols-2"), children: [
|
|
34
|
+
/* @__PURE__ */ jsx(
|
|
35
|
+
"button",
|
|
36
|
+
{
|
|
37
|
+
type: "button",
|
|
38
|
+
onClick: onRequireWallet,
|
|
39
|
+
className: cn(CARD, "bg-gradient-to-br from-brand-blue/15 via-brand-purple/10 to-transparent hover:border-brand-purple/30"),
|
|
40
|
+
children: /* @__PURE__ */ jsx(CardBody, { icon: Wallet, iconClassName: "from-brand-blue to-brand-purple", title: connectLabel, description: connectDescription })
|
|
41
|
+
}
|
|
42
|
+
),
|
|
43
|
+
/* @__PURE__ */ jsx(CompanionAppCard, { asset })
|
|
44
|
+
] });
|
|
45
|
+
}
|
|
46
|
+
export {
|
|
47
|
+
AssetAccessCards,
|
|
48
|
+
CompanionAppCard
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=asset-access-cards.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/asset-access-cards.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ElementType } from \"react\";\nimport { Wallet } from \"lucide-react\";\nimport { assetHref, type Chain } from \"@medialane/sdk\";\nimport { useMedialaneApp, type AssetRef } from \"./medialane-app.js\";\nimport { cn } from \"../utils/cn.js\";\n\nconst CARD = \"group flex h-full w-full items-start gap-3 rounded-2xl border border-transparent p-4 text-left transition-colors\";\n\nfunction CardBody({ icon: Icon, iconClassName, title, description }: { icon: ElementType; iconClassName: string; title: string; description?: string }) {\n return (\n <>\n <div className={cn(\"mt-0.5 flex h-9 w-9 shrink-0 items-center justify-center rounded-xl bg-gradient-to-br text-white\", iconClassName)}>\n <Icon className=\"h-[18px] w-[18px]\" />\n </div>\n <div className=\"min-w-0 flex-1\">\n <p className=\"text-sm font-bold leading-snug\">{title}</p>\n {description ? <p className=\"mt-0.5 text-xs leading-relaxed text-muted-foreground\">{description}</p> : null}\n </div>\n </>\n );\n}\n\nexport function CompanionAppCard({ asset }: { asset: AssetRef }) {\n const { companion } = useMedialaneApp();\n if (!companion) return null;\n return (\n <a\n href={`${companion.origin}${assetHref(asset.chain.toUpperCase() as Chain, asset.contractAddress, asset.tokenId)}`}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className={cn(CARD, \"bg-gradient-to-br from-brand-rose/15 via-brand-orange/10 to-transparent hover:border-brand-orange/30\")}\n >\n <CardBody icon={companion.icon} iconClassName=\"from-brand-rose to-brand-orange\" title={companion.title} description={companion.description} />\n </a>\n );\n}\n\nexport function AssetAccessCards({ asset }: { asset: AssetRef }) {\n const { onRequireWallet, connectLabel = \"Sign in\", connectDescription, companion } = useMedialaneApp();\n return (\n <div className={cn(\"grid grid-cols-1 gap-3 items-stretch\", companion && \"sm:grid-cols-2\")}>\n <button\n type=\"button\"\n onClick={onRequireWallet}\n className={cn(CARD, \"bg-gradient-to-br from-brand-blue/15 via-brand-purple/10 to-transparent hover:border-brand-purple/30\")}\n >\n <CardBody icon={Wallet} iconClassName=\"from-brand-blue to-brand-purple\" title={connectLabel} description={connectDescription} />\n </button>\n <CompanionAppCard asset={asset} />\n </div>\n );\n}\n\n"],"mappings":";AAYI,mBAEI,KAEF,YAJF;AATJ,SAAS,cAAc;AACvB,SAAS,iBAA6B;AACtC,SAAS,uBAAsC;AAC/C,SAAS,UAAU;AAEnB,MAAM,OAAO;AAEb,SAAS,SAAS,EAAE,MAAM,MAAM,eAAe,OAAO,YAAY,GAAsF;AACtJ,SACE,iCACE;AAAA,wBAAC,SAAI,WAAW,GAAG,oGAAoG,aAAa,GAClI,8BAAC,QAAK,WAAU,qBAAoB,GACtC;AAAA,IACA,qBAAC,SAAI,WAAU,kBACb;AAAA,0BAAC,OAAE,WAAU,kCAAkC,iBAAM;AAAA,MACpD,cAAc,oBAAC,OAAE,WAAU,wDAAwD,uBAAY,IAAO;AAAA,OACzG;AAAA,KACF;AAEJ;AAEO,SAAS,iBAAiB,EAAE,MAAM,GAAwB;AAC/D,QAAM,EAAE,UAAU,IAAI,gBAAgB;AACtC,MAAI,CAAC,UAAW,QAAO;AACvB,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAM,GAAG,UAAU,MAAM,GAAG,UAAU,MAAM,MAAM,YAAY,GAAY,MAAM,iBAAiB,MAAM,OAAO,CAAC;AAAA,MAC/G,QAAO;AAAA,MACP,KAAI;AAAA,MACJ,WAAW,GAAG,MAAM,sGAAsG;AAAA,MAE1H,8BAAC,YAAS,MAAM,UAAU,MAAM,eAAc,mCAAkC,OAAO,UAAU,OAAO,aAAa,UAAU,aAAa;AAAA;AAAA,EAC9I;AAEJ;AAEO,SAAS,iBAAiB,EAAE,MAAM,GAAwB;AAC/D,QAAM,EAAE,iBAAiB,eAAe,WAAW,oBAAoB,UAAU,IAAI,gBAAgB;AACrG,SACE,qBAAC,SAAI,WAAW,GAAG,wCAAwC,aAAa,gBAAgB,GACtF;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,MAAK;AAAA,QACL,SAAS;AAAA,QACT,WAAW,GAAG,MAAM,sGAAsG;AAAA,QAE1H,8BAAC,YAAS,MAAM,QAAQ,eAAc,mCAAkC,OAAO,cAAc,aAAa,oBAAoB;AAAA;AAAA,IAChI;AAAA,IACA,oBAAC,oBAAiB,OAAc;AAAA,KAClC;AAEJ;","names":[]}
|
|
@@ -31,6 +31,7 @@ var import_dual_price = require("./dual-price.js");
|
|
|
31
31
|
var import_format = require("../utils/format.js");
|
|
32
32
|
var import_time = require("../utils/time.js");
|
|
33
33
|
var import_same_address = require("../utils/same-address.js");
|
|
34
|
+
var import_asset_access_cards = require("./asset-access-cards.js");
|
|
34
35
|
function StatRow({ floorPriceRaw, lastSaleRaw }) {
|
|
35
36
|
const floor = floorPriceRaw ? (0, import_format.parsePriceDisplay)(floorPriceRaw) : null;
|
|
36
37
|
const lastSale = lastSaleRaw ? (0, import_format.parsePriceDisplay)(lastSaleRaw) : null;
|
|
@@ -47,6 +48,7 @@ function StatRow({ floorPriceRaw, lastSaleRaw }) {
|
|
|
47
48
|
] });
|
|
48
49
|
}
|
|
49
50
|
function AssetMarketplacePanel({
|
|
51
|
+
asset,
|
|
50
52
|
cheapest,
|
|
51
53
|
isOwner,
|
|
52
54
|
isSignedIn,
|
|
@@ -66,7 +68,6 @@ function AssetMarketplacePanel({
|
|
|
66
68
|
floorPriceRaw,
|
|
67
69
|
lastSaleRaw,
|
|
68
70
|
usdValue,
|
|
69
|
-
renderAuthAction,
|
|
70
71
|
renderHelp,
|
|
71
72
|
onCancelClick,
|
|
72
73
|
onAcceptBid,
|
|
@@ -192,7 +193,7 @@ function AssetMarketplacePanel({
|
|
|
192
193
|
) : null
|
|
193
194
|
] }),
|
|
194
195
|
!remixEnabled && !showDealOption ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs text-muted-foreground mt-2 leading-relaxed", children: "The creator marked this asset as no-derivatives." }) : null
|
|
195
|
-
] }) :
|
|
196
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_asset_access_cards.AssetAccessCards, { asset })
|
|
196
197
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-3", children: [
|
|
197
198
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(StatRow, { floorPriceRaw, lastSaleRaw }),
|
|
198
199
|
isOwner ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "grid grid-cols-2 gap-2", children: [
|
|
@@ -248,7 +249,7 @@ function AssetMarketplacePanel({
|
|
|
248
249
|
children: "Sponsor this IP"
|
|
249
250
|
}
|
|
250
251
|
) : null
|
|
251
|
-
] }) :
|
|
252
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_asset_access_cards.AssetAccessCards, { asset })
|
|
252
253
|
] }),
|
|
253
254
|
myBid ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "rounded-xl bg-amber-500/8 px-4 py-3 flex items-center justify-between gap-3", children: [
|
|
254
255
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "min-w-0 flex items-center gap-2.5", children: [
|
|
@@ -312,7 +313,8 @@ function AssetMarketplacePanel({
|
|
|
312
313
|
}
|
|
313
314
|
)
|
|
314
315
|
] }, bid.orderHash)) })
|
|
315
|
-
] }) : null
|
|
316
|
+
] }) : null,
|
|
317
|
+
isSignedIn ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_asset_access_cards.CompanionAppCard, { asset }) : null
|
|
316
318
|
] }) });
|
|
317
319
|
}
|
|
318
320
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -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 { DualPrice } from \"./dual-price.js\";\nimport { formatDisplayPrice, parsePriceDisplay } from \"../utils/format.js\";\nimport { isExpired, timeUntil } from \"../utils/time.js\";\nimport { isSameAddress } from \"../utils/same-address.js\";\n\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 canListMoreEditions?: boolean;\n isMarketLoading?: boolean;\n myListing: T | null;\n activeBids: T[];\n walletAddress?: string | null;\n remixEnabled?: boolean;\n showDealOption?: boolean;\n\n usdValue?: string | null;\n\n renderAuthAction: (label: string) => ReactNode;\n\n renderHelp: (content: string) => ReactNode;\n onCancelClick: (order: T) => void;\n onAcceptBid: (order: T) => void;\n onOpenListing: () => void;\n onOpenTransfer: () => void;\n onOpenPurchase: (order: T) => void;\n onOpenOffer: () => void;\n onOpenRemix?: () => void;\n onProposeDeal?: () => void;\n\n showSponsorOption?: boolean;\n onOpenSponsorProposal?: () => void;\n\n showSponsorSolicitOption?: boolean;\n onOpenSponsorSolicit?: () => void;\n\n floorPriceRaw?: string | null;\n lastSaleRaw?: string | null;\n\n}\n\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 canListMoreEditions,\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 liveBids = activeBids.filter((bid) => !isExpired(bid.endTime));\n const liveCheapest = cheapest && !isExpired(cheapest.endTime) ? cheapest : undefined;\n const liveMyListing = myListing && !isExpired(myListing.endTime) ? myListing : null;\n\n const myBid = !isOwner && walletAddress\n ? liveBids.find((bid) => isSameAddress(bid.offerer, walletAddress)) ?? null\n : null;\n\n const canBuyMore =\n isERC1155 && isOwner && !!liveCheapest && !!walletAddress &&\n !isSameAddress(liveCheapest.offerer, walletAddress);\n\n if (isMarketLoading && !liveCheapest) {\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 {liveCheapest ? (\n <div className=\"space-y-4\">\n <DualPrice\n amountFormatted={liveCheapest.price.formatted}\n currency={liveCheapest.price.currency}\n usdValue={usdValue}\n scale=\"hero\"\n trailing={renderHelp(\n `${isOwner && !canBuyMore ? \"Your listing\" : \"Current price\"} · Expires ${timeUntil(liveCheapest.endTime)}`\n )}\n />\n\n {isOwner ? (\n <div className=\"space-y-2\">\n <div className=\"grid grid-cols-2 gap-2\">\n {liveMyListing ? (\n <ActionButton big\n icon={isProcessing ? <Loader2 className=\"h-4 w-4 animate-spin\" /> : <X className=\"h-4 w-4\" />}\n onClick={() => onCancelClick(liveMyListing)}\n disabled={isProcessing}\n tone=\"red\"\n renderHelp={renderHelp}\n >\n {isERC1155 ? \"Cancel My Listing\" : \"Cancel Listing\"}\n </ActionButton>\n ) : null}\n\n {(!liveMyListing || (isERC1155 && canListMoreEditions !== false)) ? (\n <ActionButton big tone=\"blue\" icon={<Tag className=\"h-4 w-4\" />} onClick={onOpenListing} renderHelp={renderHelp}>\n {liveMyListing ? \"List More Editions\" : \"List on Marketplace\"}\n </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(liveCheapest!)} 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(liveCheapest)} 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 && liveBids.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 ({liveBids.length})\n </p>\n <div className=\"space-y-2\">\n {liveBids.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;AAoEQ;AAjER,0BAGO;AACP,2BAA6C;AAC7C,6BAA+B;AAC/B,2BAA6B;AAC7B,wBAA0B;AAC1B,oBAAsD;AACtD,kBAAqC;AACrC,0BAA8B;AAgD9B,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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,+CAA8C;AAAA;AAAA,QACvC,SAAS;AAAA,QAAO;AAAA,SACpC;AAAA,MACA,4CAAC,SAAI,WAAU,aACZ,mBAAS,IAAI,CAAC,QACb,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 { DualPrice } from \"./dual-price.js\";\nimport { formatDisplayPrice, parsePriceDisplay } from \"../utils/format.js\";\nimport { isExpired, timeUntil } from \"../utils/time.js\";\nimport { isSameAddress } from \"../utils/same-address.js\";\nimport { AssetAccessCards, CompanionAppCard } from \"./asset-access-cards.js\";\nimport type { AssetRef } from \"./medialane-app.js\";\n\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 asset: AssetRef;\n cheapest?: T;\n isOwner: boolean;\n isSignedIn: boolean;\n isProcessing: boolean;\n isERC1155: boolean;\n canListMoreEditions?: boolean;\n isMarketLoading?: boolean;\n myListing: T | null;\n activeBids: T[];\n walletAddress?: string | null;\n remixEnabled?: boolean;\n showDealOption?: boolean;\n\n usdValue?: string | null;\n\n renderHelp: (content: string) => ReactNode;\n onCancelClick: (order: T) => void;\n onAcceptBid: (order: T) => void;\n onOpenListing: () => void;\n onOpenTransfer: () => void;\n onOpenPurchase: (order: T) => void;\n onOpenOffer: () => void;\n onOpenRemix?: () => void;\n onProposeDeal?: () => void;\n\n showSponsorOption?: boolean;\n onOpenSponsorProposal?: () => void;\n\n showSponsorSolicitOption?: boolean;\n onOpenSponsorSolicit?: () => void;\n\n floorPriceRaw?: string | null;\n lastSaleRaw?: string | null;\n\n}\n\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 asset,\n cheapest,\n isOwner,\n isSignedIn,\n isProcessing,\n isERC1155,\n canListMoreEditions,\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 renderHelp,\n onCancelClick,\n onAcceptBid,\n onOpenListing,\n onOpenTransfer,\n onOpenPurchase,\n onOpenOffer,\n onOpenRemix,\n onProposeDeal,\n}: AssetMarketplacePanelProps<T>) {\n const liveBids = activeBids.filter((bid) => !isExpired(bid.endTime));\n const liveCheapest = cheapest && !isExpired(cheapest.endTime) ? cheapest : undefined;\n const liveMyListing = myListing && !isExpired(myListing.endTime) ? myListing : null;\n\n const myBid = !isOwner && walletAddress\n ? liveBids.find((bid) => isSameAddress(bid.offerer, walletAddress)) ?? null\n : null;\n\n const canBuyMore =\n isERC1155 && isOwner && !!liveCheapest && !!walletAddress &&\n !isSameAddress(liveCheapest.offerer, walletAddress);\n\n if (isMarketLoading && !liveCheapest) {\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 {liveCheapest ? (\n <div className=\"space-y-4\">\n <DualPrice\n amountFormatted={liveCheapest.price.formatted}\n currency={liveCheapest.price.currency}\n usdValue={usdValue}\n scale=\"hero\"\n trailing={renderHelp(\n `${isOwner && !canBuyMore ? \"Your listing\" : \"Current price\"} · Expires ${timeUntil(liveCheapest.endTime)}`\n )}\n />\n\n {isOwner ? (\n <div className=\"space-y-2\">\n <div className=\"grid grid-cols-2 gap-2\">\n {liveMyListing ? (\n <ActionButton big\n icon={isProcessing ? <Loader2 className=\"h-4 w-4 animate-spin\" /> : <X className=\"h-4 w-4\" />}\n onClick={() => onCancelClick(liveMyListing)}\n disabled={isProcessing}\n tone=\"red\"\n renderHelp={renderHelp}\n >\n {isERC1155 ? \"Cancel My Listing\" : \"Cancel Listing\"}\n </ActionButton>\n ) : null}\n\n {(!liveMyListing || (isERC1155 && canListMoreEditions !== false)) ? (\n <ActionButton big tone=\"blue\" icon={<Tag className=\"h-4 w-4\" />} onClick={onOpenListing} renderHelp={renderHelp}>\n {liveMyListing ? \"List More Editions\" : \"List on Marketplace\"}\n </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(liveCheapest!)} 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(liveCheapest)} 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 <AssetAccessCards asset={asset} />\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 <AssetAccessCards asset={asset} />\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 && liveBids.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 ({liveBids.length})\n </p>\n <div className=\"space-y-2\">\n {liveBids.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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M,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,IAEH,aAAa,4CAAC,8CAAiB,OAAc,IAAK;AAAA,KACrD,GACF;AAEJ;","names":[]}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
+
import { AssetRef } from './medialane-app.cjs';
|
|
4
|
+
import '@medialane/sdk/starknet';
|
|
5
|
+
import './fast-mint/types.cjs';
|
|
6
|
+
import 'starknet';
|
|
7
|
+
import '@medialane/sdk';
|
|
3
8
|
|
|
4
9
|
interface ApiOrderLike {
|
|
5
10
|
orderHash: string;
|
|
@@ -11,6 +16,7 @@ interface ApiOrderLike {
|
|
|
11
16
|
};
|
|
12
17
|
}
|
|
13
18
|
interface AssetMarketplacePanelProps<T extends ApiOrderLike = ApiOrderLike> {
|
|
19
|
+
asset: AssetRef;
|
|
14
20
|
cheapest?: T;
|
|
15
21
|
isOwner: boolean;
|
|
16
22
|
isSignedIn: boolean;
|
|
@@ -24,7 +30,6 @@ interface AssetMarketplacePanelProps<T extends ApiOrderLike = ApiOrderLike> {
|
|
|
24
30
|
remixEnabled?: boolean;
|
|
25
31
|
showDealOption?: boolean;
|
|
26
32
|
usdValue?: string | null;
|
|
27
|
-
renderAuthAction: (label: string) => ReactNode;
|
|
28
33
|
renderHelp: (content: string) => ReactNode;
|
|
29
34
|
onCancelClick: (order: T) => void;
|
|
30
35
|
onAcceptBid: (order: T) => void;
|
|
@@ -41,6 +46,6 @@ interface AssetMarketplacePanelProps<T extends ApiOrderLike = ApiOrderLike> {
|
|
|
41
46
|
floorPriceRaw?: string | null;
|
|
42
47
|
lastSaleRaw?: string | null;
|
|
43
48
|
}
|
|
44
|
-
declare function AssetMarketplacePanel<T extends ApiOrderLike = ApiOrderLike>({ cheapest, isOwner, isSignedIn, isProcessing, isERC1155, canListMoreEditions, isMarketLoading, myListing, activeBids, walletAddress, remixEnabled, showDealOption, showSponsorOption, onOpenSponsorProposal, showSponsorSolicitOption, onOpenSponsorSolicit, floorPriceRaw, lastSaleRaw, usdValue,
|
|
49
|
+
declare function AssetMarketplacePanel<T extends ApiOrderLike = ApiOrderLike>({ asset, cheapest, isOwner, isSignedIn, isProcessing, isERC1155, canListMoreEditions, isMarketLoading, myListing, activeBids, walletAddress, remixEnabled, showDealOption, showSponsorOption, onOpenSponsorProposal, showSponsorSolicitOption, onOpenSponsorSolicit, floorPriceRaw, lastSaleRaw, usdValue, renderHelp, onCancelClick, onAcceptBid, onOpenListing, onOpenTransfer, onOpenPurchase, onOpenOffer, onOpenRemix, onProposeDeal, }: AssetMarketplacePanelProps<T>): react_jsx_runtime.JSX.Element;
|
|
45
50
|
|
|
46
51
|
export { type ApiOrderLike, AssetMarketplacePanel, type AssetMarketplacePanelProps };
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
+
import { AssetRef } from './medialane-app.js';
|
|
4
|
+
import '@medialane/sdk/starknet';
|
|
5
|
+
import './fast-mint/types.js';
|
|
6
|
+
import 'starknet';
|
|
7
|
+
import '@medialane/sdk';
|
|
3
8
|
|
|
4
9
|
interface ApiOrderLike {
|
|
5
10
|
orderHash: string;
|
|
@@ -11,6 +16,7 @@ interface ApiOrderLike {
|
|
|
11
16
|
};
|
|
12
17
|
}
|
|
13
18
|
interface AssetMarketplacePanelProps<T extends ApiOrderLike = ApiOrderLike> {
|
|
19
|
+
asset: AssetRef;
|
|
14
20
|
cheapest?: T;
|
|
15
21
|
isOwner: boolean;
|
|
16
22
|
isSignedIn: boolean;
|
|
@@ -24,7 +30,6 @@ interface AssetMarketplacePanelProps<T extends ApiOrderLike = ApiOrderLike> {
|
|
|
24
30
|
remixEnabled?: boolean;
|
|
25
31
|
showDealOption?: boolean;
|
|
26
32
|
usdValue?: string | null;
|
|
27
|
-
renderAuthAction: (label: string) => ReactNode;
|
|
28
33
|
renderHelp: (content: string) => ReactNode;
|
|
29
34
|
onCancelClick: (order: T) => void;
|
|
30
35
|
onAcceptBid: (order: T) => void;
|
|
@@ -41,6 +46,6 @@ interface AssetMarketplacePanelProps<T extends ApiOrderLike = ApiOrderLike> {
|
|
|
41
46
|
floorPriceRaw?: string | null;
|
|
42
47
|
lastSaleRaw?: string | null;
|
|
43
48
|
}
|
|
44
|
-
declare function AssetMarketplacePanel<T extends ApiOrderLike = ApiOrderLike>({ cheapest, isOwner, isSignedIn, isProcessing, isERC1155, canListMoreEditions, isMarketLoading, myListing, activeBids, walletAddress, remixEnabled, showDealOption, showSponsorOption, onOpenSponsorProposal, showSponsorSolicitOption, onOpenSponsorSolicit, floorPriceRaw, lastSaleRaw, usdValue,
|
|
49
|
+
declare function AssetMarketplacePanel<T extends ApiOrderLike = ApiOrderLike>({ asset, cheapest, isOwner, isSignedIn, isProcessing, isERC1155, canListMoreEditions, isMarketLoading, myListing, activeBids, walletAddress, remixEnabled, showDealOption, showSponsorOption, onOpenSponsorProposal, showSponsorSolicitOption, onOpenSponsorSolicit, floorPriceRaw, lastSaleRaw, usdValue, renderHelp, onCancelClick, onAcceptBid, onOpenListing, onOpenTransfer, onOpenPurchase, onOpenOffer, onOpenRemix, onProposeDeal, }: AssetMarketplacePanelProps<T>): react_jsx_runtime.JSX.Element;
|
|
45
50
|
|
|
46
51
|
export { type ApiOrderLike, AssetMarketplacePanel, type AssetMarketplacePanelProps };
|
|
@@ -19,6 +19,7 @@ import { DualPrice } from "./dual-price.js";
|
|
|
19
19
|
import { formatDisplayPrice, parsePriceDisplay } from "../utils/format.js";
|
|
20
20
|
import { isExpired, timeUntil } from "../utils/time.js";
|
|
21
21
|
import { isSameAddress } from "../utils/same-address.js";
|
|
22
|
+
import { AssetAccessCards, CompanionAppCard } from "./asset-access-cards.js";
|
|
22
23
|
function StatRow({ floorPriceRaw, lastSaleRaw }) {
|
|
23
24
|
const floor = floorPriceRaw ? parsePriceDisplay(floorPriceRaw) : null;
|
|
24
25
|
const lastSale = lastSaleRaw ? parsePriceDisplay(lastSaleRaw) : null;
|
|
@@ -35,6 +36,7 @@ function StatRow({ floorPriceRaw, lastSaleRaw }) {
|
|
|
35
36
|
] });
|
|
36
37
|
}
|
|
37
38
|
function AssetMarketplacePanel({
|
|
39
|
+
asset,
|
|
38
40
|
cheapest,
|
|
39
41
|
isOwner,
|
|
40
42
|
isSignedIn,
|
|
@@ -54,7 +56,6 @@ function AssetMarketplacePanel({
|
|
|
54
56
|
floorPriceRaw,
|
|
55
57
|
lastSaleRaw,
|
|
56
58
|
usdValue,
|
|
57
|
-
renderAuthAction,
|
|
58
59
|
renderHelp,
|
|
59
60
|
onCancelClick,
|
|
60
61
|
onAcceptBid,
|
|
@@ -180,7 +181,7 @@ function AssetMarketplacePanel({
|
|
|
180
181
|
) : null
|
|
181
182
|
] }),
|
|
182
183
|
!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
|
|
183
|
-
] }) :
|
|
184
|
+
] }) : /* @__PURE__ */ jsx(AssetAccessCards, { asset })
|
|
184
185
|
] }) : /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
|
|
185
186
|
/* @__PURE__ */ jsx(StatRow, { floorPriceRaw, lastSaleRaw }),
|
|
186
187
|
isOwner ? /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-2", children: [
|
|
@@ -236,7 +237,7 @@ function AssetMarketplacePanel({
|
|
|
236
237
|
children: "Sponsor this IP"
|
|
237
238
|
}
|
|
238
239
|
) : null
|
|
239
|
-
] }) :
|
|
240
|
+
] }) : /* @__PURE__ */ jsx(AssetAccessCards, { asset })
|
|
240
241
|
] }),
|
|
241
242
|
myBid ? /* @__PURE__ */ jsxs("div", { className: "rounded-xl bg-amber-500/8 px-4 py-3 flex items-center justify-between gap-3", children: [
|
|
242
243
|
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex items-center gap-2.5", children: [
|
|
@@ -300,7 +301,8 @@ function AssetMarketplacePanel({
|
|
|
300
301
|
}
|
|
301
302
|
)
|
|
302
303
|
] }, bid.orderHash)) })
|
|
303
|
-
] }) : null
|
|
304
|
+
] }) : null,
|
|
305
|
+
isSignedIn ? /* @__PURE__ */ jsx(CompanionAppCard, { asset }) : null
|
|
304
306
|
] }) });
|
|
305
307
|
}
|
|
306
308
|
export {
|