@medialane/ui 0.382.0 → 0.384.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/account-section.cjs +3 -4
- package/dist/components/account/account-section.cjs.map +1 -1
- package/dist/components/account/account-section.d.cts +3 -3
- package/dist/components/account/account-section.d.ts +3 -3
- package/dist/components/account/account-section.js +3 -4
- package/dist/components/account/account-section.js.map +1 -1
- package/dist/components/account/guardian-recovery-section.cjs +2 -1
- package/dist/components/account/guardian-recovery-section.cjs.map +1 -1
- package/dist/components/account/guardian-recovery-section.js +2 -1
- package/dist/components/account/guardian-recovery-section.js.map +1 -1
- package/dist/components/account/input-otp.d.cts +2 -2
- package/dist/components/account/input-otp.d.ts +2 -2
- package/dist/components/accounts-page.cjs +2 -1
- package/dist/components/accounts-page.cjs.map +1 -1
- package/dist/components/accounts-page.js +2 -1
- package/dist/components/accounts-page.js.map +1 -1
- package/dist/components/activities-feed.cjs +2 -1
- package/dist/components/activities-feed.cjs.map +1 -1
- package/dist/components/activities-feed.js +2 -1
- package/dist/components/activities-feed.js.map +1 -1
- package/dist/components/activity-timeline-row.cjs +2 -1
- package/dist/components/activity-timeline-row.cjs.map +1 -1
- package/dist/components/activity-timeline-row.js +2 -1
- package/dist/components/activity-timeline-row.js.map +1 -1
- package/dist/components/asset-overview-content.cjs +2 -1
- package/dist/components/asset-overview-content.cjs.map +1 -1
- package/dist/components/asset-overview-content.js +2 -1
- package/dist/components/asset-overview-content.js.map +1 -1
- package/dist/components/asset-picker.cjs +2 -1
- package/dist/components/asset-picker.cjs.map +1 -1
- package/dist/components/asset-picker.js +2 -1
- package/dist/components/asset-picker.js.map +1 -1
- package/dist/components/button.d.cts +1 -1
- package/dist/components/button.d.ts +1 -1
- package/dist/components/claim-rail.cjs +5 -8
- package/dist/components/claim-rail.cjs.map +1 -1
- package/dist/components/claim-rail.d.cts +1 -4
- package/dist/components/claim-rail.d.ts +1 -4
- package/dist/components/claim-rail.js +5 -8
- package/dist/components/claim-rail.js.map +1 -1
- package/dist/components/collection-settings.cjs +2 -3
- package/dist/components/collection-settings.cjs.map +1 -1
- package/dist/components/collection-settings.js +2 -3
- package/dist/components/collection-settings.js.map +1 -1
- package/dist/components/collection-slug-claim.cjs +1 -7
- package/dist/components/collection-slug-claim.cjs.map +1 -1
- package/dist/components/collection-slug-claim.js +1 -7
- package/dist/components/collection-slug-claim.js.map +1 -1
- package/dist/components/comments-section.cjs +2 -1
- package/dist/components/comments-section.cjs.map +1 -1
- package/dist/components/comments-section.js +2 -1
- package/dist/components/comments-section.js.map +1 -1
- package/dist/components/discover-features.cjs +7 -6
- package/dist/components/discover-features.cjs.map +1 -1
- package/dist/components/discover-features.js +7 -6
- package/dist/components/discover-features.js.map +1 -1
- package/dist/components/empty-or-error.cjs +3 -2
- package/dist/components/empty-or-error.cjs.map +1 -1
- package/dist/components/empty-or-error.js +3 -2
- package/dist/components/empty-or-error.js.map +1 -1
- package/dist/components/gated-content.cjs +5 -4
- package/dist/components/gated-content.cjs.map +1 -1
- package/dist/components/gated-content.js +5 -4
- package/dist/components/gated-content.js.map +1 -1
- package/dist/components/icon-tile.cjs +49 -0
- package/dist/components/icon-tile.cjs.map +1 -0
- package/dist/components/icon-tile.d.cts +17 -0
- package/dist/components/icon-tile.d.ts +17 -0
- package/dist/components/icon-tile.js +25 -0
- package/dist/components/icon-tile.js.map +1 -0
- package/dist/components/ip-type-nav.cjs +3 -3
- package/dist/components/ip-type-nav.cjs.map +1 -1
- package/dist/components/ip-type-nav.js +3 -3
- package/dist/components/ip-type-nav.js.map +1 -1
- package/dist/components/ip-type-page.cjs +3 -2
- package/dist/components/ip-type-page.cjs.map +1 -1
- package/dist/components/ip-type-page.js +3 -2
- package/dist/components/ip-type-page.js.map +1 -1
- package/dist/components/journey-content.cjs +2 -1
- package/dist/components/journey-content.cjs.map +1 -1
- package/dist/components/journey-content.js +2 -1
- package/dist/components/journey-content.js.map +1 -1
- package/dist/components/launchpad/edition-mint-schema.d.cts +2 -2
- package/dist/components/launchpad/edition-mint-schema.d.ts +2 -2
- package/dist/components/launchpad-services.cjs +27 -22
- package/dist/components/launchpad-services.cjs.map +1 -1
- package/dist/components/launchpad-services.d.cts +2 -0
- package/dist/components/launchpad-services.d.ts +2 -0
- package/dist/components/launchpad-services.js +27 -22
- package/dist/components/launchpad-services.js.map +1 -1
- package/dist/components/launchpad-strip.cjs +6 -1
- package/dist/components/launchpad-strip.cjs.map +1 -1
- package/dist/components/launchpad-strip.js +6 -1
- package/dist/components/launchpad-strip.js.map +1 -1
- package/dist/components/license-request-page.cjs +2 -1
- package/dist/components/license-request-page.cjs.map +1 -1
- package/dist/components/license-request-page.js +2 -1
- package/dist/components/license-request-page.js.map +1 -1
- package/dist/components/marketplace-dialog-primitives.cjs +2 -1
- package/dist/components/marketplace-dialog-primitives.cjs.map +1 -1
- package/dist/components/marketplace-dialog-primitives.js +2 -1
- package/dist/components/marketplace-dialog-primitives.js.map +1 -1
- package/dist/components/media-wallet/media-wallet-home.cjs +3 -2
- package/dist/components/media-wallet/media-wallet-home.cjs.map +1 -1
- package/dist/components/media-wallet/media-wallet-home.js +3 -2
- package/dist/components/media-wallet/media-wallet-home.js.map +1 -1
- package/dist/components/media-wallet/wallet-activity-icon.cjs +5 -8
- package/dist/components/media-wallet/wallet-activity-icon.cjs.map +1 -1
- package/dist/components/media-wallet/wallet-activity-icon.js +5 -8
- package/dist/components/media-wallet/wallet-activity-icon.js.map +1 -1
- package/dist/components/mint-landing.cjs +7 -10
- package/dist/components/mint-landing.cjs.map +1 -1
- package/dist/components/mint-landing.js +7 -10
- package/dist/components/mint-landing.js.map +1 -1
- package/dist/components/nav-command-menu.cjs +2 -1
- package/dist/components/nav-command-menu.cjs.map +1 -1
- package/dist/components/nav-command-menu.js +2 -1
- package/dist/components/nav-command-menu.js.map +1 -1
- package/dist/components/remixes-tab.cjs +2 -1
- package/dist/components/remixes-tab.cjs.map +1 -1
- package/dist/components/remixes-tab.js +2 -1
- package/dist/components/remixes-tab.js.map +1 -1
- package/dist/components/rewards/badge-catalog.cjs +2 -1
- package/dist/components/rewards/badge-catalog.cjs.map +1 -1
- package/dist/components/rewards/badge-catalog.js +2 -1
- package/dist/components/rewards/badge-catalog.js.map +1 -1
- package/dist/components/rewards/leaderboard-panel.cjs +2 -1
- package/dist/components/rewards/leaderboard-panel.cjs.map +1 -1
- package/dist/components/rewards/leaderboard-panel.js +2 -1
- package/dist/components/rewards/leaderboard-panel.js.map +1 -1
- package/dist/components/rewards/rewards-dashboard.cjs +2 -4
- package/dist/components/rewards/rewards-dashboard.cjs.map +1 -1
- package/dist/components/rewards/rewards-dashboard.js +2 -4
- package/dist/components/rewards/rewards-dashboard.js.map +1 -1
- package/dist/components/rewards-section.cjs +2 -1
- package/dist/components/rewards-section.cjs.map +1 -1
- package/dist/components/rewards-section.js +2 -1
- package/dist/components/rewards-section.js.map +1 -1
- package/dist/components/route-error.cjs +2 -1
- package/dist/components/route-error.cjs.map +1 -1
- package/dist/components/route-error.js +2 -1
- package/dist/components/route-error.js.map +1 -1
- package/dist/components/service-collections-page.cjs +2 -1
- package/dist/components/service-collections-page.cjs.map +1 -1
- package/dist/components/service-collections-page.js +2 -1
- package/dist/components/service-collections-page.js.map +1 -1
- package/dist/components/settings-section.cjs +3 -4
- package/dist/components/settings-section.cjs.map +1 -1
- package/dist/components/settings-section.d.cts +1 -3
- package/dist/components/settings-section.d.ts +1 -3
- package/dist/components/settings-section.js +3 -4
- package/dist/components/settings-section.js.map +1 -1
- package/dist/components/sponsorship-offers-page.cjs +2 -1
- package/dist/components/sponsorship-offers-page.cjs.map +1 -1
- package/dist/components/sponsorship-offers-page.js +2 -1
- package/dist/components/sponsorship-offers-page.js.map +1 -1
- package/dist/components/tab-empty-state.cjs +2 -1
- package/dist/components/tab-empty-state.cjs.map +1 -1
- package/dist/components/tab-empty-state.js +2 -1
- package/dist/components/tab-empty-state.js.map +1 -1
- package/dist/components/transaction-dialog.cjs +2 -1
- package/dist/components/transaction-dialog.cjs.map +1 -1
- package/dist/components/transaction-dialog.js +2 -1
- package/dist/components/transaction-dialog.js.map +1 -1
- package/dist/index.cjs +3 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/medialane.css +20 -0
- package/package.json +1 -1
|
@@ -23,18 +23,17 @@ __export(account_section_exports, {
|
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(account_section_exports);
|
|
25
25
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
26
|
-
var
|
|
26
|
+
var import_icon_tile = require("../icon-tile.js");
|
|
27
27
|
function AccountSection({
|
|
28
28
|
icon: Icon,
|
|
29
|
-
iconColor = "text-primary",
|
|
30
|
-
iconBg = "bg-primary/10",
|
|
31
29
|
title,
|
|
32
30
|
description,
|
|
31
|
+
destructive,
|
|
33
32
|
children
|
|
34
33
|
}) {
|
|
35
34
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "panel p-5 sm:p-6 space-y-5", children: [
|
|
36
35
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-start gap-3", children: [
|
|
37
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
36
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icon_tile.IconTile, { destructive, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, {}) }),
|
|
38
37
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
|
|
39
38
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h3", { className: "text-base font-bold text-foreground", children: title }),
|
|
40
39
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm text-muted-foreground mt-0.5", children: description })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/account/account-section.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ElementType, ReactNode } from \"react\";\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../src/components/account/account-section.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ElementType, ReactNode } from \"react\";\nimport { IconTile } from \"../icon-tile.js\";\n\nexport interface AccountSectionProps {\n icon: ElementType;\n title: string;\n description: string;\n /** Red icon tile for irreversible actions. */\n destructive?: boolean;\n children: ReactNode;\n}\n\nexport function AccountSection({\n icon: Icon,\n title,\n description,\n destructive,\n children,\n}: AccountSectionProps) {\n return (\n <div className=\"panel p-5 sm:p-6 space-y-5\">\n <div className=\"flex items-start gap-3\">\n <IconTile destructive={destructive}>\n <Icon />\n </IconTile>\n <div>\n <h3 className=\"text-base font-bold text-foreground\">{title}</h3>\n <p className=\"text-sm text-muted-foreground mt-0.5\">{description}</p>\n </div>\n </div>\n <div className=\"space-y-4\">{children}</div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAyBU;AAtBV,uBAAyB;AAWlB,SAAS,eAAe;AAAA,EAC7B,MAAM;AAAA,EACN;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAwB;AACtB,SACE,6CAAC,SAAI,WAAU,8BACb;AAAA,iDAAC,SAAI,WAAU,0BACb;AAAA,kDAAC,6BAAS,aACR,sDAAC,QAAK,GACR;AAAA,MACA,6CAAC,SACC;AAAA,oDAAC,QAAG,WAAU,uCAAuC,iBAAM;AAAA,QAC3D,4CAAC,OAAE,WAAU,wCAAwC,uBAAY;AAAA,SACnE;AAAA,OACF;AAAA,IACA,4CAAC,SAAI,WAAU,aAAa,UAAS;AAAA,KACvC;AAEJ;","names":[]}
|
|
@@ -3,12 +3,12 @@ import { ElementType, ReactNode } from 'react';
|
|
|
3
3
|
|
|
4
4
|
interface AccountSectionProps {
|
|
5
5
|
icon: ElementType;
|
|
6
|
-
iconColor?: string;
|
|
7
|
-
iconBg?: string;
|
|
8
6
|
title: string;
|
|
9
7
|
description: string;
|
|
8
|
+
/** Red icon tile for irreversible actions. */
|
|
9
|
+
destructive?: boolean;
|
|
10
10
|
children: ReactNode;
|
|
11
11
|
}
|
|
12
|
-
declare function AccountSection({ icon: Icon,
|
|
12
|
+
declare function AccountSection({ icon: Icon, title, description, destructive, children, }: AccountSectionProps): react_jsx_runtime.JSX.Element;
|
|
13
13
|
|
|
14
14
|
export { AccountSection, type AccountSectionProps };
|
|
@@ -3,12 +3,12 @@ import { ElementType, ReactNode } from 'react';
|
|
|
3
3
|
|
|
4
4
|
interface AccountSectionProps {
|
|
5
5
|
icon: ElementType;
|
|
6
|
-
iconColor?: string;
|
|
7
|
-
iconBg?: string;
|
|
8
6
|
title: string;
|
|
9
7
|
description: string;
|
|
8
|
+
/** Red icon tile for irreversible actions. */
|
|
9
|
+
destructive?: boolean;
|
|
10
10
|
children: ReactNode;
|
|
11
11
|
}
|
|
12
|
-
declare function AccountSection({ icon: Icon,
|
|
12
|
+
declare function AccountSection({ icon: Icon, title, description, destructive, children, }: AccountSectionProps): react_jsx_runtime.JSX.Element;
|
|
13
13
|
|
|
14
14
|
export { AccountSection, type AccountSectionProps };
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
3
|
+
import { IconTile } from "../icon-tile.js";
|
|
4
4
|
function AccountSection({
|
|
5
5
|
icon: Icon,
|
|
6
|
-
iconColor = "text-primary",
|
|
7
|
-
iconBg = "bg-primary/10",
|
|
8
6
|
title,
|
|
9
7
|
description,
|
|
8
|
+
destructive,
|
|
10
9
|
children
|
|
11
10
|
}) {
|
|
12
11
|
return /* @__PURE__ */ jsxs("div", { className: "panel p-5 sm:p-6 space-y-5", children: [
|
|
13
12
|
/* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
|
|
14
|
-
/* @__PURE__ */ jsx(
|
|
13
|
+
/* @__PURE__ */ jsx(IconTile, { destructive, children: /* @__PURE__ */ jsx(Icon, {}) }),
|
|
15
14
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
16
15
|
/* @__PURE__ */ jsx("h3", { className: "text-base font-bold text-foreground", children: title }),
|
|
17
16
|
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground mt-0.5", children: description })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/account/account-section.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ElementType, ReactNode } from \"react\";\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../src/components/account/account-section.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ElementType, ReactNode } from \"react\";\nimport { IconTile } from \"../icon-tile.js\";\n\nexport interface AccountSectionProps {\n icon: ElementType;\n title: string;\n description: string;\n /** Red icon tile for irreversible actions. */\n destructive?: boolean;\n children: ReactNode;\n}\n\nexport function AccountSection({\n icon: Icon,\n title,\n description,\n destructive,\n children,\n}: AccountSectionProps) {\n return (\n <div className=\"panel p-5 sm:p-6 space-y-5\">\n <div className=\"flex items-start gap-3\">\n <IconTile destructive={destructive}>\n <Icon />\n </IconTile>\n <div>\n <h3 className=\"text-base font-bold text-foreground\">{title}</h3>\n <p className=\"text-sm text-muted-foreground mt-0.5\">{description}</p>\n </div>\n </div>\n <div className=\"space-y-4\">{children}</div>\n </div>\n );\n}\n"],"mappings":";AAyBU,cAEF,YAFE;AAtBV,SAAS,gBAAgB;AAWlB,SAAS,eAAe;AAAA,EAC7B,MAAM;AAAA,EACN;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAwB;AACtB,SACE,qBAAC,SAAI,WAAU,8BACb;AAAA,yBAAC,SAAI,WAAU,0BACb;AAAA,0BAAC,YAAS,aACR,8BAAC,QAAK,GACR;AAAA,MACA,qBAAC,SACC;AAAA,4BAAC,QAAG,WAAU,uCAAuC,iBAAM;AAAA,QAC3D,oBAAC,OAAE,WAAU,wCAAwC,uBAAY;AAAA,SACnE;AAAA,OACF;AAAA,IACA,oBAAC,SAAI,WAAU,aAAa,UAAS;AAAA,KACvC;AAEJ;","names":[]}
|
|
@@ -44,6 +44,7 @@ var import_describe_error = require("../../utils/describe-error.js");
|
|
|
44
44
|
var import_add_guardian_dialog = require("./add-guardian-dialog.js");
|
|
45
45
|
var import_provider = require("../../i18n/provider.js");
|
|
46
46
|
var import_use_format = require("../../i18n/use-format.js");
|
|
47
|
+
var import_icon_tile = require("../icon-tile.js");
|
|
47
48
|
const short = (a) => `${a.slice(0, 6)}\u2026${a.slice(-4)}`;
|
|
48
49
|
function GuardianRecoverySection({
|
|
49
50
|
walletAddress,
|
|
@@ -86,7 +87,7 @@ function GuardianRecoverySection({
|
|
|
86
87
|
const sealed = loadSealed();
|
|
87
88
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "panel p-5 sm:p-6 space-y-5", children: [
|
|
88
89
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-start gap-3", children: [
|
|
89
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
90
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icon_tile.IconTile, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Shield, {}) }),
|
|
90
91
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
|
|
91
92
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h3", { className: "text-base font-bold text-foreground", children: t("Security & recovery") }),
|
|
92
93
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm text-muted-foreground mt-0.5", children: t("A guardian is a trusted backup that helps restore this wallet on a new device.") })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/account/guardian-recovery-section.tsx"],"sourcesContent":["\"use client\";\n\nimport { useCallback, useEffect, useState } from \"react\";\nimport { Shield, ShieldAlert, ChevronRight, Loader2 } from \"lucide-react\";\nimport {\n describeGuardianStatus,\n describeRecoveryAction,\n type EscapeInfo,\n type GuardianInfo,\n} from \"@medialane/sdk/starknet\";\nimport Link from \"../link.js\";\nimport { Button } from \"../button.js\";\nimport { Badge } from \"../badge.js\";\nimport { Alert, AlertDescription } from \"../alert.js\";\nimport { describeError } from \"../../utils/describe-error.js\";\nimport { AddGuardianDialog } from \"./add-guardian-dialog.js\";\nimport type { GuardianWallet, LoadSealedOwner } from \"./wallet-types.js\";\nimport { useT } from \"../../i18n/provider.js\";\nimport { useFormat } from \"../../i18n/use-format.js\";\n\nconst short = (a: string) => `${a.slice(0, 6)}…${a.slice(-4)}`;\n\nexport interface GuardianRecoverySectionProps {\n walletAddress: string;\n wallet: GuardianWallet;\n loadSealed: LoadSealedOwner;\n guardianRecoveryAvailable: boolean;\n recoverHref?: string;\n}\n\nexport function GuardianRecoverySection({\n walletAddress,\n wallet,\n loadSealed,\n guardianRecoveryAvailable,\n recoverHref = \"/recover\",\n}: GuardianRecoverySectionProps) {\n const intl = useFormat();\n const t = useT();\n const [guardians, setGuardians] = useState<GuardianInfo[] | null>(null);\n const [escape, setEscape] = useState<EscapeInfo | null>(null);\n const [addOpen, setAddOpen] = useState(false);\n const [cancelBusy, setCancelBusy] = useState(false);\n const [cancelError, setCancelError] = useState<string | null>(null);\n\n const refresh = useCallback(() => {\n wallet.getGuardians(walletAddress).then(setGuardians).catch(() => setGuardians([]));\n wallet.getEscape(walletAddress).then(setEscape).catch(() => setEscape(null));\n }, [walletAddress, wallet]);\n\n useEffect(() => { refresh(); }, [refresh]);\n\n const handleCancel = async () => {\n const sealed = loadSealed();\n if (!sealed) return;\n setCancelBusy(true);\n setCancelError(null);\n try {\n await wallet.cancelEscape(sealed);\n refresh();\n } catch (e) {\n setCancelError(describeError(e).message);\n } finally {\n setCancelBusy(false);\n }\n };\n\n const status = guardians ? describeGuardianStatus(guardians) : null;\n const recoveryAction = escape ? describeRecoveryAction(escape) : \"none\";\n const inProgress = escape?.escapeType === \"Owner\" && recoveryAction !== \"none\" ? escape : null;\n\n const sealed = loadSealed();\n\n return (\n <div className=\"panel p-5 sm:p-6 space-y-5\">\n <div className=\"flex items-start gap-3\">\n <
|
|
1
|
+
{"version":3,"sources":["../../../src/components/account/guardian-recovery-section.tsx"],"sourcesContent":["\"use client\";\n\nimport { useCallback, useEffect, useState } from \"react\";\nimport { Shield, ShieldAlert, ChevronRight, Loader2 } from \"lucide-react\";\nimport {\n describeGuardianStatus,\n describeRecoveryAction,\n type EscapeInfo,\n type GuardianInfo,\n} from \"@medialane/sdk/starknet\";\nimport Link from \"../link.js\";\nimport { Button } from \"../button.js\";\nimport { Badge } from \"../badge.js\";\nimport { Alert, AlertDescription } from \"../alert.js\";\nimport { describeError } from \"../../utils/describe-error.js\";\nimport { AddGuardianDialog } from \"./add-guardian-dialog.js\";\nimport type { GuardianWallet, LoadSealedOwner } from \"./wallet-types.js\";\nimport { useT } from \"../../i18n/provider.js\";\nimport { useFormat } from \"../../i18n/use-format.js\";\nimport { IconTile } from \"../icon-tile.js\";\n\nconst short = (a: string) => `${a.slice(0, 6)}…${a.slice(-4)}`;\n\nexport interface GuardianRecoverySectionProps {\n walletAddress: string;\n wallet: GuardianWallet;\n loadSealed: LoadSealedOwner;\n guardianRecoveryAvailable: boolean;\n recoverHref?: string;\n}\n\nexport function GuardianRecoverySection({\n walletAddress,\n wallet,\n loadSealed,\n guardianRecoveryAvailable,\n recoverHref = \"/recover\",\n}: GuardianRecoverySectionProps) {\n const intl = useFormat();\n const t = useT();\n const [guardians, setGuardians] = useState<GuardianInfo[] | null>(null);\n const [escape, setEscape] = useState<EscapeInfo | null>(null);\n const [addOpen, setAddOpen] = useState(false);\n const [cancelBusy, setCancelBusy] = useState(false);\n const [cancelError, setCancelError] = useState<string | null>(null);\n\n const refresh = useCallback(() => {\n wallet.getGuardians(walletAddress).then(setGuardians).catch(() => setGuardians([]));\n wallet.getEscape(walletAddress).then(setEscape).catch(() => setEscape(null));\n }, [walletAddress, wallet]);\n\n useEffect(() => { refresh(); }, [refresh]);\n\n const handleCancel = async () => {\n const sealed = loadSealed();\n if (!sealed) return;\n setCancelBusy(true);\n setCancelError(null);\n try {\n await wallet.cancelEscape(sealed);\n refresh();\n } catch (e) {\n setCancelError(describeError(e).message);\n } finally {\n setCancelBusy(false);\n }\n };\n\n const status = guardians ? describeGuardianStatus(guardians) : null;\n const recoveryAction = escape ? describeRecoveryAction(escape) : \"none\";\n const inProgress = escape?.escapeType === \"Owner\" && recoveryAction !== \"none\" ? escape : null;\n\n const sealed = loadSealed();\n\n return (\n <div className=\"panel p-5 sm:p-6 space-y-5\">\n <div className=\"flex items-start gap-3\">\n <IconTile>\n <Shield />\n </IconTile>\n <div>\n <h3 className=\"text-base font-bold text-foreground\">{t(\"Security & recovery\")}</h3>\n <p className=\"text-sm text-muted-foreground mt-0.5\">\n {t(\"A guardian is a trusted backup that helps restore this wallet on a new device.\")}\n </p>\n </div>\n </div>\n\n <div className=\"space-y-3\">\n {inProgress && (\n <Alert variant=\"destructive\">\n <ShieldAlert className=\"h-4 w-4\" />\n <AlertDescription>{t.rich(\"A guardian has started replacing this wallet's owner key. {value} The replacement can be stopped with the button below.{value2}{button}\", { value: inProgress.status === \"Ready\"\n ? \"It can complete at any time.\"\n : `It can complete on ${intl.dateTime(new Date(inProgress.readyAt * 1000))}.`, value2: cancelError && <p className=\"mt-1 text-destructive\">{cancelError}</p>, button: <Button\n onClick={handleCancel}\n disabled={cancelBusy}\n variant=\"destructive\"\n size=\"sm\"\n className=\"mt-2 w-full\"\n >\n {cancelBusy ? <Loader2 className=\"mr-1.5 h-3.5 w-3.5 animate-spin\" /> : null}\n {t(\"Cancel recovery\")}\n </Button> })}\n </AlertDescription>\n </Alert>\n )}\n\n <div className=\"panel flex items-center justify-between gap-3 p-4 flex-wrap\">\n <div>\n <p className=\"text-sm font-medium text-foreground\">{t(\"Guardian recovery\")}</p>\n {status === null ? (\n <p className=\"text-xs text-muted-foreground mt-0.5\">{t(\"Checking…\")}</p>\n ) : status.kind === \"none\" ? (\n <p className=\"text-xs text-muted-foreground mt-0.5\">\n {guardianRecoveryAvailable ? t(\"Not set up — add one from another device you trust.\") : t(\"Not available yet.\")}\n </p>\n ) : (\n <p className=\"text-xs text-muted-foreground mt-0.5\">{t(\"Active: {type} guardian {short}\", { type: status.guardian.type, short: short(status.guardian.storedValue) })}\n </p>\n )}\n </div>\n {status?.kind === \"none\" && sealed && (\n <Button onClick={() => setAddOpen(true)} variant=\"soft\" size=\"sm\" disabled={!guardianRecoveryAvailable}>\n {t(\"Add guardian\")}\n </Button>\n )}\n {status?.kind === \"active\" && (\n <Badge variant=\"soft\" className=\"border-brand-blue/40 text-brand-blue bg-brand-blue/10 text-2xs\">\n {t(\"Configured\")}\n </Badge>\n )}\n </div>\n\n <Link\n href={recoverHref}\n className=\"panel flex items-center justify-between gap-3 p-4 transition-colors hover:bg-foreground/[0.03]\"\n >\n <div>\n <p className=\"text-sm font-medium text-foreground\">{t(\"Recover a wallet\")}</p>\n <p className=\"text-xs text-muted-foreground mt-0.5\">\n {t(\"Lost this device, or acting as someone's guardian?\")}\n </p>\n </div>\n <ChevronRight className=\"h-4 w-4 text-muted-foreground shrink-0\" />\n </Link>\n </div>\n\n {sealed && guardianRecoveryAvailable && (\n <AddGuardianDialog\n open={addOpen}\n onOpenChange={setAddOpen}\n sealed={sealed}\n onAdded={refresh}\n wallet={wallet}\n />\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA8EU;AA5EV,mBAAiD;AACjD,0BAA2D;AAC3D,sBAKO;AACP,kBAAiB;AACjB,oBAAuB;AACvB,mBAAsB;AACtB,mBAAwC;AACxC,4BAA8B;AAC9B,iCAAkC;AAElC,sBAAqB;AACrB,wBAA0B;AAC1B,uBAAyB;AAEzB,MAAM,QAAQ,CAAC,MAAc,GAAG,EAAE,MAAM,GAAG,CAAC,CAAC,SAAI,EAAE,MAAM,EA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UAC1B,4CAAC,wBAAO,SAAS,MAAM,WAAW,IAAI,GAAG,SAAQ,QAAO,MAAK,MAAK,UAAU,CAAC,2BAC1E,YAAE,cAAc,GACnB;AAAA,QAED,QAAQ,SAAS,YAChB,4CAAC,sBAAM,SAAQ,QAAO,WAAU,kEAC7B,YAAE,YAAY,GACjB;AAAA,SAEJ;AAAA,MAEA;AAAA,QAAC,YAAAC;AAAA,QAAA;AAAA,UACC,MAAM;AAAA,UACN,WAAU;AAAA,UAEV;AAAA,yDAAC,SACC;AAAA,0DAAC,OAAE,WAAU,uCAAuC,YAAE,kBAAkB,GAAE;AAAA,cAC1E,4CAAC,OAAE,WAAU,wCACV,YAAE,oDAAoD,GACzD;AAAA,eACF;AAAA,YACA,4CAAC,oCAAa,WAAU,0CAAyC;AAAA;AAAA;AAAA,MACnE;AAAA,OACF;AAAA,IAEC,UAAU,6BACT;AAAA,MAAC;AAAA;AAAA,QACC,MAAM;AAAA,QACN,cAAc;AAAA,QACd;AAAA,QACA,SAAS;AAAA,QACT;AAAA;AAAA,IACF;AAAA,KAEJ;AAEJ;","names":["sealed","Link"]}
|
|
@@ -14,6 +14,7 @@ import { describeError } from "../../utils/describe-error.js";
|
|
|
14
14
|
import { AddGuardianDialog } from "./add-guardian-dialog.js";
|
|
15
15
|
import { useT } from "../../i18n/provider.js";
|
|
16
16
|
import { useFormat } from "../../i18n/use-format.js";
|
|
17
|
+
import { IconTile } from "../icon-tile.js";
|
|
17
18
|
const short = (a) => `${a.slice(0, 6)}\u2026${a.slice(-4)}`;
|
|
18
19
|
function GuardianRecoverySection({
|
|
19
20
|
walletAddress,
|
|
@@ -56,7 +57,7 @@ function GuardianRecoverySection({
|
|
|
56
57
|
const sealed = loadSealed();
|
|
57
58
|
return /* @__PURE__ */ jsxs("div", { className: "panel p-5 sm:p-6 space-y-5", children: [
|
|
58
59
|
/* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
|
|
59
|
-
/* @__PURE__ */ jsx(
|
|
60
|
+
/* @__PURE__ */ jsx(IconTile, { children: /* @__PURE__ */ jsx(Shield, {}) }),
|
|
60
61
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
61
62
|
/* @__PURE__ */ jsx("h3", { className: "text-base font-bold text-foreground", children: t("Security & recovery") }),
|
|
62
63
|
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground mt-0.5", children: t("A guardian is a trusted backup that helps restore this wallet on a new device.") })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/account/guardian-recovery-section.tsx"],"sourcesContent":["\"use client\";\n\nimport { useCallback, useEffect, useState } from \"react\";\nimport { Shield, ShieldAlert, ChevronRight, Loader2 } from \"lucide-react\";\nimport {\n describeGuardianStatus,\n describeRecoveryAction,\n type EscapeInfo,\n type GuardianInfo,\n} from \"@medialane/sdk/starknet\";\nimport Link from \"../link.js\";\nimport { Button } from \"../button.js\";\nimport { Badge } from \"../badge.js\";\nimport { Alert, AlertDescription } from \"../alert.js\";\nimport { describeError } from \"../../utils/describe-error.js\";\nimport { AddGuardianDialog } from \"./add-guardian-dialog.js\";\nimport type { GuardianWallet, LoadSealedOwner } from \"./wallet-types.js\";\nimport { useT } from \"../../i18n/provider.js\";\nimport { useFormat } from \"../../i18n/use-format.js\";\n\nconst short = (a: string) => `${a.slice(0, 6)}…${a.slice(-4)}`;\n\nexport interface GuardianRecoverySectionProps {\n walletAddress: string;\n wallet: GuardianWallet;\n loadSealed: LoadSealedOwner;\n guardianRecoveryAvailable: boolean;\n recoverHref?: string;\n}\n\nexport function GuardianRecoverySection({\n walletAddress,\n wallet,\n loadSealed,\n guardianRecoveryAvailable,\n recoverHref = \"/recover\",\n}: GuardianRecoverySectionProps) {\n const intl = useFormat();\n const t = useT();\n const [guardians, setGuardians] = useState<GuardianInfo[] | null>(null);\n const [escape, setEscape] = useState<EscapeInfo | null>(null);\n const [addOpen, setAddOpen] = useState(false);\n const [cancelBusy, setCancelBusy] = useState(false);\n const [cancelError, setCancelError] = useState<string | null>(null);\n\n const refresh = useCallback(() => {\n wallet.getGuardians(walletAddress).then(setGuardians).catch(() => setGuardians([]));\n wallet.getEscape(walletAddress).then(setEscape).catch(() => setEscape(null));\n }, [walletAddress, wallet]);\n\n useEffect(() => { refresh(); }, [refresh]);\n\n const handleCancel = async () => {\n const sealed = loadSealed();\n if (!sealed) return;\n setCancelBusy(true);\n setCancelError(null);\n try {\n await wallet.cancelEscape(sealed);\n refresh();\n } catch (e) {\n setCancelError(describeError(e).message);\n } finally {\n setCancelBusy(false);\n }\n };\n\n const status = guardians ? describeGuardianStatus(guardians) : null;\n const recoveryAction = escape ? describeRecoveryAction(escape) : \"none\";\n const inProgress = escape?.escapeType === \"Owner\" && recoveryAction !== \"none\" ? escape : null;\n\n const sealed = loadSealed();\n\n return (\n <div className=\"panel p-5 sm:p-6 space-y-5\">\n <div className=\"flex items-start gap-3\">\n <
|
|
1
|
+
{"version":3,"sources":["../../../src/components/account/guardian-recovery-section.tsx"],"sourcesContent":["\"use client\";\n\nimport { useCallback, useEffect, useState } from \"react\";\nimport { Shield, ShieldAlert, ChevronRight, Loader2 } from \"lucide-react\";\nimport {\n describeGuardianStatus,\n describeRecoveryAction,\n type EscapeInfo,\n type GuardianInfo,\n} from \"@medialane/sdk/starknet\";\nimport Link from \"../link.js\";\nimport { Button } from \"../button.js\";\nimport { Badge } from \"../badge.js\";\nimport { Alert, AlertDescription } from \"../alert.js\";\nimport { describeError } from \"../../utils/describe-error.js\";\nimport { AddGuardianDialog } from \"./add-guardian-dialog.js\";\nimport type { GuardianWallet, LoadSealedOwner } from \"./wallet-types.js\";\nimport { useT } from \"../../i18n/provider.js\";\nimport { useFormat } from \"../../i18n/use-format.js\";\nimport { IconTile } from \"../icon-tile.js\";\n\nconst short = (a: string) => `${a.slice(0, 6)}…${a.slice(-4)}`;\n\nexport interface GuardianRecoverySectionProps {\n walletAddress: string;\n wallet: GuardianWallet;\n loadSealed: LoadSealedOwner;\n guardianRecoveryAvailable: boolean;\n recoverHref?: string;\n}\n\nexport function GuardianRecoverySection({\n walletAddress,\n wallet,\n loadSealed,\n guardianRecoveryAvailable,\n recoverHref = \"/recover\",\n}: GuardianRecoverySectionProps) {\n const intl = useFormat();\n const t = useT();\n const [guardians, setGuardians] = useState<GuardianInfo[] | null>(null);\n const [escape, setEscape] = useState<EscapeInfo | null>(null);\n const [addOpen, setAddOpen] = useState(false);\n const [cancelBusy, setCancelBusy] = useState(false);\n const [cancelError, setCancelError] = useState<string | null>(null);\n\n const refresh = useCallback(() => {\n wallet.getGuardians(walletAddress).then(setGuardians).catch(() => setGuardians([]));\n wallet.getEscape(walletAddress).then(setEscape).catch(() => setEscape(null));\n }, [walletAddress, wallet]);\n\n useEffect(() => { refresh(); }, [refresh]);\n\n const handleCancel = async () => {\n const sealed = loadSealed();\n if (!sealed) return;\n setCancelBusy(true);\n setCancelError(null);\n try {\n await wallet.cancelEscape(sealed);\n refresh();\n } catch (e) {\n setCancelError(describeError(e).message);\n } finally {\n setCancelBusy(false);\n }\n };\n\n const status = guardians ? describeGuardianStatus(guardians) : null;\n const recoveryAction = escape ? describeRecoveryAction(escape) : \"none\";\n const inProgress = escape?.escapeType === \"Owner\" && recoveryAction !== \"none\" ? escape : null;\n\n const sealed = loadSealed();\n\n return (\n <div className=\"panel p-5 sm:p-6 space-y-5\">\n <div className=\"flex items-start gap-3\">\n <IconTile>\n <Shield />\n </IconTile>\n <div>\n <h3 className=\"text-base font-bold text-foreground\">{t(\"Security & recovery\")}</h3>\n <p className=\"text-sm text-muted-foreground mt-0.5\">\n {t(\"A guardian is a trusted backup that helps restore this wallet on a new device.\")}\n </p>\n </div>\n </div>\n\n <div className=\"space-y-3\">\n {inProgress && (\n <Alert variant=\"destructive\">\n <ShieldAlert className=\"h-4 w-4\" />\n <AlertDescription>{t.rich(\"A guardian has started replacing this wallet's owner key. {value} The replacement can be stopped with the button below.{value2}{button}\", { value: inProgress.status === \"Ready\"\n ? \"It can complete at any time.\"\n : `It can complete on ${intl.dateTime(new Date(inProgress.readyAt * 1000))}.`, value2: cancelError && <p className=\"mt-1 text-destructive\">{cancelError}</p>, button: <Button\n onClick={handleCancel}\n disabled={cancelBusy}\n variant=\"destructive\"\n size=\"sm\"\n className=\"mt-2 w-full\"\n >\n {cancelBusy ? <Loader2 className=\"mr-1.5 h-3.5 w-3.5 animate-spin\" /> : null}\n {t(\"Cancel recovery\")}\n </Button> })}\n </AlertDescription>\n </Alert>\n )}\n\n <div className=\"panel flex items-center justify-between gap-3 p-4 flex-wrap\">\n <div>\n <p className=\"text-sm font-medium text-foreground\">{t(\"Guardian recovery\")}</p>\n {status === null ? (\n <p className=\"text-xs text-muted-foreground mt-0.5\">{t(\"Checking…\")}</p>\n ) : status.kind === \"none\" ? (\n <p className=\"text-xs text-muted-foreground mt-0.5\">\n {guardianRecoveryAvailable ? t(\"Not set up — add one from another device you trust.\") : t(\"Not available yet.\")}\n </p>\n ) : (\n <p className=\"text-xs text-muted-foreground mt-0.5\">{t(\"Active: {type} guardian {short}\", { type: status.guardian.type, short: short(status.guardian.storedValue) })}\n </p>\n )}\n </div>\n {status?.kind === \"none\" && sealed && (\n <Button onClick={() => setAddOpen(true)} variant=\"soft\" size=\"sm\" disabled={!guardianRecoveryAvailable}>\n {t(\"Add guardian\")}\n </Button>\n )}\n {status?.kind === \"active\" && (\n <Badge variant=\"soft\" className=\"border-brand-blue/40 text-brand-blue bg-brand-blue/10 text-2xs\">\n {t(\"Configured\")}\n </Badge>\n )}\n </div>\n\n <Link\n href={recoverHref}\n className=\"panel flex items-center justify-between gap-3 p-4 transition-colors hover:bg-foreground/[0.03]\"\n >\n <div>\n <p className=\"text-sm font-medium text-foreground\">{t(\"Recover a wallet\")}</p>\n <p className=\"text-xs text-muted-foreground mt-0.5\">\n {t(\"Lost this device, or acting as someone's guardian?\")}\n </p>\n </div>\n <ChevronRight className=\"h-4 w-4 text-muted-foreground shrink-0\" />\n </Link>\n </div>\n\n {sealed && guardianRecoveryAvailable &&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
|
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;
|
|
@@ -36,6 +36,7 @@ var import_address = require("../utils/address.js");
|
|
|
36
36
|
var import_cn = require("../utils/cn.js");
|
|
37
37
|
var import_provider = require("../i18n/provider.js");
|
|
38
38
|
var import_use_format = require("../i18n/use-format.js");
|
|
39
|
+
var import_icon_tile = require("./icon-tile.js");
|
|
39
40
|
const GRID = "grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-3 sm:gap-4";
|
|
40
41
|
const CHIP = "shrink-0 rounded-full px-3.5 py-1.5 text-sm font-medium transition-colors bg-background/40";
|
|
41
42
|
function AccountsPage() {
|
|
@@ -121,7 +122,7 @@ function AccountsPage() {
|
|
|
121
122
|
) }, account.address)) }),
|
|
122
123
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_load_more_sentinel.LoadMoreSentinel, { hasMore, isLoading: isLoadingMore, onLoadMore: loadMore })
|
|
123
124
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-4 py-24 text-center", children: [
|
|
124
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("
|
|
125
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icon_tile.IconTile, { size: "lg", className: "mx-auto", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Users, {}) }),
|
|
125
126
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-lg font-semibold", children: query ? `No accounts found for "${query}"` : t("No accounts found") })
|
|
126
127
|
] })
|
|
127
128
|
] })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/accounts-page.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useState } from \"react\";\nimport { profileHref } from \"@medialane/sdk\";\nimport { Search, Users, X } from \"lucide-react\";\nimport { AssetCard, AssetCardSkeleton } from \"./asset-card.js\";\nimport { IP_TYPE_CONFIG } from \"./ip-type-badge.js\";\nimport { Input } from \"./input.js\";\nimport { LoadMoreSentinel } from \"./load-more-sentinel.js\";\nimport { FadeIn, Stagger, StaggerItem } from \"./motion-primitives.js\";\nimport { useAccounts } from \"../utils/use-accounts.js\";\nimport { shortenAddress } from \"../utils/address.js\";\nimport { cn } from \"../utils/cn.js\";\nimport { useT } from \"../i18n/provider.js\";\nimport { useFormat } from \"../i18n/use-format.js\";\n\nconst GRID = \"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-3 sm:gap-4\";\nconst CHIP = \"shrink-0 rounded-full px-3.5 py-1.5 text-sm font-medium transition-colors bg-background/40\";\n\nexport function AccountsPage() {\n const intl = useFormat();\n const t = useT();\n const [search, setSearch] = useState(\"\");\n const [query, setQuery] = useState(\"\");\n const [ipType, setIpType] = useState(\"\");\n const { accounts, total, isLoading, isLoadingMore, hasMore, loadMore } = useAccounts(query, ipType);\n\n useEffect(() => {\n const timer = setTimeout(() => setQuery(search.trim()), 300);\n return () => clearTimeout(timer);\n }, [search]);\n\n return (\n <div className=\"pb-16\">\n <section className=\"border-b border-border/50 px-4 py-14 sm:px-6 sm:py-20 lg:px-8\">\n <FadeIn>\n <span className=\"pill mb-5 inline-flex\">\n <Users className=\"h-3 w-3\" />\n {t(\"Accounts directory\")}\n </span>\n </FadeIn>\n <FadeIn delay={0.08}>\n <h1 className=\"mb-3 text-3xl font-semibold leading-tight sm:text-4xl lg:text-5xl\">\n {t(\"Onchain\")} <span className=\"text-primary\">{t(\"accounts\")}</span>\n </h1>\n </FadeIn>\n <FadeIn delay={0.16}>\n <p className=\"mb-6 max-w-lg text-base leading-relaxed text-muted-foreground\">\n {t(\"Every address with collections or assets onchain.\")}\n </p>\n </FadeIn>\n <FadeIn delay={0.22}>\n <div className=\"flex flex-col items-start gap-4 sm:flex-row sm:items-center\">\n {!isLoading && total > 0 && (\n <div className=\"flex items-center gap-2 rounded-full px-4 py-1.5 text-sm bg-background/40\">\n <span className=\"font-bold tabular-nums\">{intl.number(total)}</span>\n <span className=\"text-muted-foreground\">{t(\"account\")}{total === 1 ? \"\" : \"s\"}</span>\n </div>\n )}\n <div className=\"relative w-full sm:max-w-xs\">\n <Search className=\"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground\" />\n <Input\n className=\"pl-9 pr-9\"\n placeholder={t(\"Search by address…\")}\n value={search}\n onChange={(e) => setSearch(e.target.value)}\n />\n {search && (\n <button\n type=\"button\"\n aria-label={t(\"Clear search\")}\n onClick={() => setSearch(\"\")}\n className=\"absolute right-2.5 top-1/2 flex h-5 w-5 -translate-y-1/2 items-center justify-center rounded-full bg-muted transition-colors hover:bg-muted/80\"\n >\n <X className=\"h-3 w-3 text-muted-foreground\" />\n </button>\n )}\n </div>\n </div>\n </FadeIn>\n </section>\n\n <section className=\"space-y-6 px-4 py-8 sm:px-6 lg:px-8\">\n <div className=\"-mx-4 flex gap-2 overflow-x-auto px-4 pb-1 sm:mx-0 sm:px-0\" role=\"group\" aria-label={t(\"Type of work\")}>\n {[{ slug: \"\", label: t(\"All\") }, ...IP_TYPE_CONFIG].map(({ slug, label }) => (\n <button\n key={slug || \"all\"}\n type=\"button\"\n aria-pressed={ipType === slug}\n onClick={() => setIpType(slug)}\n className={cn(\n CHIP,\n ipType === slug\n ? \"border-foreground bg-foreground text-background\"\n : \"border-border bg-card text-muted-foreground hover:text-foreground\",\n )}\n >\n {t(label)}\n </button>\n ))}\n </div>\n\n {isLoading ? (\n <div className={GRID}>\n {Array.from({ length: 10 }).map((_, i) => (\n <AssetCardSkeleton key={i} />\n ))}\n </div>\n ) : accounts.length > 0 ? (\n <>\n <Stagger className={GRID}>\n {accounts.map((account) => (\n <StaggerItem key={account.address}>\n <AssetCard\n href={profileHref({ address: account.address })}\n name={shortenAddress(account.address, 6)}\n image={account.image}\n ipType={account.ipType}\n fallbackId={account.address.slice(2, 8)}\n />\n </StaggerItem>\n ))}\n </Stagger>\n <LoadMoreSentinel hasMore={hasMore} isLoading={isLoadingMore} onLoadMore={loadMore} />\n </>\n ) : (\n <div className=\"space-y-4 py-24 text-center\">\n <
|
|
1
|
+
{"version":3,"sources":["../../src/components/accounts-page.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useState } from \"react\";\nimport { profileHref } from \"@medialane/sdk\";\nimport { Search, Users, X } from \"lucide-react\";\nimport { AssetCard, AssetCardSkeleton } from \"./asset-card.js\";\nimport { IP_TYPE_CONFIG } from \"./ip-type-badge.js\";\nimport { Input } from \"./input.js\";\nimport { LoadMoreSentinel } from \"./load-more-sentinel.js\";\nimport { FadeIn, Stagger, StaggerItem } from \"./motion-primitives.js\";\nimport { useAccounts } from \"../utils/use-accounts.js\";\nimport { shortenAddress } from \"../utils/address.js\";\nimport { cn } from \"../utils/cn.js\";\nimport { useT } from \"../i18n/provider.js\";\nimport { useFormat } from \"../i18n/use-format.js\";\nimport { IconTile } from \"./icon-tile.js\";\n\nconst GRID = \"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-3 sm:gap-4\";\nconst CHIP = \"shrink-0 rounded-full px-3.5 py-1.5 text-sm font-medium transition-colors bg-background/40\";\n\nexport function AccountsPage() {\n const intl = useFormat();\n const t = useT();\n const [search, setSearch] = useState(\"\");\n const [query, setQuery] = useState(\"\");\n const [ipType, setIpType] = useState(\"\");\n const { accounts, total, isLoading, isLoadingMore, hasMore, loadMore } = useAccounts(query, ipType);\n\n useEffect(() => {\n const timer = setTimeout(() => setQuery(search.trim()), 300);\n return () => clearTimeout(timer);\n }, [search]);\n\n return (\n <div className=\"pb-16\">\n <section className=\"border-b border-border/50 px-4 py-14 sm:px-6 sm:py-20 lg:px-8\">\n <FadeIn>\n <span className=\"pill mb-5 inline-flex\">\n <Users className=\"h-3 w-3\" />\n {t(\"Accounts directory\")}\n </span>\n </FadeIn>\n <FadeIn delay={0.08}>\n <h1 className=\"mb-3 text-3xl font-semibold leading-tight sm:text-4xl lg:text-5xl\">\n {t(\"Onchain\")} <span className=\"text-primary\">{t(\"accounts\")}</span>\n </h1>\n </FadeIn>\n <FadeIn delay={0.16}>\n <p className=\"mb-6 max-w-lg text-base leading-relaxed text-muted-foreground\">\n {t(\"Every address with collections or assets onchain.\")}\n </p>\n </FadeIn>\n <FadeIn delay={0.22}>\n <div className=\"flex flex-col items-start gap-4 sm:flex-row sm:items-center\">\n {!isLoading && total > 0 && (\n <div className=\"flex items-center gap-2 rounded-full px-4 py-1.5 text-sm bg-background/40\">\n <span className=\"font-bold tabular-nums\">{intl.number(total)}</span>\n <span className=\"text-muted-foreground\">{t(\"account\")}{total === 1 ? \"\" : \"s\"}</span>\n </div>\n )}\n <div className=\"relative w-full sm:max-w-xs\">\n <Search className=\"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground\" />\n <Input\n className=\"pl-9 pr-9\"\n placeholder={t(\"Search by address…\")}\n value={search}\n onChange={(e) => setSearch(e.target.value)}\n />\n {search && (\n <button\n type=\"button\"\n aria-label={t(\"Clear search\")}\n onClick={() => setSearch(\"\")}\n className=\"absolute right-2.5 top-1/2 flex h-5 w-5 -translate-y-1/2 items-center justify-center rounded-full bg-muted transition-colors hover:bg-muted/80\"\n >\n <X className=\"h-3 w-3 text-muted-foreground\" />\n </button>\n )}\n </div>\n </div>\n </FadeIn>\n </section>\n\n <section className=\"space-y-6 px-4 py-8 sm:px-6 lg:px-8\">\n <div className=\"-mx-4 flex gap-2 overflow-x-auto px-4 pb-1 sm:mx-0 sm:px-0\" role=\"group\" aria-label={t(\"Type of work\")}>\n {[{ slug: \"\", label: t(\"All\") }, ...IP_TYPE_CONFIG].map(({ slug, label }) => (\n <button\n key={slug || \"all\"}\n type=\"button\"\n aria-pressed={ipType === slug}\n onClick={() => setIpType(slug)}\n className={cn(\n CHIP,\n ipType === slug\n ? \"border-foreground bg-foreground text-background\"\n : \"border-border bg-card text-muted-foreground hover:text-foreground\",\n )}\n >\n {t(label)}\n </button>\n ))}\n </div>\n\n {isLoading ? (\n <div className={GRID}>\n {Array.from({ length: 10 }).map((_, i) => (\n <AssetCardSkeleton key={i} />\n ))}\n </div>\n ) : accounts.length > 0 ? (\n <>\n <Stagger className={GRID}>\n {accounts.map((account) => (\n <StaggerItem key={account.address}>\n <AssetCard\n href={profileHref({ address: account.address })}\n name={shortenAddress(account.address, 6)}\n image={account.image}\n ipType={account.ipType}\n fallbackId={account.address.slice(2, 8)}\n />\n </StaggerItem>\n ))}\n </Stagger>\n <LoadMoreSentinel hasMore={hasMore} isLoading={isLoadingMore} onLoadMore={loadMore} />\n </>\n ) : (\n <div className=\"space-y-4 py-24 text-center\">\n <IconTile size=\"lg\" className=\"mx-auto\">\n <Users />\n </IconTile>\n <p className=\"text-lg font-semibold\">{query ? `No accounts found for \"${query}\"` : t(\"No accounts found\")}</p>\n </div>\n )}\n </section>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAqCU;AAnCV,mBAAoC;AACpC,iBAA4B;AAC5B,0BAAiC;AACjC,wBAA6C;AAC7C,2BAA+B;AAC/B,mBAAsB;AACtB,gCAAiC;AACj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mBAAS,IAAI,CAAC,YACb,4CAAC,wCACC;AAAA,UAAC;AAAA;AAAA,YACC,UAAM,wBAAY,EAAE,SAAS,QAAQ,QAAQ,CAAC;AAAA,YAC9C,UAAM,+BAAe,QAAQ,SAAS,CAAC;AAAA,YACvC,OAAO,QAAQ;AAAA,YACf,QAAQ,QAAQ;AAAA,YAChB,YAAY,QAAQ,QAAQ,MAAM,GAAG,CAAC;AAAA;AAAA,QACxC,KAPgB,QAAQ,OAQ1B,CACD,GACH;AAAA,QACA,4CAAC,8CAAiB,SAAkB,WAAW,eAAe,YAAY,UAAU;AAAA,SACtF,IAEA,6CAAC,SAAI,WAAU,+BACb;AAAA,oDAAC,6BAAS,MAAK,MAAK,WAAU,WAC5B,sDAAC,6BAAM,GACT;AAAA,QACA,4CAAC,OAAE,WAAU,yBAAyB,kBAAQ,0BAA0B,KAAK,MAAM,EAAE,mBAAmB,GAAE;AAAA,SAC5G;AAAA,OAEJ;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -13,6 +13,7 @@ import { shortenAddress } from "../utils/address.js";
|
|
|
13
13
|
import { cn } from "../utils/cn.js";
|
|
14
14
|
import { useT } from "../i18n/provider.js";
|
|
15
15
|
import { useFormat } from "../i18n/use-format.js";
|
|
16
|
+
import { IconTile } from "./icon-tile.js";
|
|
16
17
|
const GRID = "grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-3 sm:gap-4";
|
|
17
18
|
const CHIP = "shrink-0 rounded-full px-3.5 py-1.5 text-sm font-medium transition-colors bg-background/40";
|
|
18
19
|
function AccountsPage() {
|
|
@@ -98,7 +99,7 @@ function AccountsPage() {
|
|
|
98
99
|
) }, account.address)) }),
|
|
99
100
|
/* @__PURE__ */ jsx(LoadMoreSentinel, { hasMore, isLoading: isLoadingMore, onLoadMore: loadMore })
|
|
100
101
|
] }) : /* @__PURE__ */ jsxs("div", { className: "space-y-4 py-24 text-center", children: [
|
|
101
|
-
/* @__PURE__ */ jsx("
|
|
102
|
+
/* @__PURE__ */ jsx(IconTile, { size: "lg", className: "mx-auto", children: /* @__PURE__ */ jsx(Users, {}) }),
|
|
102
103
|
/* @__PURE__ */ jsx("p", { className: "text-lg font-semibold", children: query ? `No accounts found for "${query}"` : t("No accounts found") })
|
|
103
104
|
] })
|
|
104
105
|
] })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/accounts-page.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useState } from \"react\";\nimport { profileHref } from \"@medialane/sdk\";\nimport { Search, Users, X } from \"lucide-react\";\nimport { AssetCard, AssetCardSkeleton } from \"./asset-card.js\";\nimport { IP_TYPE_CONFIG } from \"./ip-type-badge.js\";\nimport { Input } from \"./input.js\";\nimport { LoadMoreSentinel } from \"./load-more-sentinel.js\";\nimport { FadeIn, Stagger, StaggerItem } from \"./motion-primitives.js\";\nimport { useAccounts } from \"../utils/use-accounts.js\";\nimport { shortenAddress } from \"../utils/address.js\";\nimport { cn } from \"../utils/cn.js\";\nimport { useT } from \"../i18n/provider.js\";\nimport { useFormat } from \"../i18n/use-format.js\";\n\nconst GRID = \"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-3 sm:gap-4\";\nconst CHIP = \"shrink-0 rounded-full px-3.5 py-1.5 text-sm font-medium transition-colors bg-background/40\";\n\nexport function AccountsPage() {\n const intl = useFormat();\n const t = useT();\n const [search, setSearch] = useState(\"\");\n const [query, setQuery] = useState(\"\");\n const [ipType, setIpType] = useState(\"\");\n const { accounts, total, isLoading, isLoadingMore, hasMore, loadMore } = useAccounts(query, ipType);\n\n useEffect(() => {\n const timer = setTimeout(() => setQuery(search.trim()), 300);\n return () => clearTimeout(timer);\n }, [search]);\n\n return (\n <div className=\"pb-16\">\n <section className=\"border-b border-border/50 px-4 py-14 sm:px-6 sm:py-20 lg:px-8\">\n <FadeIn>\n <span className=\"pill mb-5 inline-flex\">\n <Users className=\"h-3 w-3\" />\n {t(\"Accounts directory\")}\n </span>\n </FadeIn>\n <FadeIn delay={0.08}>\n <h1 className=\"mb-3 text-3xl font-semibold leading-tight sm:text-4xl lg:text-5xl\">\n {t(\"Onchain\")} <span className=\"text-primary\">{t(\"accounts\")}</span>\n </h1>\n </FadeIn>\n <FadeIn delay={0.16}>\n <p className=\"mb-6 max-w-lg text-base leading-relaxed text-muted-foreground\">\n {t(\"Every address with collections or assets onchain.\")}\n </p>\n </FadeIn>\n <FadeIn delay={0.22}>\n <div className=\"flex flex-col items-start gap-4 sm:flex-row sm:items-center\">\n {!isLoading && total > 0 && (\n <div className=\"flex items-center gap-2 rounded-full px-4 py-1.5 text-sm bg-background/40\">\n <span className=\"font-bold tabular-nums\">{intl.number(total)}</span>\n <span className=\"text-muted-foreground\">{t(\"account\")}{total === 1 ? \"\" : \"s\"}</span>\n </div>\n )}\n <div className=\"relative w-full sm:max-w-xs\">\n <Search className=\"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground\" />\n <Input\n className=\"pl-9 pr-9\"\n placeholder={t(\"Search by address…\")}\n value={search}\n onChange={(e) => setSearch(e.target.value)}\n />\n {search && (\n <button\n type=\"button\"\n aria-label={t(\"Clear search\")}\n onClick={() => setSearch(\"\")}\n className=\"absolute right-2.5 top-1/2 flex h-5 w-5 -translate-y-1/2 items-center justify-center rounded-full bg-muted transition-colors hover:bg-muted/80\"\n >\n <X className=\"h-3 w-3 text-muted-foreground\" />\n </button>\n )}\n </div>\n </div>\n </FadeIn>\n </section>\n\n <section className=\"space-y-6 px-4 py-8 sm:px-6 lg:px-8\">\n <div className=\"-mx-4 flex gap-2 overflow-x-auto px-4 pb-1 sm:mx-0 sm:px-0\" role=\"group\" aria-label={t(\"Type of work\")}>\n {[{ slug: \"\", label: t(\"All\") }, ...IP_TYPE_CONFIG].map(({ slug, label }) => (\n <button\n key={slug || \"all\"}\n type=\"button\"\n aria-pressed={ipType === slug}\n onClick={() => setIpType(slug)}\n className={cn(\n CHIP,\n ipType === slug\n ? \"border-foreground bg-foreground text-background\"\n : \"border-border bg-card text-muted-foreground hover:text-foreground\",\n )}\n >\n {t(label)}\n </button>\n ))}\n </div>\n\n {isLoading ? (\n <div className={GRID}>\n {Array.from({ length: 10 }).map((_, i) => (\n <AssetCardSkeleton key={i} />\n ))}\n </div>\n ) : accounts.length > 0 ? (\n <>\n <Stagger className={GRID}>\n {accounts.map((account) => (\n <StaggerItem key={account.address}>\n <AssetCard\n href={profileHref({ address: account.address })}\n name={shortenAddress(account.address, 6)}\n image={account.image}\n ipType={account.ipType}\n fallbackId={account.address.slice(2, 8)}\n />\n </StaggerItem>\n ))}\n </Stagger>\n <LoadMoreSentinel hasMore={hasMore} isLoading={isLoadingMore} onLoadMore={loadMore} />\n </>\n ) : (\n <div className=\"space-y-4 py-24 text-center\">\n <
|
|
1
|
+
{"version":3,"sources":["../../src/components/accounts-page.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useState } from \"react\";\nimport { profileHref } from \"@medialane/sdk\";\nimport { Search, Users, X } from \"lucide-react\";\nimport { AssetCard, AssetCardSkeleton } from \"./asset-card.js\";\nimport { IP_TYPE_CONFIG } from \"./ip-type-badge.js\";\nimport { Input } from \"./input.js\";\nimport { LoadMoreSentinel } from \"./load-more-sentinel.js\";\nimport { FadeIn, Stagger, StaggerItem } from \"./motion-primitives.js\";\nimport { useAccounts } from \"../utils/use-accounts.js\";\nimport { shortenAddress } from \"../utils/address.js\";\nimport { cn } from \"../utils/cn.js\";\nimport { useT } from \"../i18n/provider.js\";\nimport { useFormat } from \"../i18n/use-format.js\";\nimport { IconTile } from \"./icon-tile.js\";\n\nconst GRID = \"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-3 sm:gap-4\";\nconst CHIP = \"shrink-0 rounded-full px-3.5 py-1.5 text-sm font-medium transition-colors bg-background/40\";\n\nexport function AccountsPage() {\n const intl = useFormat();\n const t = useT();\n const [search, setSearch] = useState(\"\");\n const [query, setQuery] = useState(\"\");\n const [ipType, setIpType] = useState(\"\");\n const { accounts, total, isLoading, isLoadingMore, hasMore, loadMore } = useAccounts(query, ipType);\n\n useEffect(() => {\n const timer = setTimeout(() => setQuery(search.trim()), 300);\n return () => clearTimeout(timer);\n }, [search]);\n\n return (\n <div className=\"pb-16\">\n <section className=\"border-b border-border/50 px-4 py-14 sm:px-6 sm:py-20 lg:px-8\">\n <FadeIn>\n <span className=\"pill mb-5 inline-flex\">\n <Users className=\"h-3 w-3\" />\n {t(\"Accounts directory\")}\n </span>\n </FadeIn>\n <FadeIn delay={0.08}>\n <h1 className=\"mb-3 text-3xl font-semibold leading-tight sm:text-4xl lg:text-5xl\">\n {t(\"Onchain\")} <span className=\"text-primary\">{t(\"accounts\")}</span>\n </h1>\n </FadeIn>\n <FadeIn delay={0.16}>\n <p className=\"mb-6 max-w-lg text-base leading-relaxed text-muted-foreground\">\n {t(\"Every address with collections or assets onchain.\")}\n </p>\n </FadeIn>\n <FadeIn delay={0.22}>\n <div className=\"flex flex-col items-start gap-4 sm:flex-row sm:items-center\">\n {!isLoading && total > 0 && (\n <div className=\"flex items-center gap-2 rounded-full px-4 py-1.5 text-sm bg-background/40\">\n <span className=\"font-bold tabular-nums\">{intl.number(total)}</span>\n <span className=\"text-muted-foreground\">{t(\"account\")}{total === 1 ? \"\" : \"s\"}</span>\n </div>\n )}\n <div className=\"relative w-full sm:max-w-xs\">\n <Search className=\"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground\" />\n <Input\n className=\"pl-9 pr-9\"\n placeholder={t(\"Search by address…\")}\n value={search}\n onChange={(e) => setSearch(e.target.value)}\n />\n {search && (\n <button\n type=\"button\"\n aria-label={t(\"Clear search\")}\n onClick={() => setSearch(\"\")}\n className=\"absolute right-2.5 top-1/2 flex h-5 w-5 -translate-y-1/2 items-center justify-center rounded-full bg-muted transition-colors hover:bg-muted/80\"\n >\n <X className=\"h-3 w-3 text-muted-foreground\" />\n </button>\n )}\n </div>\n </div>\n </FadeIn>\n </section>\n\n <section className=\"space-y-6 px-4 py-8 sm:px-6 lg:px-8\">\n <div className=\"-mx-4 flex gap-2 overflow-x-auto px-4 pb-1 sm:mx-0 sm:px-0\" role=\"group\" aria-label={t(\"Type of work\")}>\n {[{ slug: \"\", label: t(\"All\") }, ...IP_TYPE_CONFIG].map(({ slug, label }) => (\n <button\n key={slug || \"all\"}\n type=\"button\"\n aria-pressed={ipType === slug}\n onClick={() => setIpType(slug)}\n className={cn(\n CHIP,\n ipType === slug\n ? \"border-foreground bg-foreground text-background\"\n : \"border-border bg-card text-muted-foreground hover:text-foreground\",\n )}\n >\n {t(label)}\n </button>\n ))}\n </div>\n\n {isLoading ? (\n <div className={GRID}>\n {Array.from({ length: 10 }).map((_, i) => (\n <AssetCardSkeleton key={i} />\n ))}\n </div>\n ) : accounts.length > 0 ? (\n <>\n <Stagger className={GRID}>\n {accounts.map((account) => (\n <StaggerItem key={account.address}>\n <AssetCard\n href={profileHref({ address: account.address })}\n name={shortenAddress(account.address, 6)}\n image={account.image}\n ipType={account.ipType}\n fallbackId={account.address.slice(2, 8)}\n />\n </StaggerItem>\n ))}\n </Stagger>\n <LoadMoreSentinel hasMore={hasMore} isLoading={isLoadingMore} onLoadMore={loadMore} />\n </>\n ) : (\n <div className=\"space-y-4 py-24 text-center\">\n <IconTile size=\"lg\" className=\"mx-auto\">\n <Users />\n </IconTile>\n <p className=\"text-lg font-semibold\">{query ? `No accounts found for \"${query}\"` : t(\"No accounts found\")}</p>\n </div>\n )}\n </section>\n </div>\n );\n}\n"],"mappings":";AAqCU,SAyEA,UAxEE,KADF;AAnCV,SAAS,WAAW,gBAAgB;AACpC,SAAS,mBAAmB;AAC5B,SAAS,QAAQ,OAAO,SAAS;AACjC,SAAS,WAAW,yBAAyB;AAC7C,SAAS,sBAAsB;AAC/B,SAAS,aAAa;AACtB,SAAS,wBAAwB;AACjC,SAAS,QAAQ,SAAS,mBAAmB;AAC7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AS,IAAI,CAAC,YACb,oBAAC,eACC;AAAA,UAAC;AAAA;AAAA,YACC,MAAM,YAAY,EAAE,SAAS,QAAQ,QAAQ,CAAC;AAAA,YAC9C,MAAM,eAAe,QAAQ,SAAS,CAAC;AAAA,YACvC,OAAO,QAAQ;AAAA,YACf,QAAQ,QAAQ;AAAA,YAChB,YAAY,QAAQ,QAAQ,MAAM,GAAG,CAAC;AAAA;AAAA,QACxC,KAPgB,QAAQ,OAQ1B,CACD,GACH;AAAA,QACA,oBAAC,oBAAiB,SAAkB,WAAW,eAAe,YAAY,UAAU;AAAA,SACtF,IAEA,qBAAC,SAAI,WAAU,+BACb;AAAA,4BAAC,YAAS,MAAK,MAAK,WAAU,WAC5B,8BAAC,SAAM,GACT;AAAA,QACA,oBAAC,OAAE,WAAU,yBAAyB,kBAAQ,0BAA0B,KAAK,MAAM,EAAE,mBAAmB,GAAE;AAAA,SAC5G;AAAA,OAEJ;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -33,6 +33,7 @@ var import_cn = require("../utils/cn.js");
|
|
|
33
33
|
var import_empty_messages = require("../utils/empty-messages.js");
|
|
34
34
|
var import_provider = require("../i18n/provider.js");
|
|
35
35
|
var import_use_format = require("../i18n/use-format.js");
|
|
36
|
+
var import_icon_tile = require("./icon-tile.js");
|
|
36
37
|
const PAGE_SIZE = 30;
|
|
37
38
|
function ActivitiesFeed() {
|
|
38
39
|
const intl = (0, import_use_format.useFormat)();
|
|
@@ -114,7 +115,7 @@ function ActivitiesFeed() {
|
|
|
114
115
|
);
|
|
115
116
|
}) }),
|
|
116
117
|
isInitialLoading ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_activity_row.ActivityListSkeleton, {}) : allActivities.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "py-20 flex flex-col items-center gap-3 text-center", children: [
|
|
117
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
118
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icon_tile.IconTile, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Zap, {}) }),
|
|
118
119
|
typeFilter ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-muted-foreground", children: `No ${typeFilter} events yet.` }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
|
|
119
120
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "font-medium", children: t(import_empty_messages.emptyMessages.activity.title) }),
|
|
120
121
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm text-muted-foreground", children: t(import_empty_messages.emptyMessages.activity.description) })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/activities-feed.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState, useEffect, useRef } from \"react\";\nimport { useActivities } from \"../utils/use-activities.js\";\nimport type { ApiActivitiesQuery, ApiActivity } from \"@medialane/sdk\";\nimport { LoadMoreSentinel } from \"./load-more-sentinel.js\";\nimport { Zap } from \"lucide-react\";\nimport { ACTIVITY_TYPE_CONFIG, TYPE_FILTERS } from \"../data/activity.js\";\nimport { ActivityListSkeleton, ActivityRow } from \"./activity-row.js\";\nimport { cn } from \"../utils/cn.js\";\nimport { emptyMessages } from \"../utils/empty-messages.js\";\nimport { useT } from \"../i18n/provider.js\";\nimport { useFormat } from \"../i18n/use-format.js\";\n\nconst PAGE_SIZE = 30;\n\nexport function ActivitiesFeed() {\n const intl = useFormat();\n const t = useT();\n const [page, setPage] = useState(1);\n const [typeFilter, setTypeFilter] = useState(\"\");\n const [allActivities, setAllActivities] = useState<ApiActivity[]>([]);\n\n const prevType = useRef(typeFilter);\n useEffect(() => {\n if (prevType.current !== typeFilter) {\n prevType.current = typeFilter;\n setPage(1);\n setAllActivities([]);\n }\n }, [typeFilter]);\n\n const { activities, meta, isLoading } = useActivities({\n limit: PAGE_SIZE,\n page,\n type: (typeFilter as ApiActivitiesQuery[\"type\"]) || undefined,\n });\n\n useEffect(() => {\n if (isLoading) return;\n if (page === 1) {\n setAllActivities(activities);\n } else {\n setAllActivities((prev) => {\n const existing = new Set(\n prev.map((a) => `${a.txHash}-${a.type}-${a.nftTokenId ?? \"\"}`)\n );\n const newItems = activities.filter(\n (a) => !existing.has(`${a.txHash}-${a.type}-${a.nftTokenId ?? \"\"}`)\n );\n return newItems.length > 0 ? [...prev, ...newItems] : prev;\n });\n }\n }, [activities, isLoading, page]);\n\n const isInitialLoading = isLoading && allActivities.length === 0;\n const isLoadingMore = isLoading && allActivities.length > 0;\n const hasMore = meta?.total != null ? allActivities.length < meta.total : false;\n const total = meta?.total ?? null;\n\n return (\n <div className=\"space-y-5\">\n {total != null && (\n <div className=\"flex items-center gap-2 text-sm text-muted-foreground\">\n <span className=\"flex items-center gap-1.5\">\n <span className=\"h-1.5 w-1.5 rounded-full bg-brand-blue animate-pulse\" />\n <span className=\"font-semibold text-foreground tabular-nums\">\n {intl.number(total)}\n </span>\n {typeFilter ? `${typeFilter} events` : t(\"total events\")}\n </span>\n {typeFilter && allActivities.length > 0 && (\n <>\n <span className=\"text-muted-foreground/40\">·</span>\n <span>{t(\"{count} loaded\", { count: intl.number(allActivities.length) })}</span>\n </>\n )}\n </div>\n )}\n\n <div className=\"flex flex-wrap gap-2\">\n {TYPE_FILTERS.map((f) => {\n const typeConfig = f.value ? ACTIVITY_TYPE_CONFIG[f.value] : null;\n const Icon = typeConfig?.icon;\n const isActive = typeFilter === f.value;\n return (\n <button\n key={f.value}\n onClick={() => setTypeFilter(f.value)}\n className={cn(\n \"flex items-center gap-1.5 text-xs px-3 py-1.5 rounded-full transition-all font-medium\",\n isActive\n ? \"bg-primary/15 text-primary shadow-sm\"\n : \"text-muted-foreground hover:text-foreground hover:bg-muted/50 bg-background/40\"\n )}\n >\n {Icon && (\n <Icon\n className={cn(\n \"h-3 w-3\",\n isActive ? typeConfig?.colorClass : \"\"\n )}\n />\n )}\n {t(f.label)}\n </button>\n );\n })}\n </div>\n\n {isInitialLoading ? (\n <ActivityListSkeleton />\n ) : allActivities.length === 0 ? (\n <div className=\"py-20 flex flex-col items-center gap-3 text-center\">\n <
|
|
1
|
+
{"version":3,"sources":["../../src/components/activities-feed.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState, useEffect, useRef } from \"react\";\nimport { useActivities } from \"../utils/use-activities.js\";\nimport type { ApiActivitiesQuery, ApiActivity } from \"@medialane/sdk\";\nimport { LoadMoreSentinel } from \"./load-more-sentinel.js\";\nimport { Zap } from \"lucide-react\";\nimport { ACTIVITY_TYPE_CONFIG, TYPE_FILTERS } from \"../data/activity.js\";\nimport { ActivityListSkeleton, ActivityRow } from \"./activity-row.js\";\nimport { cn } from \"../utils/cn.js\";\nimport { emptyMessages } from \"../utils/empty-messages.js\";\nimport { useT } from \"../i18n/provider.js\";\nimport { useFormat } from \"../i18n/use-format.js\";\nimport { IconTile } from \"./icon-tile.js\";\n\nconst PAGE_SIZE = 30;\n\nexport function ActivitiesFeed() {\n const intl = useFormat();\n const t = useT();\n const [page, setPage] = useState(1);\n const [typeFilter, setTypeFilter] = useState(\"\");\n const [allActivities, setAllActivities] = useState<ApiActivity[]>([]);\n\n const prevType = useRef(typeFilter);\n useEffect(() => {\n if (prevType.current !== typeFilter) {\n prevType.current = typeFilter;\n setPage(1);\n setAllActivities([]);\n }\n }, [typeFilter]);\n\n const { activities, meta, isLoading } = useActivities({\n limit: PAGE_SIZE,\n page,\n type: (typeFilter as ApiActivitiesQuery[\"type\"]) || undefined,\n });\n\n useEffect(() => {\n if (isLoading) return;\n if (page === 1) {\n setAllActivities(activities);\n } else {\n setAllActivities((prev) => {\n const existing = new Set(\n prev.map((a) => `${a.txHash}-${a.type}-${a.nftTokenId ?? \"\"}`)\n );\n const newItems = activities.filter(\n (a) => !existing.has(`${a.txHash}-${a.type}-${a.nftTokenId ?? \"\"}`)\n );\n return newItems.length > 0 ? [...prev, ...newItems] : prev;\n });\n }\n }, [activities, isLoading, page]);\n\n const isInitialLoading = isLoading && allActivities.length === 0;\n const isLoadingMore = isLoading && allActivities.length > 0;\n const hasMore = meta?.total != null ? allActivities.length < meta.total : false;\n const total = meta?.total ?? null;\n\n return (\n <div className=\"space-y-5\">\n {total != null && (\n <div className=\"flex items-center gap-2 text-sm text-muted-foreground\">\n <span className=\"flex items-center gap-1.5\">\n <span className=\"h-1.5 w-1.5 rounded-full bg-brand-blue animate-pulse\" />\n <span className=\"font-semibold text-foreground tabular-nums\">\n {intl.number(total)}\n </span>\n {typeFilter ? `${typeFilter} events` : t(\"total events\")}\n </span>\n {typeFilter && allActivities.length > 0 && (\n <>\n <span className=\"text-muted-foreground/40\">·</span>\n <span>{t(\"{count} loaded\", { count: intl.number(allActivities.length) })}</span>\n </>\n )}\n </div>\n )}\n\n <div className=\"flex flex-wrap gap-2\">\n {TYPE_FILTERS.map((f) => {\n const typeConfig = f.value ? ACTIVITY_TYPE_CONFIG[f.value] : null;\n const Icon = typeConfig?.icon;\n const isActive = typeFilter === f.value;\n return (\n <button\n key={f.value}\n onClick={() => setTypeFilter(f.value)}\n className={cn(\n \"flex items-center gap-1.5 text-xs px-3 py-1.5 rounded-full transition-all font-medium\",\n isActive\n ? \"bg-primary/15 text-primary shadow-sm\"\n : \"text-muted-foreground hover:text-foreground hover:bg-muted/50 bg-background/40\"\n )}\n >\n {Icon && (\n <Icon\n className={cn(\n \"h-3 w-3\",\n isActive ? typeConfig?.colorClass : \"\"\n )}\n />\n )}\n {t(f.label)}\n </button>\n );\n })}\n </div>\n\n {isInitialLoading ? (\n <ActivityListSkeleton />\n ) : allActivities.length === 0 ? (\n <div className=\"py-20 flex flex-col items-center gap-3 text-center\">\n <IconTile>\n <Zap />\n </IconTile>\n {typeFilter ? (\n <p className=\"text-muted-foreground\">{`No ${typeFilter} events yet.`}</p>\n ) : (\n <div>\n <p className=\"font-medium\">{t(emptyMessages.activity.title)}</p>\n <p className=\"text-sm text-muted-foreground\">{t(emptyMessages.activity.description)}</p>\n </div>\n )}\n </div>\n ) : (\n <div className=\"space-y-4\">\n <div className=\"panel divide-y divide-border/50 overflow-hidden\">\n {allActivities.map((activity, i) => (\n <ActivityRow\n key={`${activity.txHash}-${activity.type}-${activity.nftTokenId ?? i}`}\n activity={activity}\n showActor\n showExplorer\n />\n ))}\n </div>\n\n <LoadMoreSentinel\n hasMore={hasMore}\n isLoading={isLoadingMore}\n onLoadMore={() => setPage((p) => p + 1)}\n />\n </div>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAiEU;AA/DV,mBAA4C;AAC5C,4BAA8B;AAE9B,gCAAiC;AACjC,0BAAoB;AACpB,sBAAmD;AACnD,0BAAkD;AAClD,gBAAmB;AACnB,4BAA8B;AAC9B,sBAAqB;AACrB,wBAA0B;AAC1B,uBAAyB;AAEzB,MAAM,YAAY;AAEX,SAAS,iBAAiB;AAC/B,QAAM,WAAO,6BAAU;AACvB,QAAM,QAAI,sBAAK;AACf,QAAM,CAAC,MAAM,OAAO,QAAI,uBAAS,CAAC;AAClC,QAAM,CAAC,YAAY,aAAa,QAAI,uBAAS,EAAE;AAC/C,QAAM,CAAC,eAAe,gBAAgB,QAAI,uBAAwB,CAAC,CAAC;AAEpE,QAAM,eAAW,qBAAO,UAAU;AAClC,8BAAU,MAAM;AACd,QAAI,SAAS,YAAY,YAAY;AACnC,eAAS,UAAU;AACnB,cAAQ,CAAC;AACT,uBAAiB,CAAC,CAAC;AAAA,IACrB;AAAA,EACF,GAAG,CAAC,UAAU,CAAC;AAEf,QAAM,EAAE,YAAY,MAAM,UAAU,QAAI,qCAAc;AAAA,IACpD,OAAO;AAAA,IACP;AAAA,IACA,MAAO,cAA6C;AAAA,EACtD,CAAC;AAED,8BAAU,MAAM;AACd,QAAI,UAAW;AACf,QAAI,SAAS,GAAG;AACd,uBAAiB,UAAU;AAAA,IAC7B,OAAO;AACL,uBAAiB,CAAC,SAAS;AACzB,cAAM,W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empty-messages.js";
|
|
11
11
|
import { useT } from "../i18n/provider.js";
|
|
12
12
|
import { useFormat } from "../i18n/use-format.js";
|
|
13
|
+
import { IconTile } from "./icon-tile.js";
|
|
13
14
|
const PAGE_SIZE = 30;
|
|
14
15
|
function ActivitiesFeed() {
|
|
15
16
|
const intl = useFormat();
|
|
@@ -91,7 +92,7 @@ function ActivitiesFeed() {
|
|
|
91
92
|
);
|
|
92
93
|
}) }),
|
|
93
94
|
isInitialLoading ? /* @__PURE__ */ jsx(ActivityListSkeleton, {}) : allActivities.length === 0 ? /* @__PURE__ */ jsxs("div", { className: "py-20 flex flex-col items-center gap-3 text-center", children: [
|
|
94
|
-
/* @__PURE__ */ jsx(
|
|
95
|
+
/* @__PURE__ */ jsx(IconTile, { children: /* @__PURE__ */ jsx(Zap, {}) }),
|
|
95
96
|
typeFilter ? /* @__PURE__ */ jsx("p", { className: "text-muted-foreground", children: `No ${typeFilter} events yet.` }) : /* @__PURE__ */ jsxs("div", { children: [
|
|
96
97
|
/* @__PURE__ */ jsx("p", { className: "font-medium", children: t(emptyMessages.activity.title) }),
|
|
97
98
|
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: t(emptyMessages.activity.description) })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/activities-feed.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState, useEffect, useRef } from \"react\";\nimport { useActivities } from \"../utils/use-activities.js\";\nimport type { ApiActivitiesQuery, ApiActivity } from \"@medialane/sdk\";\nimport { LoadMoreSentinel } from \"./load-more-sentinel.js\";\nimport { Zap } from \"lucide-react\";\nimport { ACTIVITY_TYPE_CONFIG, TYPE_FILTERS } from \"../data/activity.js\";\nimport { ActivityListSkeleton, ActivityRow } from \"./activity-row.js\";\nimport { cn } from \"../utils/cn.js\";\nimport { emptyMessages } from \"../utils/empty-messages.js\";\nimport { useT } from \"../i18n/provider.js\";\nimport { useFormat } from \"../i18n/use-format.js\";\n\nconst PAGE_SIZE = 30;\n\nexport function ActivitiesFeed() {\n const intl = useFormat();\n const t = useT();\n const [page, setPage] = useState(1);\n const [typeFilter, setTypeFilter] = useState(\"\");\n const [allActivities, setAllActivities] = useState<ApiActivity[]>([]);\n\n const prevType = useRef(typeFilter);\n useEffect(() => {\n if (prevType.current !== typeFilter) {\n prevType.current = typeFilter;\n setPage(1);\n setAllActivities([]);\n }\n }, [typeFilter]);\n\n const { activities, meta, isLoading } = useActivities({\n limit: PAGE_SIZE,\n page,\n type: (typeFilter as ApiActivitiesQuery[\"type\"]) || undefined,\n });\n\n useEffect(() => {\n if (isLoading) return;\n if (page === 1) {\n setAllActivities(activities);\n } else {\n setAllActivities((prev) => {\n const existing = new Set(\n prev.map((a) => `${a.txHash}-${a.type}-${a.nftTokenId ?? \"\"}`)\n );\n const newItems = activities.filter(\n (a) => !existing.has(`${a.txHash}-${a.type}-${a.nftTokenId ?? \"\"}`)\n );\n return newItems.length > 0 ? [...prev, ...newItems] : prev;\n });\n }\n }, [activities, isLoading, page]);\n\n const isInitialLoading = isLoading && allActivities.length === 0;\n const isLoadingMore = isLoading && allActivities.length > 0;\n const hasMore = meta?.total != null ? allActivities.length < meta.total : false;\n const total = meta?.total ?? null;\n\n return (\n <div className=\"space-y-5\">\n {total != null && (\n <div className=\"flex items-center gap-2 text-sm text-muted-foreground\">\n <span className=\"flex items-center gap-1.5\">\n <span className=\"h-1.5 w-1.5 rounded-full bg-brand-blue animate-pulse\" />\n <span className=\"font-semibold text-foreground tabular-nums\">\n {intl.number(total)}\n </span>\n {typeFilter ? `${typeFilter} events` : t(\"total events\")}\n </span>\n {typeFilter && allActivities.length > 0 && (\n <>\n <span className=\"text-muted-foreground/40\">·</span>\n <span>{t(\"{count} loaded\", { count: intl.number(allActivities.length) })}</span>\n </>\n )}\n </div>\n )}\n\n <div className=\"flex flex-wrap gap-2\">\n {TYPE_FILTERS.map((f) => {\n const typeConfig = f.value ? ACTIVITY_TYPE_CONFIG[f.value] : null;\n const Icon = typeConfig?.icon;\n const isActive = typeFilter === f.value;\n return (\n <button\n key={f.value}\n onClick={() => setTypeFilter(f.value)}\n className={cn(\n \"flex items-center gap-1.5 text-xs px-3 py-1.5 rounded-full transition-all font-medium\",\n isActive\n ? \"bg-primary/15 text-primary shadow-sm\"\n : \"text-muted-foreground hover:text-foreground hover:bg-muted/50 bg-background/40\"\n )}\n >\n {Icon && (\n <Icon\n className={cn(\n \"h-3 w-3\",\n isActive ? typeConfig?.colorClass : \"\"\n )}\n />\n )}\n {t(f.label)}\n </button>\n );\n })}\n </div>\n\n {isInitialLoading ? (\n <ActivityListSkeleton />\n ) : allActivities.length === 0 ? (\n <div className=\"py-20 flex flex-col items-center gap-3 text-center\">\n <
|
|
1
|
+
{"version":3,"sources":["../../src/components/activities-feed.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState, useEffect, useRef } from \"react\";\nimport { useActivities } from \"../utils/use-activities.js\";\nimport type { ApiActivitiesQuery, ApiActivity } from \"@medialane/sdk\";\nimport { LoadMoreSentinel } from \"./load-more-sentinel.js\";\nimport { Zap } from \"lucide-react\";\nimport { ACTIVITY_TYPE_CONFIG, TYPE_FILTERS } from \"../data/activity.js\";\nimport { ActivityListSkeleton, ActivityRow } from \"./activity-row.js\";\nimport { cn } from \"../utils/cn.js\";\nimport { emptyMessages } from \"../utils/empty-messages.js\";\nimport { useT } from \"../i18n/provider.js\";\nimport { useFormat } from \"../i18n/use-format.js\";\nimport { IconTile } from \"./icon-tile.js\";\n\nconst PAGE_SIZE = 30;\n\nexport function ActivitiesFeed() {\n const intl = useFormat();\n const t = useT();\n const [page, setPage] = useState(1);\n const [typeFilter, setTypeFilter] = useState(\"\");\n const [allActivities, setAllActivities] = useState<ApiActivity[]>([]);\n\n const prevType = useRef(typeFilter);\n useEffect(() => {\n if (prevType.current !== typeFilter) {\n prevType.current = typeFilter;\n setPage(1);\n setAllActivities([]);\n }\n }, [typeFilter]);\n\n const { activities, meta, isLoading } = useActivities({\n limit: PAGE_SIZE,\n page,\n type: (typeFilter as ApiActivitiesQuery[\"type\"]) || undefined,\n });\n\n useEffect(() => {\n if (isLoading) return;\n if (page === 1) {\n setAllActivities(activities);\n } else {\n setAllActivities((prev) => {\n const existing = new Set(\n prev.map((a) => `${a.txHash}-${a.type}-${a.nftTokenId ?? \"\"}`)\n );\n const newItems = activities.filter(\n (a) => !existing.has(`${a.txHash}-${a.type}-${a.nftTokenId ?? \"\"}`)\n );\n return newItems.length > 0 ? [...prev, ...newItems] : prev;\n });\n }\n }, [activities, isLoading, page]);\n\n const isInitialLoading = isLoading && allActivities.length === 0;\n const isLoadingMore = isLoading && allActivities.length > 0;\n const hasMore = meta?.total != null ? allActivities.length < meta.total : false;\n const total = meta?.total ?? null;\n\n return (\n <div className=\"space-y-5\">\n {total != null && (\n <div className=\"flex items-center gap-2 text-sm text-muted-foreground\">\n <span className=\"flex items-center gap-1.5\">\n <span className=\"h-1.5 w-1.5 rounded-full bg-brand-blue animate-pulse\" />\n <span className=\"font-semibold text-foreground tabular-nums\">\n {intl.number(total)}\n </span>\n {typeFilter ? `${typeFilter} events` : t(\"total events\")}\n </span>\n {typeFilter && allActivities.length > 0 && (\n <>\n <span className=\"text-muted-foreground/40\">·</span>\n <span>{t(\"{count} loaded\", { count: intl.number(allActivities.length) })}</span>\n </>\n )}\n </div>\n )}\n\n <div className=\"flex flex-wrap gap-2\">\n {TYPE_FILTERS.map((f) => {\n const typeConfig = f.value ? ACTIVITY_TYPE_CONFIG[f.value] : null;\n const Icon = typeConfig?.icon;\n const isActive = typeFilter === f.value;\n return (\n <button\n key={f.value}\n onClick={() => setTypeFilter(f.value)}\n className={cn(\n \"flex items-center gap-1.5 text-xs px-3 py-1.5 rounded-full transition-all font-medium\",\n isActive\n ? \"bg-primary/15 text-primary shadow-sm\"\n : \"text-muted-foreground hover:text-foreground hover:bg-muted/50 bg-background/40\"\n )}\n >\n {Icon && (\n <Icon\n className={cn(\n \"h-3 w-3\",\n isActive ? typeConfig?.colorClass : \"\"\n )}\n />\n )}\n {t(f.label)}\n </button>\n );\n })}\n </div>\n\n {isInitialLoading ? (\n <ActivityListSkeleton />\n ) : allActivities.length === 0 ? (\n <div className=\"py-20 flex flex-col items-center gap-3 text-center\">\n <IconTile>\n <Zap />\n </IconTile>\n {typeFilter ? (\n <p className=\"text-muted-foreground\">{`No ${typeFilter} events yet.`}</p>\n ) : (\n <div>\n <p className=\"font-medium\">{t(emptyMessages.activity.title)}</p>\n <p className=\"text-sm text-muted-foreground\">{t(emptyMessages.activity.description)}</p>\n </div>\n )}\n </div>\n ) : (\n <div className=\"space-y-4\">\n <div className=\"panel divide-y divide-border/50 overflow-hidden\">\n {allActivities.map((activity, i) => (\n <ActivityRow\n key={`${activity.txHash}-${activity.type}-${activity.nftTokenId ?? i}`}\n activity={activity}\n showActor\n showExplorer\n />\n ))}\n </div>\n\n <LoadMoreSentinel\n hasMore={hasMore}\n isLoading={isLoadingMore}\n onLoadMore={() => setPage((p) => p + 1)}\n />\n </div>\n )}\n </div>\n );\n}\n"],"mappings":";AAiEU,SAQE,UAPA,KADF;AA/DV,SAAS,UAAU,WAAW,cAAc;AAC5C,SAAS,qBAAqB;AAE9B,SAAS,wBAAwB;AACjC,SAAS,WAAW;AACpB,SAAS,sBAAsB,oBAAoB;AACnD,SAAS,sBAAsB,mBAAmB;AAClD,SAAS,UAAU;AACnB,SAAS,qBAAqB;AAC9B,SAAS,YAAY;AACrB,SAAS,iBAAiB;AAC1B,SAAS,gBAAgB;AAEzB,MAAM,YAAY;AAEX,SAAS,iBAAiB;AAC/B,QAAM,OAAO,UAAU;AACvB,QAAM,IAAI,KAAK;AACf,QAAM,CAAC,MAAM,OAAO,IAAI,SAAS,CAAC;AAClC,QAAM,CAAC,YAAY,aAAa,IAAI,SAAS,EAAE;AAC/C,QAAM,CAAC,eAAe,gBAAgB,IAAI,SAAwB,CAAC,CAAC;AAEpE,QAAM,WAAW,OAAO,UAAU;AAClC,YAAU,MAAM;AACd,QAAI,SAAS,Y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AAS;AAAA,UACT,cAAY;AAAA;AAAA,QAHP,GAAG,SAAS,MAAM,IAAI,SAAS,IAAI,IAAI,SAAS,cAAc,CAAC;AAAA,MAItE,CACD,GACH;AAAA,MAEA;AAAA,QAAC;AAAA;AAAA,UACC;AAAA,UACA,WAAW;AAAA,UACX,YAAY,MAAM,QAAQ,CAAC,MAAM,IAAI,CAAC;AAAA;AAAA,MACxC;AAAA,OACF;AAAA,KAEJ;AAEJ;","names":[]}
|
|
@@ -42,6 +42,7 @@ var import_cn = require("../utils/cn.js");
|
|
|
42
42
|
var import_provider = require("../i18n/provider.js");
|
|
43
43
|
var import_translate = require("../i18n/translate.js");
|
|
44
44
|
var import_activity = require("../data/activity.js");
|
|
45
|
+
var import_icon_tile = require("./icon-tile.js");
|
|
45
46
|
const ACTIVITY_LABEL = {
|
|
46
47
|
mint: (0, import_translate.msg)("Minted"),
|
|
47
48
|
listing: (0, import_translate.msg)("Listed"),
|
|
@@ -70,7 +71,7 @@ function ActivityTimelineRow({
|
|
|
70
71
|
const contract = event.nftContract ?? event.contractAddress;
|
|
71
72
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex gap-4 group", children: [
|
|
72
73
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex flex-col items-center shrink-0 w-9", children: [
|
|
73
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
74
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icon_tile.IconTile, { size: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, {}) }),
|
|
74
75
|
!isLast && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex-1 w-px bg-border/50 mt-1.5 min-h-4" })
|
|
75
76
|
] }),
|
|
76
77
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex-1 pb-5 min-w-0 pt-1", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-start justify-between gap-3", children: [
|