@medialane/ui 0.203.0 → 0.204.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/dist/components/account/input-otp.d.cts +2 -2
  2. package/dist/components/account/input-otp.d.ts +2 -2
  3. package/dist/components/activity-row.cjs +2 -1
  4. package/dist/components/activity-row.cjs.map +1 -1
  5. package/dist/components/activity-row.js +2 -1
  6. package/dist/components/activity-row.js.map +1 -1
  7. package/dist/components/button.d.cts +2 -2
  8. package/dist/components/button.d.ts +2 -2
  9. package/dist/components/collection-name-claim.cjs +100 -0
  10. package/dist/components/collection-name-claim.cjs.map +1 -0
  11. package/dist/components/collection-name-claim.d.cts +5 -0
  12. package/dist/components/collection-name-claim.d.ts +5 -0
  13. package/dist/components/collection-name-claim.js +66 -0
  14. package/dist/components/collection-name-claim.js.map +1 -0
  15. package/dist/components/creators-page.cjs +218 -0
  16. package/dist/components/creators-page.cjs.map +1 -0
  17. package/dist/components/creators-page.d.cts +5 -0
  18. package/dist/components/creators-page.d.ts +5 -0
  19. package/dist/components/creators-page.js +184 -0
  20. package/dist/components/creators-page.js.map +1 -0
  21. package/dist/components/discover-community-section.cjs +171 -0
  22. package/dist/components/discover-community-section.cjs.map +1 -0
  23. package/dist/components/discover-community-section.d.cts +5 -0
  24. package/dist/components/discover-community-section.d.ts +5 -0
  25. package/dist/components/discover-community-section.js +137 -0
  26. package/dist/components/discover-community-section.js.map +1 -0
  27. package/dist/components/discover-page.cjs +96 -0
  28. package/dist/components/discover-page.cjs.map +1 -0
  29. package/dist/components/discover-page.d.cts +14 -0
  30. package/dist/components/discover-page.d.ts +14 -0
  31. package/dist/components/discover-page.js +72 -0
  32. package/dist/components/discover-page.js.map +1 -0
  33. package/dist/components/fast-mint/fast-mint.d.cts +2 -2
  34. package/dist/components/fast-mint/fast-mint.d.ts +2 -2
  35. package/dist/components/home-page.cjs +124 -0
  36. package/dist/components/home-page.cjs.map +1 -0
  37. package/dist/components/home-page.d.cts +13 -0
  38. package/dist/components/home-page.d.ts +13 -0
  39. package/dist/components/home-page.js +90 -0
  40. package/dist/components/home-page.js.map +1 -0
  41. package/dist/components/ip-type-nav.cjs +74 -0
  42. package/dist/components/ip-type-nav.cjs.map +1 -0
  43. package/dist/components/ip-type-nav.d.cts +5 -0
  44. package/dist/components/ip-type-nav.d.ts +5 -0
  45. package/dist/components/ip-type-nav.js +40 -0
  46. package/dist/components/ip-type-nav.js.map +1 -0
  47. package/dist/components/portfolio-assets.cjs +2 -5
  48. package/dist/components/portfolio-assets.cjs.map +1 -1
  49. package/dist/components/portfolio-assets.js +3 -6
  50. package/dist/components/portfolio-assets.js.map +1 -1
  51. package/dist/components/rewards/leaderboard-panel.cjs +107 -0
  52. package/dist/components/rewards/leaderboard-panel.cjs.map +1 -0
  53. package/dist/components/rewards/leaderboard-panel.d.cts +12 -0
  54. package/dist/components/rewards/leaderboard-panel.d.ts +12 -0
  55. package/dist/components/rewards/leaderboard-panel.js +73 -0
  56. package/dist/components/rewards/leaderboard-panel.js.map +1 -0
  57. package/dist/components/rewards/rewards-dashboard.cjs +341 -0
  58. package/dist/components/rewards/rewards-dashboard.cjs.map +1 -0
  59. package/dist/components/rewards/rewards-dashboard.d.cts +6 -0
  60. package/dist/components/rewards/rewards-dashboard.d.ts +6 -0
  61. package/dist/components/rewards/rewards-dashboard.js +331 -0
  62. package/dist/components/rewards/rewards-dashboard.js.map +1 -0
  63. package/dist/components/sheet.d.cts +1 -1
  64. package/dist/components/sheet.d.ts +1 -1
  65. package/dist/index.cjs +29 -0
  66. package/dist/index.cjs.map +1 -1
  67. package/dist/index.d.cts +9 -0
  68. package/dist/index.d.ts +9 -0
  69. package/dist/index.js +19 -0
  70. package/dist/index.js.map +1 -1
  71. package/dist/utils/order-usd.cjs +35 -0
  72. package/dist/utils/order-usd.cjs.map +1 -0
  73. package/dist/utils/order-usd.d.cts +8 -0
  74. package/dist/utils/order-usd.d.ts +8 -0
  75. package/dist/utils/order-usd.js +11 -0
  76. package/dist/utils/order-usd.js.map +1 -0
  77. package/package.json +1 -1
@@ -0,0 +1,107 @@
1
+ "use strict";
2
+ "use client";
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __export = (target, all) => {
10
+ for (var name in all)
11
+ __defProp(target, name, { get: all[name], enumerable: true });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from))
16
+ if (!__hasOwnProp.call(to, key) && key !== except)
17
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
+ }
19
+ return to;
20
+ };
21
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
+ // If the importer is in node compatibility mode or this is not an ESM
23
+ // file that has been converted to a CommonJS file using a Babel-
24
+ // compatible transform (i.e. "__esModule" has not been set), then set
25
+ // "default" to the CommonJS "module.exports" for node compatibility.
26
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
+ mod
28
+ ));
29
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
+ var leaderboard_panel_exports = {};
31
+ __export(leaderboard_panel_exports, {
32
+ LeaderboardPanel: () => LeaderboardPanel
33
+ });
34
+ module.exports = __toCommonJS(leaderboard_panel_exports);
35
+ var import_jsx_runtime = require("react/jsx-runtime");
36
+ var import_lucide_react = require("lucide-react");
37
+ var import_sdk = require("@medialane/sdk");
38
+ var import_image = __toESM(require("../image.js"), 1);
39
+ var import_link = __toESM(require("../link.js"), 1);
40
+ var import_skeleton = require("../skeleton.js");
41
+ var import_address_display = require("../address-display.js");
42
+ var import_leaderboard_table = require("./leaderboard-table.js");
43
+ var import_cn = require("../../utils/cn.js");
44
+ var import_profile_identity = require("../../utils/profile-identity.js");
45
+ var import_use_profiles = require("../../utils/use-profiles.js");
46
+ var import_use_image_url = require("../../utils/use-image-url.js");
47
+ var import_use_rewards = require("../../utils/use-rewards.js");
48
+ function CreatorIdentity({ address }) {
49
+ const { profile } = (0, import_use_profiles.useCreatorProfile)(address);
50
+ const avatarUrl = (0, import_use_image_url.useImageUrl)()(profile?.avatarImage, { width: 96 });
51
+ const { identity: name } = (0, import_profile_identity.profileIdentity)({
52
+ username: profile?.username,
53
+ name: profile?.name,
54
+ walletAddress: address
55
+ });
56
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "inline-flex min-w-0 items-center gap-2.5", children: [
57
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "relative h-9 w-9 shrink-0 overflow-hidden rounded-full bg-foreground/[0.08]", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
58
+ import_image.default,
59
+ {
60
+ src: avatarUrl ?? "/icon.png",
61
+ alt: "",
62
+ fill: true,
63
+ unoptimized: true,
64
+ className: avatarUrl ? "object-cover" : "object-cover p-[15%] opacity-50"
65
+ }
66
+ ) }),
67
+ name ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "truncate text-base font-bold", children: name }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_address_display.AddressDisplay, { address, chars: 4, showCopy: false, className: "text-base font-bold" })
68
+ ] });
69
+ }
70
+ function LeaderboardPanel({
71
+ myAddress,
72
+ limit = 20,
73
+ showHeading = true,
74
+ viewAllHref,
75
+ className
76
+ }) {
77
+ const { data, isLoading } = (0, import_use_rewards.useLeaderboard)(1, limit);
78
+ const rows = data?.data ?? [];
79
+ const highlightAddress = myAddress ? (0, import_sdk.normalizeAddress)("STARKNET", myAddress) : null;
80
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: (0, import_cn.cn)("space-y-3", className), children: [
81
+ showHeading && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-2", children: [
82
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex h-7 w-7 items-center justify-center rounded-lg bg-gradient-to-br from-brand-rose to-brand-orange text-white shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Sparkles, { className: "h-3.5 w-3.5" }) }),
83
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { className: "text-sm font-black", children: "Community Rewards" })
84
+ ] }),
85
+ isLoading ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "space-y-1.5", children: Array.from({ length: Math.min(limit, 6) }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, { className: "h-10 w-full rounded-lg" }, i)) }) : rows.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm text-muted-foreground py-4", children: "Nobody's earned points yet \u2014 be the first." }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
86
+ import_leaderboard_table.LeaderboardTable,
87
+ {
88
+ entries: rows,
89
+ highlightAddress,
90
+ renderAddress: (address) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_link.default, { href: (0, import_sdk.profileHref)({ address }), className: "hover:text-foreground transition-colors", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CreatorIdentity, { address }) })
91
+ }
92
+ ),
93
+ viewAllHref && rows.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
94
+ import_link.default,
95
+ {
96
+ href: viewAllHref,
97
+ className: "inline-flex items-center gap-1 text-xs font-semibold text-muted-foreground hover:text-foreground transition-colors pt-1",
98
+ children: "View scoreboard \u2192"
99
+ }
100
+ )
101
+ ] });
102
+ }
103
+ // Annotate the CommonJS export names for ESM import in node:
104
+ 0 && (module.exports = {
105
+ LeaderboardPanel
106
+ });
107
+ //# sourceMappingURL=leaderboard-panel.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/rewards/leaderboard-panel.tsx"],"sourcesContent":["\"use client\";\n\nimport { Sparkles } from \"lucide-react\";\nimport { normalizeAddress, profileHref } from \"@medialane/sdk\";\nimport Image from \"../image.js\";\nimport Link from \"../link.js\";\nimport { Skeleton } from \"../skeleton.js\";\nimport { AddressDisplay } from \"../address-display.js\";\nimport { LeaderboardTable } from \"./leaderboard-table.js\";\nimport { cn } from \"../../utils/cn.js\";\nimport { profileIdentity } from \"../../utils/profile-identity.js\";\nimport { useCreatorProfile } from \"../../utils/use-profiles.js\";\nimport { useImageUrl } from \"../../utils/use-image-url.js\";\nimport { useLeaderboard } from \"../../utils/use-rewards.js\";\n\nexport interface LeaderboardPanelProps {\n myAddress?: string | null;\n limit?: number;\n showHeading?: boolean;\n viewAllHref?: string;\n className?: string;\n}\n\nfunction CreatorIdentity({ address }: { address: string }) {\n const { profile } = useCreatorProfile(address);\n const avatarUrl = useImageUrl()(profile?.avatarImage, { width: 96 });\n const { identity: name } = profileIdentity({\n username: profile?.username,\n name: profile?.name,\n walletAddress: address,\n });\n\n return (\n <span className=\"inline-flex min-w-0 items-center gap-2.5\">\n <span className=\"relative h-9 w-9 shrink-0 overflow-hidden rounded-full bg-foreground/[0.08]\">\n <Image\n src={avatarUrl ?? \"/icon.png\"}\n alt=\"\"\n fill\n unoptimized\n className={avatarUrl ? \"object-cover\" : \"object-cover p-[15%] opacity-50\"}\n />\n </span>\n {name ? (\n <span className=\"truncate text-base font-bold\">{name}</span>\n ) : (\n <AddressDisplay address={address} chars={4} showCopy={false} className=\"text-base font-bold\" />\n )}\n </span>\n );\n}\n\nexport function LeaderboardPanel({\n myAddress,\n limit = 20,\n showHeading = true,\n viewAllHref,\n className,\n}: LeaderboardPanelProps) {\n const { data, isLoading } = useLeaderboard(1, limit);\n const rows = data?.data ?? [];\n\n const highlightAddress = myAddress ? normalizeAddress(\"STARKNET\", myAddress) : null;\n\n return (\n <div className={cn(\"space-y-3\", className)}>\n {showHeading && (\n <div className=\"flex items-center gap-2\">\n <div className=\"flex h-7 w-7 items-center justify-center rounded-lg bg-gradient-to-br from-brand-rose to-brand-orange text-white shrink-0\">\n <Sparkles className=\"h-3.5 w-3.5\" />\n </div>\n <h2 className=\"text-sm font-black\">Community Rewards</h2>\n </div>\n )}\n\n {isLoading ? (\n <div className=\"space-y-1.5\">\n {Array.from({ length: Math.min(limit, 6) }).map((_, i) => (\n <Skeleton key={i} className=\"h-10 w-full rounded-lg\" />\n ))}\n </div>\n ) : rows.length === 0 ? (\n <p className=\"text-sm text-muted-foreground py-4\">\n Nobody&apos;s earned points yet — be the first.\n </p>\n ) : (\n <LeaderboardTable\n entries={rows}\n highlightAddress={highlightAddress}\n renderAddress={(address) => (\n <Link href={profileHref({ address })} className=\"hover:text-foreground transition-colors\">\n <CreatorIdentity address={address} />\n </Link>\n )}\n />\n )}\n\n {viewAllHref && rows.length > 0 && (\n <Link\n href={viewAllHref}\n className=\"inline-flex items-center gap-1 text-xs font-semibold text-muted-foreground hover:text-foreground transition-colors pt-1\"\n >\n View scoreboard →\n </Link>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAiCI;AA/BJ,0BAAyB;AACzB,iBAA8C;AAC9C,mBAAkB;AAClB,kBAAiB;AACjB,sBAAyB;AACzB,6BAA+B;AAC/B,+BAAiC;AACjC,gBAAmB;AACnB,8BAAgC;AAChC,0BAAkC;AAClC,2BAA4B;AAC5B,yBAA+B;AAU/B,SAAS,gBAAgB,EAAE,QAAQ,GAAwB;AACzD,QAAM,EAAE,QAAQ,QAAI,uCAAkB,OAAO;AAC7C,QAAM,gBAAY,kCAAY,EAAE,SAAS,aAAa,EAAE,OAAO,GAAG,CAAC;AACnE,QAAM,EAAE,UAAU,KAAK,QAAI,yCAAgB;AAAA,IACzC,UAAU,SAAS;AAAA,IACnB,MAAM,SAAS;AAAA,IACf,eAAe;AAAA,EACjB,CAAC;AAED,SACE,6CAAC,UAAK,WAAU,4CACd;AAAA,gDAAC,UAAK,WAAU,+EACd;AAAA,MAAC,aAAAA;AAAA,MAAA;AAAA,QACC,KAAK,aAAa;AAAA,QAClB,KAAI;AAAA,QACJ,MAAI;AAAA,QACJ,aAAW;AAAA,QACX,WAAW,YAAY,iBAAiB;AAAA;AAAA,IAC1C,GACF;AAAA,IACC,OACC,4CAAC,UAAK,WAAU,gCAAgC,gBAAK,IAErD,4CAAC,yCAAe,SAAkB,OAAO,GAAG,UAAU,OAAO,WAAU,uBAAsB;AAAA,KAEjG;AAEJ;AAEO,SAAS,iBAAiB;AAAA,EAC/B;AAAA,EACA,QAAQ;AAAA,EACR,cAAc;AAAA,EACd;AAAA,EACA;AACF,GAA0B;AACxB,QAAM,EAAE,MAAM,UAAU,QAAI,mCAAe,GAAG,KAAK;AACnD,QAAM,OAAO,MAAM,QAAQ,CAAC;AAE5B,QAAM,mBAAmB,gBAAY,6BAAiB,YAAY,SAAS,IAAI;AAE/E,SACE,6CAAC,SAAI,eAAW,cAAG,aAAa,SAAS,GACtC;AAAA,mBACC,6CAAC,SAAI,WAAU,2BACb;AAAA,kDAAC,SAAI,WAAU,6HACb,sDAAC,gCAAS,WAAU,eAAc,GACpC;AAAA,MACA,4CAAC,QAAG,WAAU,sBAAqB,+BAAiB;AAAA,OACtD;AAAA,IAGD,YACC,4CAAC,SAAI,WAAU,eACZ,gBAAM,KAAK,EAAE,QAAQ,KAAK,IAAI,OAAO,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,GAAG,MAClD,4CAAC,4BAAiB,WAAU,4BAAb,CAAsC,CACtD,GACH,IACE,KAAK,WAAW,IAClB,4CAAC,OAAE,WAAU,sCAAqC,6DAElD,IAEA;AAAA,MAAC;AAAA;AAAA,QACC,SAAS;AAAA,QACT;AAAA,QACA,eAAe,CAAC,YACd,4CAAC,YAAAC,SAAA,EAAK,UAAM,wBAAY,EAAE,QAAQ,CAAC,GAAG,WAAU,2CAC9C,sDAAC,mBAAgB,SAAkB,GACrC;AAAA;AAAA,IAEJ;AAAA,IAGD,eAAe,KAAK,SAAS,KAC5B;AAAA,MAAC,YAAAA;AAAA,MAAA;AAAA,QACC,MAAM;AAAA,QACN,WAAU;AAAA,QACX;AAAA;AAAA,IAED;AAAA,KAEJ;AAEJ;","names":["Image","Link"]}
@@ -0,0 +1,12 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+
3
+ interface LeaderboardPanelProps {
4
+ myAddress?: string | null;
5
+ limit?: number;
6
+ showHeading?: boolean;
7
+ viewAllHref?: string;
8
+ className?: string;
9
+ }
10
+ declare function LeaderboardPanel({ myAddress, limit, showHeading, viewAllHref, className, }: LeaderboardPanelProps): react_jsx_runtime.JSX.Element;
11
+
12
+ export { LeaderboardPanel, type LeaderboardPanelProps };
@@ -0,0 +1,12 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+
3
+ interface LeaderboardPanelProps {
4
+ myAddress?: string | null;
5
+ limit?: number;
6
+ showHeading?: boolean;
7
+ viewAllHref?: string;
8
+ className?: string;
9
+ }
10
+ declare function LeaderboardPanel({ myAddress, limit, showHeading, viewAllHref, className, }: LeaderboardPanelProps): react_jsx_runtime.JSX.Element;
11
+
12
+ export { LeaderboardPanel, type LeaderboardPanelProps };
@@ -0,0 +1,73 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { Sparkles } from "lucide-react";
4
+ import { normalizeAddress, profileHref } from "@medialane/sdk";
5
+ import Image from "../image.js";
6
+ import Link from "../link.js";
7
+ import { Skeleton } from "../skeleton.js";
8
+ import { AddressDisplay } from "../address-display.js";
9
+ import { LeaderboardTable } from "./leaderboard-table.js";
10
+ import { cn } from "../../utils/cn.js";
11
+ import { profileIdentity } from "../../utils/profile-identity.js";
12
+ import { useCreatorProfile } from "../../utils/use-profiles.js";
13
+ import { useImageUrl } from "../../utils/use-image-url.js";
14
+ import { useLeaderboard } from "../../utils/use-rewards.js";
15
+ function CreatorIdentity({ address }) {
16
+ const { profile } = useCreatorProfile(address);
17
+ const avatarUrl = useImageUrl()(profile?.avatarImage, { width: 96 });
18
+ const { identity: name } = profileIdentity({
19
+ username: profile?.username,
20
+ name: profile?.name,
21
+ walletAddress: address
22
+ });
23
+ return /* @__PURE__ */ jsxs("span", { className: "inline-flex min-w-0 items-center gap-2.5", children: [
24
+ /* @__PURE__ */ jsx("span", { className: "relative h-9 w-9 shrink-0 overflow-hidden rounded-full bg-foreground/[0.08]", children: /* @__PURE__ */ jsx(
25
+ Image,
26
+ {
27
+ src: avatarUrl ?? "/icon.png",
28
+ alt: "",
29
+ fill: true,
30
+ unoptimized: true,
31
+ className: avatarUrl ? "object-cover" : "object-cover p-[15%] opacity-50"
32
+ }
33
+ ) }),
34
+ name ? /* @__PURE__ */ jsx("span", { className: "truncate text-base font-bold", children: name }) : /* @__PURE__ */ jsx(AddressDisplay, { address, chars: 4, showCopy: false, className: "text-base font-bold" })
35
+ ] });
36
+ }
37
+ function LeaderboardPanel({
38
+ myAddress,
39
+ limit = 20,
40
+ showHeading = true,
41
+ viewAllHref,
42
+ className
43
+ }) {
44
+ const { data, isLoading } = useLeaderboard(1, limit);
45
+ const rows = data?.data ?? [];
46
+ const highlightAddress = myAddress ? normalizeAddress("STARKNET", myAddress) : null;
47
+ return /* @__PURE__ */ jsxs("div", { className: cn("space-y-3", className), children: [
48
+ showHeading && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
49
+ /* @__PURE__ */ jsx("div", { className: "flex h-7 w-7 items-center justify-center rounded-lg bg-gradient-to-br from-brand-rose to-brand-orange text-white shrink-0", children: /* @__PURE__ */ jsx(Sparkles, { className: "h-3.5 w-3.5" }) }),
50
+ /* @__PURE__ */ jsx("h2", { className: "text-sm font-black", children: "Community Rewards" })
51
+ ] }),
52
+ isLoading ? /* @__PURE__ */ jsx("div", { className: "space-y-1.5", children: Array.from({ length: Math.min(limit, 6) }).map((_, i) => /* @__PURE__ */ jsx(Skeleton, { className: "h-10 w-full rounded-lg" }, i)) }) : rows.length === 0 ? /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground py-4", children: "Nobody's earned points yet \u2014 be the first." }) : /* @__PURE__ */ jsx(
53
+ LeaderboardTable,
54
+ {
55
+ entries: rows,
56
+ highlightAddress,
57
+ renderAddress: (address) => /* @__PURE__ */ jsx(Link, { href: profileHref({ address }), className: "hover:text-foreground transition-colors", children: /* @__PURE__ */ jsx(CreatorIdentity, { address }) })
58
+ }
59
+ ),
60
+ viewAllHref && rows.length > 0 && /* @__PURE__ */ jsx(
61
+ Link,
62
+ {
63
+ href: viewAllHref,
64
+ className: "inline-flex items-center gap-1 text-xs font-semibold text-muted-foreground hover:text-foreground transition-colors pt-1",
65
+ children: "View scoreboard \u2192"
66
+ }
67
+ )
68
+ ] });
69
+ }
70
+ export {
71
+ LeaderboardPanel
72
+ };
73
+ //# sourceMappingURL=leaderboard-panel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/rewards/leaderboard-panel.tsx"],"sourcesContent":["\"use client\";\n\nimport { Sparkles } from \"lucide-react\";\nimport { normalizeAddress, profileHref } from \"@medialane/sdk\";\nimport Image from \"../image.js\";\nimport Link from \"../link.js\";\nimport { Skeleton } from \"../skeleton.js\";\nimport { AddressDisplay } from \"../address-display.js\";\nimport { LeaderboardTable } from \"./leaderboard-table.js\";\nimport { cn } from \"../../utils/cn.js\";\nimport { profileIdentity } from \"../../utils/profile-identity.js\";\nimport { useCreatorProfile } from \"../../utils/use-profiles.js\";\nimport { useImageUrl } from \"../../utils/use-image-url.js\";\nimport { useLeaderboard } from \"../../utils/use-rewards.js\";\n\nexport interface LeaderboardPanelProps {\n myAddress?: string | null;\n limit?: number;\n showHeading?: boolean;\n viewAllHref?: string;\n className?: string;\n}\n\nfunction CreatorIdentity({ address }: { address: string }) {\n const { profile } = useCreatorProfile(address);\n const avatarUrl = useImageUrl()(profile?.avatarImage, { width: 96 });\n const { identity: name } = profileIdentity({\n username: profile?.username,\n name: profile?.name,\n walletAddress: address,\n });\n\n return (\n <span className=\"inline-flex min-w-0 items-center gap-2.5\">\n <span className=\"relative h-9 w-9 shrink-0 overflow-hidden rounded-full bg-foreground/[0.08]\">\n <Image\n src={avatarUrl ?? \"/icon.png\"}\n alt=\"\"\n fill\n unoptimized\n className={avatarUrl ? \"object-cover\" : \"object-cover p-[15%] opacity-50\"}\n />\n </span>\n {name ? (\n <span className=\"truncate text-base font-bold\">{name}</span>\n ) : (\n <AddressDisplay address={address} chars={4} showCopy={false} className=\"text-base font-bold\" />\n )}\n </span>\n );\n}\n\nexport function LeaderboardPanel({\n myAddress,\n limit = 20,\n showHeading = true,\n viewAllHref,\n className,\n}: LeaderboardPanelProps) {\n const { data, isLoading } = useLeaderboard(1, limit);\n const rows = data?.data ?? [];\n\n const highlightAddress = myAddress ? normalizeAddress(\"STARKNET\", myAddress) : null;\n\n return (\n <div className={cn(\"space-y-3\", className)}>\n {showHeading && (\n <div className=\"flex items-center gap-2\">\n <div className=\"flex h-7 w-7 items-center justify-center rounded-lg bg-gradient-to-br from-brand-rose to-brand-orange text-white shrink-0\">\n <Sparkles className=\"h-3.5 w-3.5\" />\n </div>\n <h2 className=\"text-sm font-black\">Community Rewards</h2>\n </div>\n )}\n\n {isLoading ? (\n <div className=\"space-y-1.5\">\n {Array.from({ length: Math.min(limit, 6) }).map((_, i) => (\n <Skeleton key={i} className=\"h-10 w-full rounded-lg\" />\n ))}\n </div>\n ) : rows.length === 0 ? (\n <p className=\"text-sm text-muted-foreground py-4\">\n Nobody&apos;s earned points yet — be the first.\n </p>\n ) : (\n <LeaderboardTable\n entries={rows}\n highlightAddress={highlightAddress}\n renderAddress={(address) => (\n <Link href={profileHref({ address })} className=\"hover:text-foreground transition-colors\">\n <CreatorIdentity address={address} />\n </Link>\n )}\n />\n )}\n\n {viewAllHref && rows.length > 0 && (\n <Link\n href={viewAllHref}\n className=\"inline-flex items-center gap-1 text-xs font-semibold text-muted-foreground hover:text-foreground transition-colors pt-1\"\n >\n View scoreboard →\n </Link>\n )}\n </div>\n );\n}\n"],"mappings":";AAiCI,SAEI,KAFJ;AA/BJ,SAAS,gBAAgB;AACzB,SAAS,kBAAkB,mBAAmB;AAC9C,OAAO,WAAW;AAClB,OAAO,UAAU;AACjB,SAAS,gBAAgB;AACzB,SAAS,sBAAsB;AAC/B,SAAS,wBAAwB;AACjC,SAAS,UAAU;AACnB,SAAS,uBAAuB;AAChC,SAAS,yBAAyB;AAClC,SAAS,mBAAmB;AAC5B,SAAS,sBAAsB;AAU/B,SAAS,gBAAgB,EAAE,QAAQ,GAAwB;AACzD,QAAM,EAAE,QAAQ,IAAI,kBAAkB,OAAO;AAC7C,QAAM,YAAY,YAAY,EAAE,SAAS,aAAa,EAAE,OAAO,GAAG,CAAC;AACnE,QAAM,EAAE,UAAU,KAAK,IAAI,gBAAgB;AAAA,IACzC,UAAU,SAAS;AAAA,IACnB,MAAM,SAAS;AAAA,IACf,eAAe;AAAA,EACjB,CAAC;AAED,SACE,qBAAC,UAAK,WAAU,4CACd;AAAA,wBAAC,UAAK,WAAU,+EACd;AAAA,MAAC;AAAA;AAAA,QACC,KAAK,aAAa;AAAA,QAClB,KAAI;AAAA,QACJ,MAAI;AAAA,QACJ,aAAW;AAAA,QACX,WAAW,YAAY,iBAAiB;AAAA;AAAA,IAC1C,GACF;AAAA,IACC,OACC,oBAAC,UAAK,WAAU,gCAAgC,gBAAK,IAErD,oBAAC,kBAAe,SAAkB,OAAO,GAAG,UAAU,OAAO,WAAU,uBAAsB;AAAA,KAEjG;AAEJ;AAEO,SAAS,iBAAiB;AAAA,EAC/B;AAAA,EACA,QAAQ;AAAA,EACR,cAAc;AAAA,EACd;AAAA,EACA;AACF,GAA0B;AACxB,QAAM,EAAE,MAAM,UAAU,IAAI,eAAe,GAAG,KAAK;AACnD,QAAM,OAAO,MAAM,QAAQ,CAAC;AAE5B,QAAM,mBAAmB,YAAY,iBAAiB,YAAY,SAAS,IAAI;AAE/E,SACE,qBAAC,SAAI,WAAW,GAAG,aAAa,SAAS,GACtC;AAAA,mBACC,qBAAC,SAAI,WAAU,2BACb;AAAA,0BAAC,SAAI,WAAU,6HACb,8BAAC,YAAS,WAAU,eAAc,GACpC;AAAA,MACA,oBAAC,QAAG,WAAU,sBAAqB,+BAAiB;AAAA,OACtD;AAAA,IAGD,YACC,oBAAC,SAAI,WAAU,eACZ,gBAAM,KAAK,EAAE,QAAQ,KAAK,IAAI,OAAO,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,GAAG,MAClD,oBAAC,YAAiB,WAAU,4BAAb,CAAsC,CACtD,GACH,IACE,KAAK,WAAW,IAClB,oBAAC,OAAE,WAAU,sCAAqC,6DAElD,IAEA;AAAA,MAAC;AAAA;AAAA,QACC,SAAS;AAAA,QACT;AAAA,QACA,eAAe,CAAC,YACd,oBAAC,QAAK,MAAM,YAAY,EAAE,QAAQ,CAAC,GAAG,WAAU,2CAC9C,8BAAC,mBAAgB,SAAkB,GACrC;AAAA;AAAA,IAEJ;AAAA,IAGD,eAAe,KAAK,SAAS,KAC5B;AAAA,MAAC;AAAA;AAAA,QACC,MAAM;AAAA,QACN,WAAU;AAAA,QACX;AAAA;AAAA,IAED;AAAA,KAEJ;AAEJ;","names":[]}
@@ -0,0 +1,341 @@
1
+ "use strict";
2
+ "use client";
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __export = (target, all) => {
10
+ for (var name in all)
11
+ __defProp(target, name, { get: all[name], enumerable: true });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from))
16
+ if (!__hasOwnProp.call(to, key) && key !== except)
17
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
+ }
19
+ return to;
20
+ };
21
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
+ // If the importer is in node compatibility mode or this is not an ESM
23
+ // file that has been converted to a CommonJS file using a Babel-
24
+ // compatible transform (i.e. "__esModule" has not been set), then set
25
+ // "default" to the CommonJS "module.exports" for node compatibility.
26
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
+ mod
28
+ ));
29
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
+ var rewards_dashboard_exports = {};
31
+ __export(rewards_dashboard_exports, {
32
+ REWARD_ACTION_LABELS: () => REWARD_ACTION_LABELS,
33
+ RewardsDashboard: () => RewardsDashboard
34
+ });
35
+ module.exports = __toCommonJS(rewards_dashboard_exports);
36
+ var import_jsx_runtime = require("react/jsx-runtime");
37
+ var import_link = __toESM(require("../link.js"), 1);
38
+ var import_button = require("../button.js");
39
+ var import_skeleton = require("../skeleton.js");
40
+ var import_medialane_app = require("../medialane-app.js");
41
+ var import_use_rewards = require("../../utils/use-rewards.js");
42
+ var import_level_badge = require("./level-badge.js");
43
+ var import_level_up_celebration = require("./level-up-celebration.js");
44
+ var import_badge_unlocked = require("./badge-unlocked.js");
45
+ var import_use_rewards_celebrations = require("./use-rewards-celebrations.js");
46
+ var import_leaderboard_panel = require("./leaderboard-panel.js");
47
+ var import_lucide_react = require("lucide-react");
48
+ const REWARD_ACTION_LABELS = {
49
+ complete_profile: "Complete profile",
50
+ mint_asset: "Mint assets",
51
+ create_collection: "Create collections",
52
+ launch_launchpad: "Launch drops / POPs",
53
+ create_remix: "Create remixes",
54
+ list_asset: "List assets",
55
+ buy_asset: "Buy assets",
56
+ make_offer: "Make offers",
57
+ counter_offer: "Counter offers",
58
+ offer_accepted_seller: "Offers accepted (sold)",
59
+ offer_accepted_buyer: "Offers accepted (bought)",
60
+ claim_pop: "POP claims",
61
+ claim_drop: "Drop claims",
62
+ comment: "On-chain comments",
63
+ create_ticket_collection: "Ticketed events created",
64
+ buy_ticket: "Tickets received",
65
+ create_club: "Clubs started",
66
+ join_club: "Clubs joined",
67
+ create_sponsorship_offer: "Sponsorships opened",
68
+ place_sponsorship_bid: "Sponsorship bids",
69
+ sponsorship_licensed_sponsor: "Sponsorships secured (sponsor)",
70
+ sponsorship_licensed_author: "Sponsorships secured (creator)",
71
+ launch_coin: "Creator coins launched"
72
+ };
73
+ const BADGE_ICONS = {
74
+ Flame: import_lucide_react.Flame,
75
+ Package: import_lucide_react.Package,
76
+ CheckCircle2: import_lucide_react.CheckCircle2,
77
+ GitBranch: import_lucide_react.GitBranch,
78
+ TrendingUp: import_lucide_react.TrendingUp,
79
+ Layers: import_lucide_react.Layers,
80
+ Ticket: import_lucide_react.Ticket,
81
+ Crown: import_lucide_react.Crown,
82
+ Coins: import_lucide_react.Coins,
83
+ Star: import_lucide_react.Star,
84
+ Gem: import_lucide_react.Gem,
85
+ Zap: import_lucide_react.Zap,
86
+ Award: import_lucide_react.Award,
87
+ Users: import_lucide_react.Users,
88
+ MessageSquare: import_lucide_react.MessageSquare,
89
+ HandCoins: import_lucide_react.HandCoins,
90
+ Handshake: import_lucide_react.Handshake
91
+ };
92
+ const EARN_GROUPS = [
93
+ {
94
+ title: "Create",
95
+ textClass: "text-brand-purple",
96
+ tileClass: "bg-brand-purple",
97
+ items: [
98
+ { label: "Create a collection", href: "/launchpad/single-editions/collection", Icon: import_lucide_react.Layers },
99
+ { label: "Mint an asset", href: "/launchpad/single-editions", Icon: import_lucide_react.Palette },
100
+ { label: "Launch a drop or POP", href: "/launchpad", Icon: import_lucide_react.Rocket },
101
+ { label: "Launch a creator coin", href: "/launchpad/coin/create", Icon: import_lucide_react.Coins },
102
+ { label: "Remix existing work", href: "/marketplace", Icon: import_lucide_react.GitBranch }
103
+ ]
104
+ },
105
+ {
106
+ title: "Collect",
107
+ textClass: "text-brand-blue",
108
+ tileClass: "bg-brand-blue",
109
+ items: [
110
+ { label: "Collect an asset", href: "/marketplace", Icon: import_lucide_react.ShoppingBag },
111
+ { label: "Make an offer", href: "/marketplace", Icon: import_lucide_react.Handshake },
112
+ { label: "List an asset for sale", href: "/portfolio/assets", Icon: import_lucide_react.Tag },
113
+ { label: "Get an event ticket", href: "/launchpad", Icon: import_lucide_react.Ticket }
114
+ ]
115
+ },
116
+ {
117
+ title: "Connect",
118
+ textClass: "text-brand-rose",
119
+ tileClass: "bg-brand-rose",
120
+ items: [
121
+ { label: "Start or join a club", href: "/launchpad", Icon: import_lucide_react.UserRoundCheck },
122
+ { label: "Open a sponsorship", href: "/launchpad", Icon: import_lucide_react.Handshake },
123
+ { label: "Join the conversation", href: "/marketplace", Icon: import_lucide_react.MessageSquare },
124
+ { label: "Complete your profile", href: "/settings", Icon: import_lucide_react.UserRoundCheck }
125
+ ]
126
+ }
127
+ ];
128
+ function Hero() {
129
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "space-y-5", children: [
130
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("h1", { className: "text-5xl sm:text-6xl font-black tracking-tight leading-[1.02]", children: [
131
+ "Community ",
132
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "bg-gradient-to-r from-brand-rose to-brand-orange bg-clip-text text-transparent", children: "Rewards" })
133
+ ] }),
134
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { className: "text-lg text-foreground/70 max-w-xl leading-relaxed font-medium", children: [
135
+ "Every action earns XP, and active members receive allocations from the Creator's Fund based on how much they participate. Scores and badges are recalculated weekly.",
136
+ " ",
137
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_link.default, { href: "/journey", className: "text-foreground underline underline-offset-2 hover:text-brand-orange transition-colors", children: "See the full system" }),
138
+ "."
139
+ ] })
140
+ ] });
141
+ }
142
+ function SignInButton() {
143
+ const { onRequireWallet, connectLabel } = (0, import_medialane_app.useMedialaneApp)();
144
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_button.Button, { size: "lg", className: "w-full rounded-full px-7", onClick: onRequireWallet, children: connectLabel ?? "Sign in" });
145
+ }
146
+ function StatusPanel({ address }) {
147
+ const { data: rewards, isLoading } = (0, import_use_rewards.useRewards)(address);
148
+ const { data: config } = (0, import_use_rewards.useRewardsConfig)();
149
+ if (!address) {
150
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "shrink-0 rounded-3xl bg-gradient-to-br from-brand-rose/10 via-brand-orange/[0.06] to-transparent p-6 space-y-3 sm:max-w-xs", children: [
151
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm text-foreground/70 font-medium", children: "Sign in to see your score." }),
152
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SignInButton, {})
153
+ ] });
154
+ }
155
+ if (isLoading || !rewards || !config) {
156
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, { className: "h-40 w-full sm:w-80 rounded-3xl shrink-0" });
157
+ }
158
+ const levelXp = config.levels.find((l) => l.level === rewards.currentLevel)?.xpRequired ?? 0;
159
+ const nextLevelXp = rewards.nextLevel?.xpRequired ?? null;
160
+ const hasXp = rewards.totalXp > 0;
161
+ const pct = nextLevelXp ? Math.min(100, Math.round((rewards.totalXp - levelXp) / (nextLevelXp - levelXp) * 100)) : 100;
162
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "shrink-0 rounded-3xl bg-gradient-to-br from-brand-rose/10 via-brand-orange/[0.06] to-transparent p-6 sm:min-w-[300px]", children: [
163
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-6xl font-black tabular-nums leading-none tracking-tight", children: rewards.totalXp.toLocaleString() }),
164
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs font-bold uppercase tracking-widest text-foreground/40 mt-1.5", children: "XP earned" }),
165
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "mt-4 flex items-center gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_level_badge.LevelBadge, { level: rewards.currentLevel, name: rewards.currentLevelName, badgeColor: rewards.badgeColor, size: "md" }) }),
166
+ !hasXp && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm text-foreground/60 font-medium mt-2", children: "Mint, collect, or complete your profile to start." }),
167
+ rewards.nextLevel && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "mt-3 space-y-1.5", children: [
168
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-2 w-full rounded-full bg-foreground/[0.08] overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
169
+ "div",
170
+ {
171
+ className: "h-full rounded-full bg-gradient-to-r from-brand-rose to-brand-orange transition-[width]",
172
+ style: { width: `${pct}%` }
173
+ }
174
+ ) }),
175
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { className: "text-sm font-semibold text-foreground/60", children: [
176
+ (nextLevelXp - rewards.totalXp).toLocaleString(),
177
+ " XP to ",
178
+ rewards.nextLevel.name
179
+ ] })
180
+ ] })
181
+ ] });
182
+ }
183
+ function PersonalPanel({ address }) {
184
+ const { data: rewards } = (0, import_use_rewards.useRewards)(address);
185
+ const { data: events } = (0, import_use_rewards.useRewardsEvents)(address, 1, 6);
186
+ const { data: config } = (0, import_use_rewards.useRewardsConfig)();
187
+ const actionLabel = (type) => config?.actions.find((a) => a.type === type)?.label ?? REWARD_ACTION_LABELS[type] ?? type;
188
+ if (!address || !rewards || Object.keys(rewards.breakdown).length === 0) return null;
189
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "space-y-5", children: [
190
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SectionTitle, { children: "Your breakdown" }),
191
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "divide-y divide-foreground/[0.06]", children: Object.entries(rewards.breakdown).sort(([, a], [, b]) => b - a).map(([action, xp]) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center justify-between py-3.5", children: [
192
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-base font-medium text-foreground/70", children: actionLabel(action) }),
193
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "text-lg font-black tabular-nums", children: [
194
+ "+",
195
+ xp.toLocaleString()
196
+ ] })
197
+ ] }, action)) }),
198
+ events && events.data.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "divide-y divide-foreground/[0.06]", children: events.data.map((e) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center justify-between py-3.5", children: [
199
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-base font-medium text-foreground/70", children: actionLabel(e.actionType) }),
200
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "text-lg font-black tabular-nums text-brand-rose", children: [
201
+ "+",
202
+ e.finalXp
203
+ ] })
204
+ ] }, e.id)) })
205
+ ] });
206
+ }
207
+ function CommunityPanel({ address }) {
208
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "space-y-5", children: [
209
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
210
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SectionTitle, { children: "Community" }),
211
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-base text-foreground/60 mt-1.5 font-medium", children: "Real members already earning XP." })
212
+ ] }),
213
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_leaderboard_panel.LeaderboardPanel, { myAddress: address, showHeading: false, limit: 12 })
214
+ ] });
215
+ }
216
+ function EarnMorePanel() {
217
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "space-y-6", children: [
218
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SectionTitle, { children: "Ways to earn" }),
219
+ EARN_GROUPS.map((group) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-3", children: [
220
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: `text-sm font-black uppercase tracking-wide ${group.textClass}`, children: group.title }),
221
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "grid grid-cols-2 sm:grid-cols-3 gap-3", children: group.items.map(({ label, href, Icon }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
222
+ import_link.default,
223
+ {
224
+ href,
225
+ className: "group flex flex-col gap-3 rounded-2xl bg-foreground/[0.04] hover:bg-foreground/[0.07] p-4 transition-colors",
226
+ children: [
227
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: `flex h-10 w-10 items-center justify-center rounded-xl text-white shrink-0 ${group.tileClass}`, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, { className: "h-5 w-5" }) }),
228
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-sm font-bold leading-snug text-foreground", children: label })
229
+ ]
230
+ },
231
+ href + label
232
+ )) })
233
+ ] }, group.title))
234
+ ] });
235
+ }
236
+ function CreatorsFundCard() {
237
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "relative overflow-hidden rounded-3xl bg-gradient-to-br from-brand-rose to-brand-orange p-8 text-white", children: [
238
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "pointer-events-none absolute -top-16 -right-16 h-56 w-56 rounded-full bg-white/10 blur-3xl" }),
239
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "pointer-events-none absolute -bottom-20 -left-10 h-56 w-56 rounded-full bg-black/10 blur-3xl" }),
240
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "relative space-y-6", children: [
241
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { className: "text-3xl font-black tracking-tight leading-none", children: "Creator's Fund" }),
242
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-base font-medium text-white/90 leading-relaxed max-w-sm", children: "A share of what Medialane earns is set aside in one public wallet and airdropped back to the people creating and trading here, split by XP." }),
243
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex flex-wrap items-center gap-4 pt-2", children: [
244
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
245
+ import_link.default,
246
+ {
247
+ href: "/airdrop",
248
+ className: "inline-flex items-center gap-2 rounded-full bg-white px-6 py-3 text-sm font-black text-brand-rose hover:bg-white/90 transition-colors",
249
+ children: [
250
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Gift, { className: "h-4 w-4" }),
251
+ "How the fund works"
252
+ ]
253
+ }
254
+ ),
255
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
256
+ "a",
257
+ {
258
+ href: "https://medialane.org/creators-fund",
259
+ target: "_blank",
260
+ rel: "noopener noreferrer",
261
+ className: "inline-flex items-center gap-1.5 text-sm font-bold text-white/90 hover:text-white transition-colors",
262
+ children: [
263
+ "Watch the wallet",
264
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ExternalLink, { className: "h-3.5 w-3.5" })
265
+ ]
266
+ }
267
+ )
268
+ ] })
269
+ ] })
270
+ ] });
271
+ }
272
+ function BadgesPanel({ address }) {
273
+ const { data: config, isLoading } = (0, import_use_rewards.useRewardsConfig)();
274
+ const { data: rewards } = (0, import_use_rewards.useRewards)(address);
275
+ if (isLoading) {
276
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "grid grid-cols-3 gap-3", children: Array.from({ length: 6 }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, { className: "h-16 rounded-2xl" }, i)) });
277
+ }
278
+ if (!config) return null;
279
+ const earnedKeys = new Set(rewards?.badges.map((b) => b.key) ?? []);
280
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "space-y-4", children: [
281
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SectionTitle, { children: "Badges to earn" }),
282
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "grid grid-cols-3 gap-3", children: config.badges.map((badge) => {
283
+ const isEarned = earnedKeys.has(badge.key);
284
+ const Icon = BADGE_ICONS[badge.icon] ?? import_lucide_react.Award;
285
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
286
+ "div",
287
+ {
288
+ title: badge.description,
289
+ className: `flex flex-col items-center gap-1.5 rounded-2xl p-3 text-center transition-colors ${isEarned ? "bg-brand-blue text-white" : "bg-foreground/[0.04] text-foreground/40"}`,
290
+ children: [
291
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, { className: "h-5 w-5" }),
292
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-xs font-bold leading-tight", children: badge.name })
293
+ ]
294
+ },
295
+ badge.key
296
+ );
297
+ }) })
298
+ ] });
299
+ }
300
+ function SectionTitle({ children }) {
301
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { className: "text-2xl font-black tracking-tight text-foreground", children });
302
+ }
303
+ function RewardsDashboard() {
304
+ const { walletAddress: address } = (0, import_medialane_app.useMedialaneApp)();
305
+ const { data: rewards } = (0, import_use_rewards.useRewards)(address);
306
+ const { leveledUpTo, newBadgeKeys, dismiss } = (0, import_use_rewards_celebrations.useRewardsCelebrations)(address, rewards ?? null);
307
+ const unlockedBadges = rewards ? newBadgeKeys.map((key) => rewards.badges.find((b) => b.key === key)).filter((b) => b !== void 0) : [];
308
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-14", children: [
309
+ unlockedBadges.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "space-y-3", children: unlockedBadges.map((badge) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_badge_unlocked.BadgeUnlocked, { badge }, badge.key)) }),
310
+ leveledUpTo !== null && rewards && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
311
+ import_level_up_celebration.LevelUpCelebration,
312
+ {
313
+ level: leveledUpTo,
314
+ name: rewards.currentLevelName,
315
+ badgeColor: rewards.badgeColor,
316
+ onDismiss: dismiss
317
+ }
318
+ ),
319
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex flex-col sm:flex-row sm:items-start sm:justify-between gap-8", children: [
320
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Hero, {}),
321
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StatusPanel, { address })
322
+ ] }),
323
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "grid grid-cols-1 lg:grid-cols-12 gap-14 items-start", children: [
324
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "lg:col-span-7 space-y-14", children: [
325
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CommunityPanel, { address }),
326
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PersonalPanel, { address })
327
+ ] }),
328
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "lg:col-span-5 space-y-10", children: [
329
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(EarnMorePanel, {}),
330
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CreatorsFundCard, {}),
331
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BadgesPanel, { address })
332
+ ] })
333
+ ] })
334
+ ] });
335
+ }
336
+ // Annotate the CommonJS export names for ESM import in node:
337
+ 0 && (module.exports = {
338
+ REWARD_ACTION_LABELS,
339
+ RewardsDashboard
340
+ });
341
+ //# sourceMappingURL=rewards-dashboard.cjs.map