@medialane/ui 0.394.0 → 0.396.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 (264) hide show
  1. package/README.md +26 -0
  2. package/dist/components/account/input-otp.d.cts +2 -2
  3. package/dist/components/account/input-otp.d.ts +2 -2
  4. package/dist/components/account-page.cjs +2 -1
  5. package/dist/components/account-page.cjs.map +1 -1
  6. package/dist/components/account-page.js +2 -1
  7. package/dist/components/account-page.js.map +1 -1
  8. package/dist/components/accounts-page.cjs +30 -47
  9. package/dist/components/accounts-page.cjs.map +1 -1
  10. package/dist/components/accounts-page.js +31 -48
  11. package/dist/components/accounts-page.js.map +1 -1
  12. package/dist/components/activities-page.cjs +41 -0
  13. package/dist/components/activities-page.cjs.map +1 -0
  14. package/dist/components/activities-page.d.cts +5 -0
  15. package/dist/components/activities-page.d.ts +5 -0
  16. package/dist/components/activities-page.js +17 -0
  17. package/dist/components/activities-page.js.map +1 -0
  18. package/dist/components/alert.d.cts +1 -1
  19. package/dist/components/alert.d.ts +1 -1
  20. package/dist/components/back-button.cjs +23 -7
  21. package/dist/components/back-button.cjs.map +1 -1
  22. package/dist/components/back-button.d.cts +6 -3
  23. package/dist/components/back-button.d.ts +6 -3
  24. package/dist/components/back-button.js +14 -8
  25. package/dist/components/back-button.js.map +1 -1
  26. package/dist/components/badge.d.cts +1 -1
  27. package/dist/components/badge.d.ts +1 -1
  28. package/dist/components/button.d.cts +2 -2
  29. package/dist/components/button.d.ts +2 -2
  30. package/dist/components/coins-explorer.cjs +18 -17
  31. package/dist/components/coins-explorer.cjs.map +1 -1
  32. package/dist/components/coins-explorer.d.cts +2 -1
  33. package/dist/components/coins-explorer.d.ts +2 -1
  34. package/dist/components/coins-explorer.js +16 -16
  35. package/dist/components/coins-explorer.js.map +1 -1
  36. package/dist/components/collection-settings.cjs +19 -15
  37. package/dist/components/collection-settings.cjs.map +1 -1
  38. package/dist/components/collection-settings.js +19 -15
  39. package/dist/components/collection-settings.js.map +1 -1
  40. package/dist/components/collections-page.cjs +12 -16
  41. package/dist/components/collections-page.cjs.map +1 -1
  42. package/dist/components/collections-page.js +12 -16
  43. package/dist/components/collections-page.js.map +1 -1
  44. package/dist/components/comments-section.cjs +1 -1
  45. package/dist/components/comments-section.cjs.map +1 -1
  46. package/dist/components/comments-section.js +1 -1
  47. package/dist/components/comments-section.js.map +1 -1
  48. package/dist/components/create-form-primitives.cjs +3 -2
  49. package/dist/components/create-form-primitives.cjs.map +1 -1
  50. package/dist/components/create-form-primitives.d.cts +2 -1
  51. package/dist/components/create-form-primitives.d.ts +2 -1
  52. package/dist/components/create-form-primitives.js +3 -2
  53. package/dist/components/create-form-primitives.js.map +1 -1
  54. package/dist/components/creator-page.cjs +15 -11
  55. package/dist/components/creator-page.cjs.map +1 -1
  56. package/dist/components/creator-page.js +16 -12
  57. package/dist/components/creator-page.js.map +1 -1
  58. package/dist/components/discover-hero.cjs +8 -45
  59. package/dist/components/discover-hero.cjs.map +1 -1
  60. package/dist/components/discover-hero.d.cts +1 -2
  61. package/dist/components/discover-hero.d.ts +1 -2
  62. package/dist/components/discover-hero.js +8 -45
  63. package/dist/components/discover-hero.js.map +1 -1
  64. package/dist/components/discover-page.cjs +2 -3
  65. package/dist/components/discover-page.cjs.map +1 -1
  66. package/dist/components/discover-page.d.cts +1 -2
  67. package/dist/components/discover-page.d.ts +1 -2
  68. package/dist/components/discover-page.js +2 -3
  69. package/dist/components/discover-page.js.map +1 -1
  70. package/dist/components/drop/drop-detail-page.cjs +37 -0
  71. package/dist/components/drop/drop-detail-page.cjs.map +1 -0
  72. package/dist/components/drop/drop-detail-page.d.cts +7 -0
  73. package/dist/components/drop/drop-detail-page.d.ts +7 -0
  74. package/dist/components/drop/drop-detail-page.js +13 -0
  75. package/dist/components/drop/drop-detail-page.js.map +1 -0
  76. package/dist/components/drop/my-drops-page.cjs +41 -0
  77. package/dist/components/drop/my-drops-page.cjs.map +1 -0
  78. package/dist/components/drop/my-drops-page.d.cts +5 -0
  79. package/dist/components/drop/my-drops-page.d.ts +5 -0
  80. package/dist/components/drop/my-drops-page.js +17 -0
  81. package/dist/components/drop/my-drops-page.js.map +1 -0
  82. package/dist/components/drops-page.cjs +14 -16
  83. package/dist/components/drops-page.cjs.map +1 -1
  84. package/dist/components/drops-page.js +14 -16
  85. package/dist/components/drops-page.js.map +1 -1
  86. package/dist/components/editions-page.cjs +24 -26
  87. package/dist/components/editions-page.cjs.map +1 -1
  88. package/dist/components/editions-page.js +24 -26
  89. package/dist/components/editions-page.js.map +1 -1
  90. package/dist/components/ip-type-page.cjs +117 -117
  91. package/dist/components/ip-type-page.cjs.map +1 -1
  92. package/dist/components/ip-type-page.js +118 -118
  93. package/dist/components/ip-type-page.js.map +1 -1
  94. package/dist/components/journey-content.cjs +16 -25
  95. package/dist/components/journey-content.cjs.map +1 -1
  96. package/dist/components/journey-content.js +18 -27
  97. package/dist/components/journey-content.js.map +1 -1
  98. package/dist/components/launchpad/coin-create.cjs +1 -1
  99. package/dist/components/launchpad/coin-create.cjs.map +1 -1
  100. package/dist/components/launchpad/coin-create.js +1 -1
  101. package/dist/components/launchpad/coin-create.js.map +1 -1
  102. package/dist/components/launchpad/edition-mint-schema.d.cts +2 -2
  103. package/dist/components/launchpad/edition-mint-schema.d.ts +2 -2
  104. package/dist/components/launchpad/edition-mint.cjs +3 -7
  105. package/dist/components/launchpad/edition-mint.cjs.map +1 -1
  106. package/dist/components/launchpad/edition-mint.js +3 -7
  107. package/dist/components/launchpad/edition-mint.js.map +1 -1
  108. package/dist/components/launchpad/pop-create.cjs +1 -1
  109. package/dist/components/launchpad/pop-create.cjs.map +1 -1
  110. package/dist/components/launchpad/pop-create.js +1 -1
  111. package/dist/components/launchpad/pop-create.js.map +1 -1
  112. package/dist/components/launchpad/remix-mint.cjs +18 -20
  113. package/dist/components/launchpad/remix-mint.cjs.map +1 -1
  114. package/dist/components/launchpad/remix-mint.js +19 -21
  115. package/dist/components/launchpad/remix-mint.js.map +1 -1
  116. package/dist/components/launchpad/single-edition-mint.cjs +1 -1
  117. package/dist/components/launchpad/single-edition-mint.cjs.map +1 -1
  118. package/dist/components/launchpad/single-edition-mint.js +1 -1
  119. package/dist/components/launchpad/single-edition-mint.js.map +1 -1
  120. package/dist/components/launchpad/sponsorship-create.cjs +2 -2
  121. package/dist/components/launchpad/sponsorship-create.cjs.map +1 -1
  122. package/dist/components/launchpad/sponsorship-create.js +2 -2
  123. package/dist/components/launchpad/sponsorship-create.js.map +1 -1
  124. package/dist/components/launchpad/tier-mint-form.cjs +7 -12
  125. package/dist/components/launchpad/tier-mint-form.cjs.map +1 -1
  126. package/dist/components/launchpad/tier-mint-form.js +7 -12
  127. package/dist/components/launchpad/tier-mint-form.js.map +1 -1
  128. package/dist/components/launchpad-page.cjs +8 -7
  129. package/dist/components/launchpad-page.cjs.map +1 -1
  130. package/dist/components/launchpad-page.js +8 -7
  131. package/dist/components/launchpad-page.js.map +1 -1
  132. package/dist/components/launchpad-services.cjs +2 -4
  133. package/dist/components/launchpad-services.cjs.map +1 -1
  134. package/dist/components/launchpad-services.js +2 -4
  135. package/dist/components/launchpad-services.js.map +1 -1
  136. package/dist/components/license-request-page.cjs +25 -27
  137. package/dist/components/license-request-page.cjs.map +1 -1
  138. package/dist/components/license-request-page.js +27 -29
  139. package/dist/components/license-request-page.js.map +1 -1
  140. package/dist/components/page-container.cjs +3 -2
  141. package/dist/components/page-container.cjs.map +1 -1
  142. package/dist/components/page-container.d.cts +1 -1
  143. package/dist/components/page-container.d.ts +1 -1
  144. package/dist/components/page-container.js +3 -2
  145. package/dist/components/page-container.js.map +1 -1
  146. package/dist/components/page-header.cjs +56 -0
  147. package/dist/components/page-header.cjs.map +1 -0
  148. package/dist/components/page-header.d.cts +19 -0
  149. package/dist/components/page-header.d.ts +19 -0
  150. package/dist/components/page-header.js +31 -0
  151. package/dist/components/page-header.js.map +1 -0
  152. package/dist/components/page-skeletons.cjs +11 -40
  153. package/dist/components/page-skeletons.cjs.map +1 -1
  154. package/dist/components/page-skeletons.js +11 -40
  155. package/dist/components/page-skeletons.js.map +1 -1
  156. package/dist/components/page-state.cjs +50 -0
  157. package/dist/components/page-state.cjs.map +1 -0
  158. package/dist/components/page-state.d.cts +18 -0
  159. package/dist/components/page-state.d.ts +18 -0
  160. package/dist/components/page-state.js +25 -0
  161. package/dist/components/page-state.js.map +1 -0
  162. package/dist/components/pop-claim-button.cjs +1 -1
  163. package/dist/components/pop-claim-button.cjs.map +1 -1
  164. package/dist/components/pop-claim-button.js +1 -1
  165. package/dist/components/pop-claim-button.js.map +1 -1
  166. package/dist/components/pop-manage-page.cjs +64 -81
  167. package/dist/components/pop-manage-page.cjs.map +1 -1
  168. package/dist/components/pop-manage-page.js +65 -82
  169. package/dist/components/pop-manage-page.js.map +1 -1
  170. package/dist/components/pop-my-events-page.cjs +18 -17
  171. package/dist/components/pop-my-events-page.cjs.map +1 -1
  172. package/dist/components/pop-my-events-page.js +18 -17
  173. package/dist/components/pop-my-events-page.js.map +1 -1
  174. package/dist/components/pop-page.cjs +177 -0
  175. package/dist/components/pop-page.cjs.map +1 -0
  176. package/dist/components/pop-page.d.cts +5 -0
  177. package/dist/components/pop-page.d.ts +5 -0
  178. package/dist/components/pop-page.js +143 -0
  179. package/dist/components/pop-page.js.map +1 -0
  180. package/dist/components/portfolio-collections.cjs +8 -11
  181. package/dist/components/portfolio-collections.cjs.map +1 -1
  182. package/dist/components/portfolio-collections.js +8 -11
  183. package/dist/components/portfolio-collections.js.map +1 -1
  184. package/dist/components/portfolio-header.cjs +13 -16
  185. package/dist/components/portfolio-header.cjs.map +1 -1
  186. package/dist/components/portfolio-header.js +13 -16
  187. package/dist/components/portfolio-header.js.map +1 -1
  188. package/dist/components/portfolio-shell.cjs +5 -13
  189. package/dist/components/portfolio-shell.cjs.map +1 -1
  190. package/dist/components/portfolio-shell.js +5 -13
  191. package/dist/components/portfolio-shell.js.map +1 -1
  192. package/dist/components/portfolio-sponsorships.cjs +6 -8
  193. package/dist/components/portfolio-sponsorships.cjs.map +1 -1
  194. package/dist/components/portfolio-sponsorships.js +6 -8
  195. package/dist/components/portfolio-sponsorships.js.map +1 -1
  196. package/dist/components/remix-browse-page.cjs +13 -15
  197. package/dist/components/remix-browse-page.cjs.map +1 -1
  198. package/dist/components/remix-browse-page.js +13 -15
  199. package/dist/components/remix-browse-page.js.map +1 -1
  200. package/dist/components/rewards/rewards-dashboard.cjs +20 -30
  201. package/dist/components/rewards/rewards-dashboard.cjs.map +1 -1
  202. package/dist/components/rewards/rewards-dashboard.js +21 -31
  203. package/dist/components/rewards/rewards-dashboard.js.map +1 -1
  204. package/dist/components/rewards-page.cjs +1 -1
  205. package/dist/components/rewards-page.cjs.map +1 -1
  206. package/dist/components/rewards-page.js +1 -1
  207. package/dist/components/rewards-page.js.map +1 -1
  208. package/dist/components/search-page.cjs +5 -12
  209. package/dist/components/search-page.cjs.map +1 -1
  210. package/dist/components/search-page.js +5 -12
  211. package/dist/components/search-page.js.map +1 -1
  212. package/dist/components/section-heading.cjs +6 -6
  213. package/dist/components/section-heading.cjs.map +1 -1
  214. package/dist/components/section-heading.d.cts +7 -4
  215. package/dist/components/section-heading.d.ts +7 -4
  216. package/dist/components/section-heading.js +6 -6
  217. package/dist/components/section-heading.js.map +1 -1
  218. package/dist/components/service-collections-page.cjs +9 -17
  219. package/dist/components/service-collections-page.cjs.map +1 -1
  220. package/dist/components/service-collections-page.d.cts +0 -4
  221. package/dist/components/service-collections-page.d.ts +0 -4
  222. package/dist/components/service-collections-page.js +10 -18
  223. package/dist/components/service-collections-page.js.map +1 -1
  224. package/dist/components/service-form-shell.cjs +12 -15
  225. package/dist/components/service-form-shell.cjs.map +1 -1
  226. package/dist/components/service-form-shell.js +12 -15
  227. package/dist/components/service-form-shell.js.map +1 -1
  228. package/dist/components/sponsorship-offer-page.cjs +16 -7
  229. package/dist/components/sponsorship-offer-page.cjs.map +1 -1
  230. package/dist/components/sponsorship-offer-page.js +16 -7
  231. package/dist/components/sponsorship-offer-page.js.map +1 -1
  232. package/dist/components/sponsorship-offers-page.cjs +17 -21
  233. package/dist/components/sponsorship-offers-page.cjs.map +1 -1
  234. package/dist/components/sponsorship-offers-page.js +17 -21
  235. package/dist/components/sponsorship-offers-page.js.map +1 -1
  236. package/dist/components/transaction-dialog.cjs +2 -2
  237. package/dist/components/transaction-dialog.cjs.map +1 -1
  238. package/dist/components/transaction-dialog.js +2 -2
  239. package/dist/components/transaction-dialog.js.map +1 -1
  240. package/dist/components/transfer-collection-ownership.cjs +1 -1
  241. package/dist/components/transfer-collection-ownership.cjs.map +1 -1
  242. package/dist/components/transfer-collection-ownership.js +1 -1
  243. package/dist/components/transfer-collection-ownership.js.map +1 -1
  244. package/dist/components/wallet-required.cjs +4 -14
  245. package/dist/components/wallet-required.cjs.map +1 -1
  246. package/dist/components/wallet-required.js +5 -15
  247. package/dist/components/wallet-required.js.map +1 -1
  248. package/dist/i18n/catalog/pt.cjs +35 -8
  249. package/dist/i18n/catalog/pt.cjs.map +1 -1
  250. package/dist/i18n/catalog/pt.js +35 -8
  251. package/dist/i18n/catalog/pt.js.map +1 -1
  252. package/dist/index.cjs +27 -3
  253. package/dist/index.cjs.map +1 -1
  254. package/dist/index.d.cts +9 -3
  255. package/dist/index.d.ts +9 -3
  256. package/dist/index.js +19 -3
  257. package/dist/index.js.map +1 -1
  258. package/package.json +1 -1
  259. package/dist/components/service-header.cjs +0 -47
  260. package/dist/components/service-header.cjs.map +0 -1
  261. package/dist/components/service-header.d.cts +0 -15
  262. package/dist/components/service-header.d.ts +0 -15
  263. package/dist/components/service-header.js +0 -23
  264. package/dist/components/service-header.js.map +0 -1
@@ -33,13 +33,15 @@ __export(sponsorship_offers_page_exports, {
33
33
  });
34
34
  module.exports = __toCommonJS(sponsorship_offers_page_exports);
35
35
  var import_jsx_runtime = require("react/jsx-runtime");
36
+ var import_section_heading = require("./section-heading.js");
36
37
  var import_lucide_react = require("lucide-react");
37
38
  var import_sdk = require("@medialane/sdk");
38
39
  var import_asset_card = require("./asset-card.js");
39
40
  var import_back_button = require("./back-button.js");
40
41
  var import_link = __toESM(require("./link.js"), 1);
41
42
  var import_motion_primitives = require("./motion-primitives.js");
42
- var import_service_header = require("./service-header.js");
43
+ var import_page_container = require("./page-container.js");
44
+ var import_page_header = require("./page-header.js");
43
45
  var import_address = require("../utils/address.js");
44
46
  var import_use_sponsorship = require("../utils/use-sponsorship.js");
45
47
  var import_use_tokens = require("../utils/use-tokens.js");
@@ -74,24 +76,21 @@ function SponsorshipOffersPage() {
74
76
  const t = (0, import_provider.useT)();
75
77
  const { offers, isLoading } = (0, import_use_sponsorship.useSponsorshipOffers)();
76
78
  const openOffers = offers.filter((o) => o.open);
77
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "pb-16 space-y-10", children: [
78
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "px-4 pt-10 max-w-5xl mx-auto", children: [
79
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_back_button.BackButton, {}),
80
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_motion_primitives.FadeIn, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "mt-6", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
81
- import_service_header.ServiceHeader,
82
- {
83
- plain: true,
84
- icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Handshake, { className: "h-4 w-4 text-white" }),
85
- title: t("IP Sponsorship"),
86
- subtitle: t("Sponsors bid for a license.")
87
- }
88
- ) }) })
89
- ] }),
90
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("section", { className: "px-4 max-w-5xl mx-auto", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_motion_primitives.FadeIn, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex flex-wrap gap-2", children: FEATURES.map((f) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-xs font-medium text-muted-foreground bg-background/40", children: [
79
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_page_container.PageContainer, { variant: "narrow", className: "space-y-8", children: [
80
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
81
+ import_page_header.PageHeader,
82
+ {
83
+ back: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_back_button.BackButton, {}),
84
+ icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Handshake, {}),
85
+ title: t("IP Sponsorship"),
86
+ subtitle: t("Sponsors bid for a license.")
87
+ }
88
+ ),
89
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("section", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_motion_primitives.FadeIn, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex flex-wrap gap-2", children: FEATURES.map((f) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-xs font-medium text-muted-foreground bg-background/40", children: [
91
90
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Check, { className: "h-3 w-3 text-brand-rose shrink-0" }),
92
91
  t(f)
93
92
  ] }, f)) }) }) }),
94
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("section", { className: "px-4 max-w-5xl mx-auto", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_motion_primitives.FadeIn, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "panel p-5 flex flex-col sm:flex-row gap-4 items-start sm:items-center justify-between", style: (0, import_panel.panelTint)("rose"), children: [
93
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("section", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_motion_primitives.FadeIn, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "panel p-5 flex flex-col sm:flex-row gap-4 items-start sm:items-center justify-between", style: (0, import_panel.panelTint)("rose"), children: [
95
94
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-0.5", children: [
96
95
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm font-semibold", children: t("Start a sponsorship deal") }),
97
96
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs text-muted-foreground", children: t("Open an asset to sponsors.") })
@@ -101,11 +100,8 @@ function SponsorshipOffersPage() {
101
100
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ArrowRight, { className: "h-3.5 w-3.5" })
102
101
  ] }) })
103
102
  ] }) }) }),
104
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "px-4 space-y-4 max-w-5xl mx-auto", children: [
105
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_motion_primitives.FadeIn, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
106
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "section-label", children: t("Open") }),
107
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { className: "text-xl font-bold mt-0.5", children: t("Sponsorship offers") })
108
- ] }) }),
103
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "space-y-4", children: [
104
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_motion_primitives.FadeIn, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_section_heading.SectionHeading, { title: t("Sponsorship offers") }) }),
109
105
  isLoading ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-4", children: Array.from({ length: 8 }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_asset_card.AssetCardSkeleton, {}, i)) }) : openOffers.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_motion_primitives.FadeIn, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "panel relative overflow-hidden p-12 text-center space-y-4", children: [
110
106
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icon_tile.IconTile, { size: "lg", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Handshake, {}) }) }),
111
107
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-1", children: [
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/sponsorship-offers-page.tsx"],"sourcesContent":["\"use client\";\n\nimport { ArrowRight, Check, Handshake } from \"lucide-react\";\nimport { formatAmount, getTokenByAddress, type ApiSponsorshipOffer } from \"@medialane/sdk\";\nimport { AssetCard, AssetCardSkeleton } from \"./asset-card.js\";\nimport { BackButton } from \"./back-button.js\";\nimport Link from \"./link.js\";\nimport { FadeIn, Stagger, StaggerItem } from \"./motion-primitives.js\";\nimport { ServiceHeader } from \"./service-header.js\";\nimport { shortenAddress } from \"../utils/address.js\";\nimport { useSponsorshipOffers } from \"../utils/use-sponsorship.js\";\nimport { useToken } from \"../utils/use-tokens.js\";\nimport { useT } from \"../i18n/provider.js\";\n\nimport { msg } from \"../i18n/translate.js\";\nimport { ActionButton } from \"./action-button.js\";\nimport { panelTint } from \"./panel.js\";\nimport { IconTile } from \"./icon-tile.js\";\nconst FEATURES = [\n msg(\"Direct settlement\"),\n msg(\"Owner-verified on-chain\"),\n msg(\"Open bidding or one invited sponsor\"),\n];\n\nfunction OfferCard({ offer }: { offer: ApiSponsorshipOffer }) {\n const { token } = useToken(offer.nftContract, offer.tokenId);\n const paymentToken = getTokenByAddress(offer.paymentToken);\n const min = paymentToken ? `Min ${formatAmount(offer.minAmount, paymentToken.decimals)} ${paymentToken.symbol}` : `Min ${offer.minAmount}`;\n const days = Math.round(Number(offer.duration) / 86400);\n\n return (\n <AssetCard\n href={`/launchpad/sponsorship/${offer.offerId}`}\n name={token?.metadata?.name ?? `Token #${offer.tokenId}`}\n image={token?.metadata?.image ?? null}\n subtitle={shortenAddress(offer.nftContract)}\n fallbackId={offer.tokenId}\n price={{ formatted: `${min} · ${days}d`, currency: null }}\n />\n );\n}\n\nexport function SponsorshipOffersPage() {\n const t = useT();\n const { offers, isLoading } = useSponsorshipOffers();\n const openOffers = offers.filter((o) => o.open);\n\n return (\n <div className=\"pb-16 space-y-10\">\n <section className=\"px-4 pt-10 max-w-5xl mx-auto\">\n <BackButton />\n <FadeIn>\n <div className=\"mt-6\">\n <ServiceHeader\n plain\n icon={<Handshake className=\"h-4 w-4 text-white\" />}\n title={t(\"IP Sponsorship\")}\n subtitle={t(\"Sponsors bid for a license.\")}\n />\n </div>\n </FadeIn>\n </section>\n\n <section className=\"px-4 max-w-5xl mx-auto\">\n <FadeIn>\n <div className=\"flex flex-wrap gap-2\">\n {FEATURES.map((f) => (\n <span key={f} className=\"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-xs font-medium text-muted-foreground bg-background/40\">\n <Check className=\"h-3 w-3 text-brand-rose shrink-0\" />\n {t(f)}\n </span>\n ))}\n </div>\n </FadeIn>\n </section>\n\n <section className=\"px-4 max-w-5xl mx-auto\">\n <FadeIn>\n <div className=\"panel p-5 flex flex-col sm:flex-row gap-4 items-start sm:items-center justify-between\" style={panelTint(\"rose\")}>\n <div className=\"space-y-0.5\">\n <p className=\"text-sm font-semibold\">{t(\"Start a sponsorship deal\")}</p>\n <p className=\"text-xs text-muted-foreground\">\n {t(\"Open an asset to sponsors.\")}\n </p>\n </div>\n <ActionButton solid small asChild className=\"shrink-0\">\n <Link href=\"/launchpad/sponsorship/create\">\n {t(\"Get started\")}\n <ArrowRight className=\"h-3.5 w-3.5\" />\n </Link>\n </ActionButton>\n </div>\n </FadeIn>\n </section>\n\n <section className=\"px-4 space-y-4 max-w-5xl mx-auto\">\n <FadeIn>\n <div>\n <p className=\"section-label\">{t(\"Open\")}</p>\n <h2 className=\"text-xl font-bold mt-0.5\">{t(\"Sponsorship offers\")}</h2>\n </div>\n </FadeIn>\n\n {isLoading ? (\n <div className=\"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-4\">\n {Array.from({ length: 8 }).map((_, i) => <AssetCardSkeleton key={i} />)}\n </div>\n ) : openOffers.length === 0 ? (\n <FadeIn>\n <div className=\"panel relative overflow-hidden p-12 text-center space-y-4\">\n <div className=\"flex justify-center\">\n <IconTile size=\"lg\">\n <Handshake />\n </IconTile>\n </div>\n <div className=\"space-y-1\">\n <p className=\"font-semibold text-sm\">{t(\"No open sponsorship offers yet\")}</p>\n <p className=\"text-xs text-muted-foreground\">{t(\"Sponsors bid on open offers here.\")}</p>\n </div>\n </div>\n </FadeIn>\n ) : (\n <Stagger className=\"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-4\">\n {openOffers.map((offer) => (\n <StaggerItem key={offer.id}>\n <OfferCard offer={offer} />\n </StaggerItem>\n ))}\n </Stagger>\n )}\n </section>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA+BI;AA7BJ,0BAA6C;AAC7C,iBAA0E;AAC1E,wBAA6C;AAC7C,yBAA2B;AAC3B,kBAAiB;AACjB,+BAA6C;AAC7C,4BAA8B;AAC9B,qBAA+B;AAC/B,6BAAqC;AACrC,wBAAyB;AACzB,sBAAqB;AAErB,uBAAoB;AACpB,2BAA6B;AAC7B,mBAA0B;AAC1B,uBAAyB;AACzB,MAAM,WAAW;AAAA,MACf,sBAAI,mBAAmB;AAAA,MACvB,sBAAI,yBAAyB;AAAA,MAC7B,sBAAI,qCAAqC;AAC3C;AAEA,SAAS,UAAU,EAAE,MAAM,GAAmC;AAC5D,QAAM,EAAE,MAAM,QAAI,4BAAS,MAAM,aAAa,MAAM,OAAO;AAC3D,QAAM,mBAAe,8BAAkB,MAAM,YAAY;AACzD,QAAM,MAAM,eAAe,WA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version":3,"sources":["../../src/components/sponsorship-offers-page.tsx"],"sourcesContent":["\"use client\";\n\nimport { SectionHeading } from \"./section-heading.js\";\nimport { ArrowRight, Check, Handshake } from \"lucide-react\";\nimport { formatAmount, getTokenByAddress, type ApiSponsorshipOffer } from \"@medialane/sdk\";\nimport { AssetCard, AssetCardSkeleton } from \"./asset-card.js\";\nimport { BackButton } from \"./back-button.js\";\nimport Link from \"./link.js\";\nimport { FadeIn, Stagger, StaggerItem } from \"./motion-primitives.js\";\nimport { PageContainer } from \"./page-container.js\";\nimport { PageHeader } from \"./page-header.js\";\nimport { shortenAddress } from \"../utils/address.js\";\nimport { useSponsorshipOffers } from \"../utils/use-sponsorship.js\";\nimport { useToken } from \"../utils/use-tokens.js\";\nimport { useT } from \"../i18n/provider.js\";\n\nimport { msg } from \"../i18n/translate.js\";\nimport { ActionButton } from \"./action-button.js\";\nimport { panelTint } from \"./panel.js\";\nimport { IconTile } from \"./icon-tile.js\";\nconst FEATURES = [\n msg(\"Direct settlement\"),\n msg(\"Owner-verified on-chain\"),\n msg(\"Open bidding or one invited sponsor\"),\n];\n\nfunction OfferCard({ offer }: { offer: ApiSponsorshipOffer }) {\n const { token } = useToken(offer.nftContract, offer.tokenId);\n const paymentToken = getTokenByAddress(offer.paymentToken);\n const min = paymentToken ? `Min ${formatAmount(offer.minAmount, paymentToken.decimals)} ${paymentToken.symbol}` : `Min ${offer.minAmount}`;\n const days = Math.round(Number(offer.duration) / 86400);\n\n return (\n <AssetCard\n href={`/launchpad/sponsorship/${offer.offerId}`}\n name={token?.metadata?.name ?? `Token #${offer.tokenId}`}\n image={token?.metadata?.image ?? null}\n subtitle={shortenAddress(offer.nftContract)}\n fallbackId={offer.tokenId}\n price={{ formatted: `${min} · ${days}d`, currency: null }}\n />\n );\n}\n\nexport function SponsorshipOffersPage() {\n const t = useT();\n const { offers, isLoading } = useSponsorshipOffers();\n const openOffers = offers.filter((o) => o.open);\n\n return (\n <PageContainer variant=\"narrow\" className=\"space-y-8\">\n <PageHeader\n back={<BackButton />}\n icon={<Handshake />}\n title={t(\"IP Sponsorship\")}\n subtitle={t(\"Sponsors bid for a license.\")}\n />\n\n <section>\n <FadeIn>\n <div className=\"flex flex-wrap gap-2\">\n {FEATURES.map((f) => (\n <span key={f} className=\"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-xs font-medium text-muted-foreground bg-background/40\">\n <Check className=\"h-3 w-3 text-brand-rose shrink-0\" />\n {t(f)}\n </span>\n ))}\n </div>\n </FadeIn>\n </section>\n\n <section>\n <FadeIn>\n <div className=\"panel p-5 flex flex-col sm:flex-row gap-4 items-start sm:items-center justify-between\" style={panelTint(\"rose\")}>\n <div className=\"space-y-0.5\">\n <p className=\"text-sm font-semibold\">{t(\"Start a sponsorship deal\")}</p>\n <p className=\"text-xs text-muted-foreground\">\n {t(\"Open an asset to sponsors.\")}\n </p>\n </div>\n <ActionButton solid small asChild className=\"shrink-0\">\n <Link href=\"/launchpad/sponsorship/create\">\n {t(\"Get started\")}\n <ArrowRight className=\"h-3.5 w-3.5\" />\n </Link>\n </ActionButton>\n </div>\n </FadeIn>\n </section>\n\n <section className=\"space-y-4\">\n <FadeIn>\n <SectionHeading title={t(\"Sponsorship offers\")} />\n </FadeIn>\n\n {isLoading ? (\n <div className=\"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-4\">\n {Array.from({ length: 8 }).map((_, i) => <AssetCardSkeleton key={i} />)}\n </div>\n ) : openOffers.length === 0 ? (\n <FadeIn>\n <div className=\"panel relative overflow-hidden p-12 text-center space-y-4\">\n <div className=\"flex justify-center\">\n <IconTile size=\"lg\">\n <Handshake />\n </IconTile>\n </div>\n <div className=\"space-y-1\">\n <p className=\"font-semibold text-sm\">{t(\"No open sponsorship offers yet\")}</p>\n <p className=\"text-xs text-muted-foreground\">{t(\"Sponsors bid on open offers here.\")}</p>\n </div>\n </div>\n </FadeIn>\n ) : (\n <Stagger className=\"grid grid-cols-2 sm:grid-cols-3 lg:grid-c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,yCAAuB,CAAG,CAAE,GACxE,IACE,WAAW,WAAW,IACxB,4CAAC,mCACC,uDAAC,SAAI,WAAU,6DACb;AAAA,oDAAC,SAAI,WAAU,uBACb,sDAAC,6BAAS,MAAK,MACb,sDAAC,iCAAU,GACb,GACF;AAAA,QACA,6CAAC,SAAI,WAAU,aACb;AAAA,sDAAC,OAAE,WAAU,yBAAyB,YAAE,gCAAgC,GAAE;AAAA,UAC1E,4CAAC,OAAE,WAAU,iCAAiC,YAAE,mCAAmC,GAAE;AAAA,WACvF;AAAA,SACF,GACF,IAEA,4CAAC,oCAAQ,WAAU,wDAChB,qBAAW,IAAI,CAAC,UACf,4CAAC,wCACC,sDAAC,aAAU,OAAc,KADT,MAAM,EAExB,CACD,GACH;AAAA,OAEJ;AAAA,KACF;AAEJ;","names":["Link"]}
@@ -1,12 +1,14 @@
1
1
  "use client";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { SectionHeading } from "./section-heading.js";
3
4
  import { ArrowRight, Check, Handshake } from "lucide-react";
4
5
  import { formatAmount, getTokenByAddress } from "@medialane/sdk";
5
6
  import { AssetCard, AssetCardSkeleton } from "./asset-card.js";
6
7
  import { BackButton } from "./back-button.js";
7
8
  import Link from "./link.js";
8
9
  import { FadeIn, Stagger, StaggerItem } from "./motion-primitives.js";
9
- import { ServiceHeader } from "./service-header.js";
10
+ import { PageContainer } from "./page-container.js";
11
+ import { PageHeader } from "./page-header.js";
10
12
  import { shortenAddress } from "../utils/address.js";
11
13
  import { useSponsorshipOffers } from "../utils/use-sponsorship.js";
12
14
  import { useToken } from "../utils/use-tokens.js";
@@ -41,24 +43,21 @@ function SponsorshipOffersPage() {
41
43
  const t = useT();
42
44
  const { offers, isLoading } = useSponsorshipOffers();
43
45
  const openOffers = offers.filter((o) => o.open);
44
- return /* @__PURE__ */ jsxs("div", { className: "pb-16 space-y-10", children: [
45
- /* @__PURE__ */ jsxs("section", { className: "px-4 pt-10 max-w-5xl mx-auto", children: [
46
- /* @__PURE__ */ jsx(BackButton, {}),
47
- /* @__PURE__ */ jsx(FadeIn, { children: /* @__PURE__ */ jsx("div", { className: "mt-6", children: /* @__PURE__ */ jsx(
48
- ServiceHeader,
49
- {
50
- plain: true,
51
- icon: /* @__PURE__ */ jsx(Handshake, { className: "h-4 w-4 text-white" }),
52
- title: t("IP Sponsorship"),
53
- subtitle: t("Sponsors bid for a license.")
54
- }
55
- ) }) })
56
- ] }),
57
- /* @__PURE__ */ jsx("section", { className: "px-4 max-w-5xl mx-auto", children: /* @__PURE__ */ jsx(FadeIn, { children: /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2", children: FEATURES.map((f) => /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-xs font-medium text-muted-foreground bg-background/40", children: [
46
+ return /* @__PURE__ */ jsxs(PageContainer, { variant: "narrow", className: "space-y-8", children: [
47
+ /* @__PURE__ */ jsx(
48
+ PageHeader,
49
+ {
50
+ back: /* @__PURE__ */ jsx(BackButton, {}),
51
+ icon: /* @__PURE__ */ jsx(Handshake, {}),
52
+ title: t("IP Sponsorship"),
53
+ subtitle: t("Sponsors bid for a license.")
54
+ }
55
+ ),
56
+ /* @__PURE__ */ jsx("section", { children: /* @__PURE__ */ jsx(FadeIn, { children: /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2", children: FEATURES.map((f) => /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-xs font-medium text-muted-foreground bg-background/40", children: [
58
57
  /* @__PURE__ */ jsx(Check, { className: "h-3 w-3 text-brand-rose shrink-0" }),
59
58
  t(f)
60
59
  ] }, f)) }) }) }),
61
- /* @__PURE__ */ jsx("section", { className: "px-4 max-w-5xl mx-auto", children: /* @__PURE__ */ jsx(FadeIn, { children: /* @__PURE__ */ jsxs("div", { className: "panel p-5 flex flex-col sm:flex-row gap-4 items-start sm:items-center justify-between", style: panelTint("rose"), children: [
60
+ /* @__PURE__ */ jsx("section", { children: /* @__PURE__ */ jsx(FadeIn, { children: /* @__PURE__ */ jsxs("div", { className: "panel p-5 flex flex-col sm:flex-row gap-4 items-start sm:items-center justify-between", style: panelTint("rose"), children: [
62
61
  /* @__PURE__ */ jsxs("div", { className: "space-y-0.5", children: [
63
62
  /* @__PURE__ */ jsx("p", { className: "text-sm font-semibold", children: t("Start a sponsorship deal") }),
64
63
  /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: t("Open an asset to sponsors.") })
@@ -68,11 +67,8 @@ function SponsorshipOffersPage() {
68
67
  /* @__PURE__ */ jsx(ArrowRight, { className: "h-3.5 w-3.5" })
69
68
  ] }) })
70
69
  ] }) }) }),
71
- /* @__PURE__ */ jsxs("section", { className: "px-4 space-y-4 max-w-5xl mx-auto", children: [
72
- /* @__PURE__ */ jsx(FadeIn, { children: /* @__PURE__ */ jsxs("div", { children: [
73
- /* @__PURE__ */ jsx("p", { className: "section-label", children: t("Open") }),
74
- /* @__PURE__ */ jsx("h2", { className: "text-xl font-bold mt-0.5", children: t("Sponsorship offers") })
75
- ] }) }),
70
+ /* @__PURE__ */ jsxs("section", { className: "space-y-4", children: [
71
+ /* @__PURE__ */ jsx(FadeIn, { children: /* @__PURE__ */ jsx(SectionHeading, { title: t("Sponsorship offers") }) }),
76
72
  isLoading ? /* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-4", children: Array.from({ length: 8 }).map((_, i) => /* @__PURE__ */ jsx(AssetCardSkeleton, {}, i)) }) : openOffers.length === 0 ? /* @__PURE__ */ jsx(FadeIn, { children: /* @__PURE__ */ jsxs("div", { className: "panel relative overflow-hidden p-12 text-center space-y-4", children: [
77
73
  /* @__PURE__ */ jsx("div", { className: "flex justify-center", children: /* @__PURE__ */ jsx(IconTile, { size: "lg", children: /* @__PURE__ */ jsx(Handshake, {}) }) }),
78
74
  /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/sponsorship-offers-page.tsx"],"sourcesContent":["\"use client\";\n\nimport { ArrowRight, Check, Handshake } from \"lucide-react\";\nimport { formatAmount, getTokenByAddress, type ApiSponsorshipOffer } from \"@medialane/sdk\";\nimport { AssetCard, AssetCardSkeleton } from \"./asset-card.js\";\nimport { BackButton } from \"./back-button.js\";\nimport Link from \"./link.js\";\nimport { FadeIn, Stagger, StaggerItem } from \"./motion-primitives.js\";\nimport { ServiceHeader } from \"./service-header.js\";\nimport { shortenAddress } from \"../utils/address.js\";\nimport { useSponsorshipOffers } from \"../utils/use-sponsorship.js\";\nimport { useToken } from \"../utils/use-tokens.js\";\nimport { useT } from \"../i18n/provider.js\";\n\nimport { msg } from \"../i18n/translate.js\";\nimport { ActionButton } from \"./action-button.js\";\nimport { panelTint } from \"./panel.js\";\nimport { IconTile } from \"./icon-tile.js\";\nconst FEATURES = [\n msg(\"Direct settlement\"),\n msg(\"Owner-verified on-chain\"),\n msg(\"Open bidding or one invited sponsor\"),\n];\n\nfunction OfferCard({ offer }: { offer: ApiSponsorshipOffer }) {\n const { token } = useToken(offer.nftContract, offer.tokenId);\n const paymentToken = getTokenByAddress(offer.paymentToken);\n const min = paymentToken ? `Min ${formatAmount(offer.minAmount, paymentToken.decimals)} ${paymentToken.symbol}` : `Min ${offer.minAmount}`;\n const days = Math.round(Number(offer.duration) / 86400);\n\n return (\n <AssetCard\n href={`/launchpad/sponsorship/${offer.offerId}`}\n name={token?.metadata?.name ?? `Token #${offer.tokenId}`}\n image={token?.metadata?.image ?? null}\n subtitle={shortenAddress(offer.nftContract)}\n fallbackId={offer.tokenId}\n price={{ formatted: `${min} · ${days}d`, currency: null }}\n />\n );\n}\n\nexport function SponsorshipOffersPage() {\n const t = useT();\n const { offers, isLoading } = useSponsorshipOffers();\n const openOffers = offers.filter((o) => o.open);\n\n return (\n <div className=\"pb-16 space-y-10\">\n <section className=\"px-4 pt-10 max-w-5xl mx-auto\">\n <BackButton />\n <FadeIn>\n <div className=\"mt-6\">\n <ServiceHeader\n plain\n icon={<Handshake className=\"h-4 w-4 text-white\" />}\n title={t(\"IP Sponsorship\")}\n subtitle={t(\"Sponsors bid for a license.\")}\n />\n </div>\n </FadeIn>\n </section>\n\n <section className=\"px-4 max-w-5xl mx-auto\">\n <FadeIn>\n <div className=\"flex flex-wrap gap-2\">\n {FEATURES.map((f) => (\n <span key={f} className=\"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-xs font-medium text-muted-foreground bg-background/40\">\n <Check className=\"h-3 w-3 text-brand-rose shrink-0\" />\n {t(f)}\n </span>\n ))}\n </div>\n </FadeIn>\n </section>\n\n <section className=\"px-4 max-w-5xl mx-auto\">\n <FadeIn>\n <div className=\"panel p-5 flex flex-col sm:flex-row gap-4 items-start sm:items-center justify-between\" style={panelTint(\"rose\")}>\n <div className=\"space-y-0.5\">\n <p className=\"text-sm font-semibold\">{t(\"Start a sponsorship deal\")}</p>\n <p className=\"text-xs text-muted-foreground\">\n {t(\"Open an asset to sponsors.\")}\n </p>\n </div>\n <ActionButton solid small asChild className=\"shrink-0\">\n <Link href=\"/launchpad/sponsorship/create\">\n {t(\"Get started\")}\n <ArrowRight className=\"h-3.5 w-3.5\" />\n </Link>\n </ActionButton>\n </div>\n </FadeIn>\n </section>\n\n <section className=\"px-4 space-y-4 max-w-5xl mx-auto\">\n <FadeIn>\n <div>\n <p className=\"section-label\">{t(\"Open\")}</p>\n <h2 className=\"text-xl font-bold mt-0.5\">{t(\"Sponsorship offers\")}</h2>\n </div>\n </FadeIn>\n\n {isLoading ? (\n <div className=\"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-4\">\n {Array.from({ length: 8 }).map((_, i) => <AssetCardSkeleton key={i} />)}\n </div>\n ) : openOffers.length === 0 ? (\n <FadeIn>\n <div className=\"panel relative overflow-hidden p-12 text-center space-y-4\">\n <div className=\"flex justify-center\">\n <IconTile size=\"lg\">\n <Handshake />\n </IconTile>\n </div>\n <div className=\"space-y-1\">\n <p className=\"font-semibold text-sm\">{t(\"No open sponsorship offers yet\")}</p>\n <p className=\"text-xs text-muted-foreground\">{t(\"Sponsors bid on open offers here.\")}</p>\n </div>\n </div>\n </FadeIn>\n ) : (\n <Stagger className=\"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-4\">\n {openOffers.map((offer) => (\n <StaggerItem key={offer.id}>\n <OfferCard offer={offer} />\n </StaggerItem>\n ))}\n </Stagger>\n )}\n </section>\n </div>\n );\n}\n"],"mappings":";AA+BI,cAkBE,YAlBF;AA7BJ,SAAS,YAAY,OAAO,iBAAiB;AAC7C,SAAS,cAAc,yBAAmD;AAC1E,SAAS,WAAW,yBAAyB;AAC7C,SAAS,kBAAkB;AAC3B,OAAO,UAAU;AACjB,SAAS,QAAQ,SAAS,mBAAmB;AAC7C,SAAS,qBAAqB;AAC9B,SAAS,sBAAsB;AAC/B,SAAS,4BAA4B;AACrC,SAAS,gBAAgB;AACzB,SAAS,YAAY;AAErB,SAAS,WAAW;AACpB,SAAS,oBAAoB;AAC7B,SAAS,iBAAiB;AAC1B,SAAS,gBAAgB;AACzB,MAAM,WAAW;AAAA,EACf,IAAI,mBAAmB;AAAA,EACvB,IAAI,yBAAyB;AAAA,EAC7B,IAAI,qCAAqC;AAC3C;AAEA,SAAS,UAAU,EAAE,MAAM,GAAmC;AAC5D,QAAM,EAAE,MAAM,IAAI,SAAS,MAAM,aAAa,MAAM,OAAO;AAC3D,QAAM,eAAe,kBAAkB,MAAM,YAAY;AACzD,QAAM,MAAM,eAAe,OAAO,aAAa,MAAM,WAAW,aAAa,QAAQ,CAAC,IAAI,aAAa,MAAM,KAAK,OAAO,MAAM,SAAS;AACxI,QAAM,OAAO,KAAK,MAAM,OAAO,MAAM,QAAQ,IAAI,KAAK;AAEtD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAM,0BAA0B,MAAM,OAAO;AAAA,MAC7C,MAAM,OAAO,UAAU,QAAQ,UAAU,M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AC,QAAK,MAAK,iCACR;AAAA,UAAE,aAAa;AAAA,QAChB,oBAAC,cAAW,WAAU,eAAc;AAAA,SACtC,GACF;AAAA,OACF,GACF,GACF;AAAA,IAEA,qBAAC,aAAQ,WAAU,oCACjB;AAAA,0BAAC,UACC,+BAAC,SACC;AAAA,4BAAC,OAAE,WAAU,iBAAiB,YAAE,MAAM,GAAE;AAAA,QACxC,oBAAC,QAAG,WAAU,4BAA4B,YAAE,oBAAoB,GAAE;AAAA,SACpE,GACF;AAAA,MAEC,YACC,oBAAC,SAAI,WAAU,wDACZ,gBAAM,KAAK,EAAE,QAAQ,EAAE,CAAC,EAAE,IAAI,CAAC,GAAG,MAAM,oBAAC,uBAAuB,CAAG,CAAE,GACxE,IACE,WAAW,WAAW,IACxB,oBAAC,UACC,+BAAC,SAAI,WAAU,6DACb;AAAA,4BAAC,SAAI,WAAU,uBACb,8BAAC,YAAS,MAAK,MACb,8BAAC,aAAU,GACb,GACF;AAAA,QACA,qBAAC,SAAI,WAAU,aACb;AAAA,8BAAC,OAAE,WAAU,yBAAyB,YAAE,gCAAgC,GAAE;AAAA,UAC1E,oBAAC,OAAE,WAAU,iCAAiC,YAAE,mCAAmC,GAAE;AAAA,WACvF;AAAA,SACF,GACF,IAEA,oBAAC,WAAQ,WAAU,wDAChB,qBAAW,IAAI,CAAC,UACf,oBAAC,eACC,8BAAC,aAAU,OAAc,KADT,MAAM,EAExB,CACD,GACH;AAAA,OAEJ;AAAA,KACF;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../src/components/sponsorship-offers-page.tsx"],"sourcesContent":["\"use client\";\n\nimport { SectionHeading } from \"./section-heading.js\";\nimport { ArrowRight, Check, Handshake } from \"lucide-react\";\nimport { formatAmount, getTokenByAddress, type ApiSponsorshipOffer } from \"@medialane/sdk\";\nimport { AssetCard, AssetCardSkeleton } from \"./asset-card.js\";\nimport { BackButton } from \"./back-button.js\";\nimport Link from \"./link.js\";\nimport { FadeIn, Stagger, StaggerItem } from \"./motion-primitives.js\";\nimport { PageContainer } from \"./page-container.js\";\nimport { PageHeader } from \"./page-header.js\";\nimport { shortenAddress } from \"../utils/address.js\";\nimport { useSponsorshipOffers } from \"../utils/use-sponsorship.js\";\nimport { useToken } from \"../utils/use-tokens.js\";\nimport { useT } from \"../i18n/provider.js\";\n\nimport { msg } from \"../i18n/translate.js\";\nimport { ActionButton } from \"./action-button.js\";\nimport { panelTint } from \"./panel.js\";\nimport { IconTile } from \"./icon-tile.js\";\nconst FEATURES = [\n msg(\"Direct settlement\"),\n msg(\"Owner-verified on-chain\"),\n msg(\"Open bidding or one invited sponsor\"),\n];\n\nfunction OfferCard({ offer }: { offer: ApiSponsorshipOffer }) {\n const { token } = useToken(offer.nftContract, offer.tokenId);\n const paymentToken = getTokenByAddress(offer.paymentToken);\n const min = paymentToken ? `Min ${formatAmount(offer.minAmount, paymentToken.decimals)} ${paymentToken.symbol}` : `Min ${offer.minAmount}`;\n const days = Math.round(Number(offer.duration) / 86400);\n\n return (\n <AssetCard\n href={`/launchpad/sponsorship/${offer.offerId}`}\n name={token?.metadata?.name ?? `Token #${offer.tokenId}`}\n image={token?.metadata?.image ?? null}\n subtitle={shortenAddress(offer.nftContract)}\n fallbackId={offer.tokenId}\n price={{ formatted: `${min} · ${days}d`, currency: null }}\n />\n );\n}\n\nexport function SponsorshipOffersPage() {\n const t = useT();\n const { offers, isLoading } = useSponsorshipOffers();\n const openOffers = offers.filter((o) => o.open);\n\n return (\n <PageContainer variant=\"narrow\" className=\"space-y-8\">\n <PageHeader\n back={<BackButton />}\n icon={<Handshake />}\n title={t(\"IP Sponsorship\")}\n subtitle={t(\"Sponsors bid for a license.\")}\n />\n\n <section>\n <FadeIn>\n <div className=\"flex flex-wrap gap-2\">\n {FEATURES.map((f) => (\n <span key={f} className=\"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-xs font-medium text-muted-foreground bg-background/40\">\n <Check className=\"h-3 w-3 text-brand-rose shrink-0\" />\n {t(f)}\n </span>\n ))}\n </div>\n </FadeIn>\n </section>\n\n <section>\n <FadeIn>\n <div className=\"panel p-5 flex flex-col sm:flex-row gap-4 items-start sm:items-center justify-between\" style={panelTint(\"rose\")}>\n <div className=\"space-y-0.5\">\n <p className=\"text-sm font-semibold\">{t(\"Start a sponsorship deal\")}</p>\n <p className=\"text-xs text-muted-foreground\">\n {t(\"Open an asset to sponsors.\")}\n </p>\n </div>\n <ActionButton solid small asChild className=\"shrink-0\">\n <Link href=\"/launchpad/sponsorship/create\">\n {t(\"Get started\")}\n <ArrowRight className=\"h-3.5 w-3.5\" />\n </Link>\n </ActionButton>\n </div>\n </FadeIn>\n </section>\n\n <section className=\"space-y-4\">\n <FadeIn>\n <SectionHeading title={t(\"Sponsorship offers\")} />\n </FadeIn>\n\n {isLoading ? (\n <div className=\"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-4\">\n {Array.from({ length: 8 }).map((_, i) => <AssetCardSkeleton key={i} />)}\n </div>\n ) : openOffers.length === 0 ? (\n <FadeIn>\n <div className=\"panel relative overflow-hidden p-12 text-center space-y-4\">\n <div className=\"flex justify-center\">\n <IconTile size=\"lg\">\n <Handshake />\n </IconTile>\n </div>\n <div className=\"space-y-1\">\n <p className=\"font-semibold text-sm\">{t(\"No open sponsorship offers yet\")}</p>\n <p className=\"text-xs text-muted-foreground\">{t(\"Sponsors bid on open offers here.\")}</p>\n </div>\n </div>\n </FadeIn>\n ) : (\n <Stagger className=\"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-4\">\n {openOffers.map((offer) => (\n <StaggerItem key={offer.id}>\n <OfferCard offer={offer} />\n </StaggerItem>\n ))}\n </Stagger>\n )}\n </section>\n </PageContainer>\n );\n}\n"],"mappings":";AAiCI,cA6BU,YA7BV;AA/BJ,SAAS,sBAAsB;AAC/B,SAAS,YAAY,OAAO,iBAAiB;AAC7C,SAAS,cAAc,yBAAmD;AAC1E,SAAS,WAAW,yBAAyB;AAC7C,SAAS,kBAAkB;AA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AgC,GAAE;AAAA,UAC1E,oBAAC,OAAE,WAAU,iCAAiC,YAAE,mCAAmC,GAAE;AAAA,WACvF;AAAA,SACF,GACF,IAEA,oBAAC,WAAQ,WAAU,wDAChB,qBAAW,IAAI,CAAC,UACf,oBAAC,eACC,8BAAC,aAAU,OAAc,KADT,MAAM,EAExB,CACD,GACH;AAAA,OAEJ;AAAA,KACF;AAEJ;","names":[]}
@@ -30,13 +30,13 @@ var import_use_confetti = require("../utils/use-confetti.js");
30
30
  var import_provider = require("../i18n/provider.js");
31
31
  var import_icon_tile = require("./icon-tile.js");
32
32
  const ACTIVE_STEP = { preparing: 0, submitting: 1, confirming: 2 };
33
- function TransactionDialog({ tx, title, workingLabel, firstStepLabel = "Prepare", children }) {
33
+ function TransactionDialog({ tx, title, workingLabel, firstStepLabel, children }) {
34
34
  const t = (0, import_provider.useT)();
35
35
  const { phase, error, reset, retryable = true } = tx;
36
36
  const working = phase === "preparing" || phase === "submitting" || phase === "confirming";
37
37
  const success = phase === "success";
38
38
  const failed = phase === "error";
39
- const steps = [firstStepLabel, t("Submit transaction"), t("Confirm transaction")];
39
+ const steps = [firstStepLabel ?? t("Prepare"), t("Submit transaction"), t("Confirm transaction")];
40
40
  (0, import_use_confetti.useConfetti)(success);
41
41
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.Dialog, { open: phase !== "idle", modal: true, onOpenChange: (open) => {
42
42
  if (!open && !working) reset();
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/transaction-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { CheckCircle2, Loader2, XCircle } from \"lucide-react\";\nimport { Dialog, DialogContent, DialogTitle } from \"./dialog.js\";\nimport { Button } from \"./button.js\";\nimport { useConfetti } from \"../utils/use-confetti.js\";\nimport type { useTransaction } from \"../utils/use-transaction.js\";\nimport { useT } from \"../i18n/provider.js\";\nimport { IconTile } from \"./icon-tile.js\";\n\nexport interface TransactionDialogProps {\n tx: Pick<ReturnType<typeof useTransaction>, \"phase\" | \"error\" | \"reset\"> & { retryable?: boolean };\n title: string;\n workingLabel: string;\n firstStepLabel?: string;\n children?: ReactNode;\n}\n\nconst ACTIVE_STEP = { preparing: 0, submitting: 1, confirming: 2 } as const;\n\nexport function TransactionDialog({ tx, title, workingLabel, firstStepLabel = \"Prepare\", children }: TransactionDialogProps) {\n const t = useT();\n const { phase, error, reset, retryable = true } = tx;\n const working = phase === \"preparing\" || phase === \"submitting\" || phase === \"confirming\";\n const success = phase === \"success\";\n const failed = phase === \"error\";\n const steps = [firstStepLabel, t(\"Submit transaction\"), t(\"Confirm transaction\")];\n\n useConfetti(success);\n\n return (\n <Dialog open={phase !== \"idle\"} modal onOpenChange={(open) => { if (!open && !working) reset(); }}>\n <DialogContent\n className=\"sm:max-w-md\"\n onInteractOutside={working ? (e) => e.preventDefault() : undefined}\n onEscapeKeyDown={working ? (e) => e.preventDefault() : undefined}\n {...(working ? { hideClose: true } : {})}\n >\n <DialogTitle className=\"sr-only\">{working ? workingLabel : title}</DialogTitle>\n\n {working && (\n <div className=\"flex flex-col items-center gap-6 py-4\">\n <div className=\"flex h-16 w-16 items-center justify-center rounded-full bg-primary/10\">\n <Loader2 className=\"h-8 w-8 animate-spin text-primary\" />\n </div>\n <div className=\"space-y-1 text-center\">\n <p className=\"text-lg font-semibold\">{workingLabel}</p>\n <p className=\"text-sm text-muted-foreground\">\n {phase === \"confirming\" ? t(\"Waiting for block confirmation\") : t(\"Submitting transaction\")}\n </p>\n </div>\n <ol className=\"panel w-full space-y-2 p-4\">\n {steps.map((label, i) => {\n const active = i === ACTIVE_STEP[phase];\n const done = i < ACTIVE_STEP[phase];\n return (\n <li key={label} data-step aria-current={active ? \"step\" : undefined} className=\"flex items-center gap-3\">\n {done ? (\n <CheckCircle2 className=\"h-4 w-4 shrink-0 text-brand-blue\" />\n ) : active ? (\n <Loader2 className=\"h-4 w-4 shrink-0 animate-spin text-primary\" />\n ) : (\n <div className=\"h-4 w-4 shrink-0 rounded-full border-2 border-muted-foreground/30\" />\n )}\n <span className={done ? \"text-sm text-foreground\" : active ? \"text-sm font-medium text-primary\" : \"text-sm text-muted-foreground\"}>\n {label}\n </span>\n </li>\n );\n })}\n </ol>\n <p className=\"text-center text-xs text-muted-foreground\">{t(\"This usually takes 10–30 seconds.\")}</p>\n </div>\n )}\n\n {success && children}\n\n {failed && (\n <div className=\"flex flex-col items-center gap-5 py-2\">\n <IconTile size=\"lg\" destructive>\n <XCircle />\n </IconTile>\n <div className=\"space-y-1 text-center\">\n <p className=\"text-xl font-bold\">{title}</p>\n <p className=\"mx-auto max-w-xs text-sm text-muted-foreground\">{error}</p>\n </div>\n <Button variant=\"soft\" className=\"w-full\" onClick={reset}>\n {retryable ? t(\"Try again\") : t(\"Close\")}\n </Button>\n </div>\n )}\n </DialogContent>\n </Dialog>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAuCQ;AApCR,0BAA+C;AAC/C,oBAAmD;AACnD,oBAAuB;AACvB,0BAA4B;AAE5B,sBAAqB;AACrB,uBAAyB;AAUzB,MAAM,cAAc,EAAE,WAAW,GAAG,YAAY,GAAG,YAAY,EAAE;AAE1D,SAAS,kBAAkB,EAAE,IAAI,OAAO,cAAc,iBAAiB,WAAW,SAAS,GAA2B;AAC3H,QAAM,QAAI,sBAAK;AACf,QAAM,EAAE,OAAO,OAAO,OAAO,YAAY,KAAK,IAAI;AAClD,QAAM,UAAU,UAAU,eAAe,UAAU,gBAAgB,UAAU;AAC7E,QAAM,UAAU,UAAU;AAC1B,QAAM,SAAS,UAAU;AACzB,QAAM,QAAQ,CAAC,gBAAgB,EAAE,oBAAoB,GAAG,EAAE,qBAAqB,CAAC;AAEhF,uCAAY,OAAO;AAEnB,SACE,4CAAC,wBAAO,MAAM,UAAU,QAAQ,OAAK,MAAC,cAAc,CAAC,SAAS;AAAE,QAAI,CAAC,QAAQ,CAAC,QAAS,OAAM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A,UACA,6CAAC,SAAI,WAAU,yBACb;AAAA,wDAAC,OAAE,WAAU,qBAAqB,iBAAM;AAAA,YACxC,4CAAC,OAAE,WAAU,kDAAkD,iBAAM;AAAA,aACvE;AAAA,UACA,4CAAC,wBAAO,SAAQ,QAAO,WAAU,UAAS,SAAS,OAChD,sBAAY,EAAE,WAAW,IAAI,EAAE,OAAO,GACzC;AAAA,WACF;AAAA;AAAA;AAAA,EAEJ,GACF;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../src/components/transaction-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { CheckCircle2, Loader2, XCircle } from \"lucide-react\";\nimport { Dialog, DialogContent, DialogTitle } from \"./dialog.js\";\nimport { Button } from \"./button.js\";\nimport { useConfetti } from \"../utils/use-confetti.js\";\nimport type { useTransaction } from \"../utils/use-transaction.js\";\nimport { useT } from \"../i18n/provider.js\";\nimport { IconTile } from \"./icon-tile.js\";\n\nexport interface TransactionDialogProps {\n tx: Pick<ReturnType<typeof useTransaction>, \"phase\" | \"error\" | \"reset\"> & { retryable?: boolean };\n title: string;\n workingLabel: string;\n firstStepLabel?: string;\n children?: ReactNode;\n}\n\nconst ACTIVE_STEP = { preparing: 0, submitting: 1, confirming: 2 } as const;\n\nexport function TransactionDialog({ tx, title, workingLabel, firstStepLabel, children }: TransactionDialogProps) {\n const t = useT();\n const { phase, error, reset, retryable = true } = tx;\n const working = phase === \"preparing\" || phase === \"submitting\" || phase === \"confirming\";\n const success = phase === \"success\";\n const failed = phase === \"error\";\n const steps = [firstStepLabel ?? t(\"Prepare\"), t(\"Submit transaction\"), t(\"Confirm transaction\")];\n\n useConfetti(success);\n\n return (\n <Dialog open={phase !== \"idle\"} modal onOpenChange={(open) => { if (!open && !working) reset(); }}>\n <DialogContent\n className=\"sm:max-w-md\"\n onInteractOutside={working ? (e) => e.preventDefault() : undefined}\n onEscapeKeyDown={working ? (e) => e.preventDefault() : undefined}\n {...(working ? { hideClose: true } : {})}\n >\n <DialogTitle className=\"sr-only\">{working ? workingLabel : title}</DialogTitle>\n\n {working && (\n <div className=\"flex flex-col items-center gap-6 py-4\">\n <div className=\"flex h-16 w-16 items-center justify-center rounded-full bg-primary/10\">\n <Loader2 className=\"h-8 w-8 animate-spin text-primary\" />\n </div>\n <div className=\"space-y-1 text-center\">\n <p className=\"text-lg font-semibold\">{workingLabel}</p>\n <p className=\"text-sm text-muted-foreground\">\n {phase === \"confirming\" ? t(\"Waiting for block confirmation\") : t(\"Submitting transaction\")}\n </p>\n </div>\n <ol className=\"panel w-full space-y-2 p-4\">\n {steps.map((label, i) => {\n const active = i === ACTIVE_STEP[phase];\n const done = i < ACTIVE_STEP[phase];\n return (\n <li key={label} data-step aria-current={active ? \"step\" : undefined} className=\"flex items-center gap-3\">\n {done ? (\n <CheckCircle2 className=\"h-4 w-4 shrink-0 text-brand-blue\" />\n ) : active ? (\n <Loader2 className=\"h-4 w-4 shrink-0 animate-spin text-primary\" />\n ) : (\n <div className=\"h-4 w-4 shrink-0 rounded-full border-2 border-muted-foreground/30\" />\n )}\n <span className={done ? \"text-sm text-foreground\" : active ? \"text-sm font-medium text-primary\" : \"text-sm text-muted-foreground\"}>\n {label}\n </span>\n </li>\n );\n })}\n </ol>\n <p className=\"text-center text-xs text-muted-foreground\">{t(\"This usually takes 10–30 seconds.\")}</p>\n </div>\n )}\n\n {success && children}\n\n {failed && (\n <div className=\"flex flex-col items-center gap-5 py-2\">\n <IconTile size=\"lg\" destructive>\n <XCircle />\n </IconTile>\n <div className=\"space-y-1 text-center\">\n <p className=\"text-xl font-bold\">{title}</p>\n <p className=\"mx-auto max-w-xs text-sm text-muted-foreground\">{error}</p>\n </div>\n <Button variant=\"soft\" className=\"w-full\" onClick={reset}>\n {retryable ? t(\"Try again\") : t(\"Close\")}\n </Button>\n </div>\n )}\n </DialogContent>\n </Dialog>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA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C,QAAG,WAAU,8BACX,gBAAM,IAAI,CAAC,OAAO,MAAM;AACvB,kBAAM,SAAS,MAAM,YAAY,KAAK;AACtC,kBAAM,OAAO,IAAI,YAAY,KAAK;AAClC,mBACE,6CAAC,QAAe,aAAS,MAAC,gBAAc,SAAS,SAAS,QAAW,WAAU,2BAC5E;AAAA,qBACC,4CAAC,oCAAa,WAAU,oCAAmC,IACzD,SACF,4CAAC,+BAAQ,WAAU,8CAA6C,IAEhE,4CAAC,SAAI,WAAU,qEAAoE;AAAA,cAErF,4CAAC,UAAK,WAAW,OAAO,4BAA4B,SAAS,qCAAqC,iCAC/F,iBACH;AAAA,iBAVO,KAWT;AAAA,UAEJ,CAAC,GACH;AAAA,UACA,4CAAC,OAAE,WAAU,6CAA6C,YAAE,wCAAmC,GAAE;AAAA,WACnG;AAAA,QAGD,WAAW;AAAA,QAEX,UACC,6CAAC,SAAI,WAAU,yCACb;AAAA,sDAAC,6BAAS,MAAK,MAAK,aAAW,MAC7B,sDAAC,+BAAQ,GACX;AAAA,UACA,6CAAC,SAAI,WAAU,yBACb;AAAA,wDAAC,OAAE,WAAU,qBAAqB,iBAAM;AAAA,YACxC,4CAAC,OAAE,WAAU,kDAAkD,iBAAM;AAAA,aACvE;AAAA,UACA,4CAAC,wBAAO,SAAQ,QAAO,WAAU,UAAS,SAAS,OAChD,sBAAY,EAAE,WAAW,IAAI,EAAE,OAAO,GACzC;AAAA,WACF;AAAA;AAAA;AAAA,EAEJ,GACF;AAEJ;","names":[]}
@@ -7,13 +7,13 @@ import { useConfetti } from "../utils/use-confetti.js";
7
7
  import { useT } from "../i18n/provider.js";
8
8
  import { IconTile } from "./icon-tile.js";
9
9
  const ACTIVE_STEP = { preparing: 0, submitting: 1, confirming: 2 };
10
- function TransactionDialog({ tx, title, workingLabel, firstStepLabel = "Prepare", children }) {
10
+ function TransactionDialog({ tx, title, workingLabel, firstStepLabel, children }) {
11
11
  const t = useT();
12
12
  const { phase, error, reset, retryable = true } = tx;
13
13
  const working = phase === "preparing" || phase === "submitting" || phase === "confirming";
14
14
  const success = phase === "success";
15
15
  const failed = phase === "error";
16
- const steps = [firstStepLabel, t("Submit transaction"), t("Confirm transaction")];
16
+ const steps = [firstStepLabel ?? t("Prepare"), t("Submit transaction"), t("Confirm transaction")];
17
17
  useConfetti(success);
18
18
  return /* @__PURE__ */ jsx(Dialog, { open: phase !== "idle", modal: true, onOpenChange: (open) => {
19
19
  if (!open && !working) reset();
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/transaction-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { CheckCircle2, Loader2, XCircle } from \"lucide-react\";\nimport { Dialog, DialogContent, DialogTitle } from \"./dialog.js\";\nimport { Button } from \"./button.js\";\nimport { useConfetti } from \"../utils/use-confetti.js\";\nimport type { useTransaction } from \"../utils/use-transaction.js\";\nimport { useT } from \"../i18n/provider.js\";\nimport { IconTile } from \"./icon-tile.js\";\n\nexport interface TransactionDialogProps {\n tx: Pick<ReturnType<typeof useTransaction>, \"phase\" | \"error\" | \"reset\"> & { retryable?: boolean };\n title: string;\n workingLabel: string;\n firstStepLabel?: string;\n children?: ReactNode;\n}\n\nconst ACTIVE_STEP = { preparing: 0, submitting: 1, confirming: 2 } as const;\n\nexport function TransactionDialog({ tx, title, workingLabel, firstStepLabel = \"Prepare\", children }: TransactionDialogProps) {\n const t = useT();\n const { phase, error, reset, retryable = true } = tx;\n const working = phase === \"preparing\" || phase === \"submitting\" || phase === \"confirming\";\n const success = phase === \"success\";\n const failed = phase === \"error\";\n const steps = [firstStepLabel, t(\"Submit transaction\"), t(\"Confirm transaction\")];\n\n useConfetti(success);\n\n return (\n <Dialog open={phase !== \"idle\"} modal onOpenChange={(open) => { if (!open && !working) reset(); }}>\n <DialogContent\n className=\"sm:max-w-md\"\n onInteractOutside={working ? (e) => e.preventDefault() : undefined}\n onEscapeKeyDown={working ? (e) => e.preventDefault() : undefined}\n {...(working ? { hideClose: true } : {})}\n >\n <DialogTitle className=\"sr-only\">{working ? workingLabel : title}</DialogTitle>\n\n {working && (\n <div className=\"flex flex-col items-center gap-6 py-4\">\n <div className=\"flex h-16 w-16 items-center justify-center rounded-full bg-primary/10\">\n <Loader2 className=\"h-8 w-8 animate-spin text-primary\" />\n </div>\n <div className=\"space-y-1 text-center\">\n <p className=\"text-lg font-semibold\">{workingLabel}</p>\n <p className=\"text-sm text-muted-foreground\">\n {phase === \"confirming\" ? t(\"Waiting for block confirmation\") : t(\"Submitting transaction\")}\n </p>\n </div>\n <ol className=\"panel w-full space-y-2 p-4\">\n {steps.map((label, i) => {\n const active = i === ACTIVE_STEP[phase];\n const done = i < ACTIVE_STEP[phase];\n return (\n <li key={label} data-step aria-current={active ? \"step\" : undefined} className=\"flex items-center gap-3\">\n {done ? (\n <CheckCircle2 className=\"h-4 w-4 shrink-0 text-brand-blue\" />\n ) : active ? (\n <Loader2 className=\"h-4 w-4 shrink-0 animate-spin text-primary\" />\n ) : (\n <div className=\"h-4 w-4 shrink-0 rounded-full border-2 border-muted-foreground/30\" />\n )}\n <span className={done ? \"text-sm text-foreground\" : active ? \"text-sm font-medium text-primary\" : \"text-sm text-muted-foreground\"}>\n {label}\n </span>\n </li>\n );\n })}\n </ol>\n <p className=\"text-center text-xs text-muted-foreground\">{t(\"This usually takes 10–30 seconds.\")}</p>\n </div>\n )}\n\n {success && children}\n\n {failed && (\n <div className=\"flex flex-col items-center gap-5 py-2\">\n <IconTile size=\"lg\" destructive>\n <XCircle />\n </IconTile>\n <div className=\"space-y-1 text-center\">\n <p className=\"text-xl font-bold\">{title}</p>\n <p className=\"mx-auto max-w-xs text-sm text-muted-foreground\">{error}</p>\n </div>\n <Button variant=\"soft\" className=\"w-full\" onClick={reset}>\n {retryable ? t(\"Try again\") : t(\"Close\")}\n </Button>\n </div>\n )}\n </DialogContent>\n </Dialog>\n );\n}\n"],"mappings":";AAuCQ,cAOI,YAPJ;AApCR,SAAS,cAAc,SAAS,eAAe;A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AG,WAAU,8BACX,gBAAM,IAAI,CAAC,OAAO,MAAM;AACvB,kBAAM,SAAS,MAAM,YAAY,KAAK;AACtC,kBAAM,OAAO,IAAI,YAAY,KAAK;AAClC,mBACE,qBAAC,QAAe,aAAS,MAAC,gBAAc,SAAS,SAAS,QAAW,WAAU,2BAC5E;AAAA,qBACC,oBAAC,gBAAa,WAAU,oCAAmC,IACzD,SACF,oBAAC,WAAQ,WAAU,8CAA6C,IAEhE,oBAAC,SAAI,WAAU,qEAAoE;AAAA,cAErF,oBAAC,UAAK,WAAW,OAAO,4BAA4B,SAAS,qCAAqC,iCAC/F,iBACH;AAAA,iBAVO,KAWT;AAAA,UAEJ,CAAC,GACH;AAAA,UACA,oBAAC,OAAE,WAAU,6CAA6C,YAAE,wCAAmC,GAAE;AAAA,WACnG;AAAA,QAGD,WAAW;AAAA,QAEX,UACC,qBAAC,SAAI,WAAU,yCACb;AAAA,8BAAC,YAAS,MAAK,MAAK,aAAW,MAC7B,8BAAC,WAAQ,GACX;AAAA,UACA,qBAAC,SAAI,WAAU,yBACb;AAAA,gCAAC,OAAE,WAAU,qBAAqB,iBAAM;AAAA,YACxC,oBAAC,OAAE,WAAU,kDAAkD,iBAAM;AAAA,aACvE;AAAA,UACA,oBAAC,UAAO,SAAQ,QAAO,WAAU,UAAS,SAAS,OAChD,sBAAY,EAAE,WAAW,IAAI,EAAE,OAAO,GACzC;AAAA,WACF;AAAA;AAAA;AAAA,EAEJ,GACF;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../src/components/transaction-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { CheckCircle2, Loader2, XCircle } from \"lucide-react\";\nimport { Dialog, DialogContent, DialogTitle } from \"./dialog.js\";\nimport { Button } from \"./button.js\";\nimport { useConfetti } from \"../utils/use-confetti.js\";\nimport type { useTransaction } from \"../utils/use-transaction.js\";\nimport { useT } from \"../i18n/provider.js\";\nimport { IconTile } from \"./icon-tile.js\";\n\nexport interface TransactionDialogProps {\n tx: Pick<ReturnType<typeof useTransaction>, \"phase\" | \"error\" | \"reset\"> & { retryable?: boolean };\n title: string;\n workingLabel: string;\n firstStepLabel?: string;\n children?: ReactNode;\n}\n\nconst ACTIVE_STEP = { preparing: 0, submitting: 1, confirming: 2 } as const;\n\nexport function TransactionDialog({ tx, title, workingLabel, firstStepLabel, children }: TransactionDialogProps) {\n const t = useT();\n const { phase, error, reset, retryable = true } = tx;\n const working = phase === \"preparing\" || phase === \"submitting\" || phase === \"confirming\";\n const success = phase === \"success\";\n const failed = phase === \"error\";\n const steps = [firstStepLabel ?? t(\"Prepare\"), t(\"Submit transaction\"), t(\"Confirm transaction\")];\n\n useConfetti(success);\n\n return (\n <Dialog open={phase !== \"idle\"} modal onOpenChange={(open) => { if (!open && !working) reset(); }}>\n <DialogContent\n className=\"sm:max-w-md\"\n onInteractOutside={working ? (e) => e.preventDefault() : undefined}\n onEscapeKeyDown={working ? (e) => e.preventDefault() : undefined}\n {...(working ? { hideClose: true } : {})}\n >\n <DialogTitle className=\"sr-only\">{working ? workingLabel : title}</DialogTitle>\n\n {working && (\n <div className=\"flex flex-col items-center gap-6 py-4\">\n <div className=\"flex h-16 w-16 items-center justify-center rounded-full bg-primary/10\">\n <Loader2 className=\"h-8 w-8 animate-spin text-primary\" />\n </div>\n <div className=\"space-y-1 text-center\">\n <p className=\"text-lg font-semibold\">{workingLabel}</p>\n <p className=\"text-sm text-muted-foreground\">\n {phase === \"confirming\" ? t(\"Waiting for block confirmation\") : t(\"Submitting transaction\")}\n </p>\n </div>\n <ol className=\"panel w-full space-y-2 p-4\">\n {steps.map((label, i) => {\n const active = i === ACTIVE_STEP[phase];\n const done = i < ACTIVE_STEP[phase];\n return (\n <li key={label} data-step aria-current={active ? \"step\" : undefined} className=\"flex items-center gap-3\">\n {done ? (\n <CheckCircle2 className=\"h-4 w-4 shrink-0 text-brand-blue\" />\n ) : active ? (\n <Loader2 className=\"h-4 w-4 shrink-0 animate-spin text-primary\" />\n ) : (\n <div className=\"h-4 w-4 shrink-0 rounded-full border-2 border-muted-foreground/30\" />\n )}\n <span className={done ? \"text-sm text-foreground\" : active ? \"text-sm font-medium text-primary\" : \"text-sm text-muted-foreground\"}>\n {label}\n </span>\n </li>\n );\n })}\n </ol>\n <p className=\"text-center text-xs text-muted-foreground\">{t(\"This usually takes 10–30 seconds.\")}</p>\n </div>\n )}\n\n {success && children}\n\n {failed && (\n <div className=\"flex flex-col items-center gap-5 py-2\">\n <IconTile size=\"lg\" destructive>\n <XCircle />\n </IconTile>\n <div className=\"space-y-1 text-center\">\n <p className=\"text-xl font-bold\">{title}</p>\n <p className=\"mx-auto max-w-xs text-sm text-muted-foreground\">{error}</p>\n </div>\n <Button variant=\"soft\" className=\"w-full\" onClick={reset}>\n {retryable ? t(\"Try again\") : t(\"Close\")}\n </Button>\n </div>\n )}\n </DialogContent>\n </Dialog>\n );\n}\n"],"mappings":";AAuCQ,cAOI,YAPJ;AApCR,SAAS,cAAc,SAAS,eAAe;AAC/C,SAAS,QAAQ,eAAe,mBAAmB;AACnD,SAAS,cAAc;AACvB,SAAS,mBAAmB;AAE5B,SAAS,YAAY;AACrB,SAAS,gBAAgB;AAUzB,MAAM,cAAc,EAAE,WAAW,GAAG,YAAY,GAAG,YAAY,EAAE;AAE1D,SAAS,kBAAkB,EAAE,IAAI,OAAO,cAAc,gBAAgB,SAAS,GAA2B;AAC/G,QAAM,IAAI,KAAK;AACf,QAAM,EAAE,OAAO,OAAO,OAAO,YAAY,KAAK,IAAI;AAClD,QAAM,UAAU,UAAU,eAAe,UAAU,gBAAgB,UAAU;AAC7E,QAAM,UAAU,UAAU;AAC1B,QAAM,SAAS,UAAU;AACzB,QAAM,QAAQ,CAAC,kBAAkB,EAAE,SAAS,GAAG,EAAE,oBAAoB,GAAG,EAAE,qBAAqB,CAAC;AAEhG,cAAY,OAAO;AAEnB,SACE,oBAAC,UAAO,MAAM,UAAU,QAAQ,OAAK,MAAC,cAAc,CAAC,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MAAK,aAAW,MAC7B,8BAAC,WAAQ,GACX;AAAA,UACA,qBAAC,SAAI,WAAU,yBACb;AAAA,gCAAC,OAAE,WAAU,qBAAqB,iBAAM;AAAA,YACxC,oBAAC,OAAE,WAAU,kDAAkD,iBAAM;AAAA,aACvE;AAAA,UACA,oBAAC,UAAO,SAAQ,QAAO,WAAU,UAAS,SAAS,OAChD,sBAAY,EAAE,WAAW,IAAI,EAAE,OAAO,GACzC;AAAA,WACF;AAAA;AAAA;AAAA,EAEJ,GACF;AAEJ;","names":[]}
@@ -120,7 +120,7 @@ function TransferCollectionOwnership({ collectionId, currentOwner, collectionNam
120
120
  ] })
121
121
  ] })
122
122
  ] }) }),
123
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_transaction_dialog.TransactionDialog, { tx, title: t("Transfer ownership"), workingLabel: "Transferring ownership\u2026", firstStepLabel: "Prepare transfer", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
123
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_transaction_dialog.TransactionDialog, { tx, title: t("Transfer ownership"), workingLabel: t("Transferring ownership\u2026"), firstStepLabel: t("Prepare transfer"), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
124
124
  import_transaction_success.TransactionSuccess,
125
125
  {
126
126
  name: collectionName ?? "Collection",
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/transfer-collection-ownership.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport { UserRoundCog } from \"lucide-react\";\nimport { normalizeAddress } from \"@medialane/sdk\";\nimport { Button } from \"./button.js\";\nimport { Dialog, DialogContent, DialogDescription, DialogTitle } from \"./dialog.js\";\nimport { Input } from \"./input.js\";\nimport { Label } from \"./label.js\";\nimport { MarketplaceConfirmStep } from \"./marketplace-dialog-primitives.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\nimport { TransactionDialog } from \"./transaction-dialog.js\";\nimport { TransactionSuccess } from \"./transaction-success.js\";\nimport { shortenAddress } from \"../utils/address.js\";\nimport { runIntentCalls } from \"../utils/run-intent-calls.js\";\nimport { successMessages } from \"../utils/success-messages.js\";\nimport { useTransaction } from \"../utils/use-transaction.js\";\nimport { useT } from \"../i18n/provider.js\";\n\nexport interface TransferCollectionOwnershipProps {\n collectionId: string;\n currentOwner: string;\n collectionName?: string | null;\n onTransferred?: () => void;\n}\n\nexport function TransferCollectionOwnership({ collectionId, currentOwner, collectionName, onTransferred }: TransferCollectionOwnershipProps) {\n const t = useT();\n const app = useMedialaneApp();\n const tx = useTransaction();\n const [open, setOpen] = useState(false);\n const [confirming, setConfirming] = useState(false);\n const [newOwner, setNewOwner] = useState(\"\");\n\n const trimmed = newOwner.trim();\n const isValid = /^0x[0-9a-fA-F]{1,64}$/.test(trimmed);\n const wouldNoop = isValid && normalizeAddress(\"STARKNET\", trimmed) === normalizeAddress(\"STARKNET\", currentOwner);\n\n const close = () => {\n setOpen(false);\n setConfirming(false);\n };\n\n const transfer = () => {\n close();\n void tx\n .run(async (signer) => {\n await runIntentCalls(signer, () =>\n app.getClient().createIntent(\"transfer-collection-ownership\", { owner: signer.address, collectionId: String(collectionId), newOwner: trimmed }),\n );\n })\n .then((ok) => {\n if (ok) onTransferred?.();\n });\n };\n\n return (\n <>\n <Button variant=\"soft\" size=\"sm\" className=\"gap-2\" onClick={() => { setNewOwner(\"\"); setOpen(true); }}>\n <UserRoundCog className=\"h-4 w-4\" />\n {t(\"Transfer ownership\")}\n </Button>\n\n <Dialog open={open} onOpenChange={(next) => { if (!next) close(); }}>\n <DialogContent className=\"max-w-[calc(100%-6px)] sm:max-w-md p-0 overflow-hidden gap-0 rounded-2xl\">\n <DialogTitle className=\"sr-only\">{t(\"Transfer ownership of\")} {collectionName ?? t(\"collection\")}</DialogTitle>\n <DialogDescription className=\"sr-only\">{t(\"Transfer collection ownership.\")}</DialogDescription>\n\n {confirming ? (\n <MarketplaceConfirmStep\n description={t(\"Transfer ownership to {address}?\", { address: shortenAddress(trimmed) })}\n secondaryLabel={t(\"Back\")}\n onSecondary={() => setConfirming(false)}\n primaryLabel={t(\"Transfer ownership\")}\n onPrimary={transfer}\n primaryIcon={<UserRoundCog className=\"h-4 w-4\" />}\n />\n ) : (\n <div className=\"p-6 space-y-4\">\n <div className=\"flex items-center gap-2\">\n <UserRoundCog className=\"h-5 w-5\" />\n <p className=\"font-bold text-lg\">{t(\"Transfer collection ownership\")}</p>\n </div>\n <p className=\"text-sm text-muted-foreground\">\n {t(\"The new owner controls minting.\")}\n </p>\n <div className=\"space-y-2\">\n <Label htmlFor=\"new-owner\">{t(\"New owner address\")}</Label>\n <Input\n id=\"new-owner\"\n placeholder=\"0x…\"\n value={newOwner}\n onChange={(e) => setNewOwner(e.target.value)}\n className=\"tabular-nums text-sm\"\n spellCheck={false}\n autoComplete=\"off\"\n />\n {trimmed && !isValid && <p className=\"text-xs text-destructive\">{t(\"Not a valid Starknet address.\")}</p>}\n {wouldNoop && <p className=\"text-xs text-brand-orange\">{t(\"This is already the current owner.\")}</p>}\n </div>\n <div className=\"flex gap-2 pt-2\">\n <Button variant=\"ghost\" className=\"flex-1\" onClick={close}>\n {t(\"Cancel\")}\n </Button>\n <Button className=\"flex-1\" onClick={() => setConfirming(true)} disabled={!isValid || wouldNoop || !app.walletAddress}>\n {t(\"Continue\")}\n </Button>\n </div>\n </div>\n )}\n </DialogContent>\n </Dialog>\n\n <TransactionDialog tx={tx} title={t(\"Transfer ownership\")} workingLabel=\"Transferring ownership…\" firstStepLabel=\"Prepare transfer\">\n <TransactionSuccess\n name={collectionName ?? \"Collection\"}\n {...successMessages.ownershipTransferred({ name: collectionName ?? \"the collection\", to: shortenAddress(trimmed) }, t)}\n txHash={tx.txHash}\n actions={[{ label: t(\"Done\"), onClick: tx.reset }]}\n />\n </TransactionDialog>\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAyDI;AAvDJ,mBAAyB;AACzB,0BAA6B;AAC7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A6B,YAAE,oCAAoC,GAAE;AAAA,WAClG;AAAA,QACA,6CAAC,SAAI,WAAU,mBACb;AAAA,sDAAC,wBAAO,SAAQ,SAAQ,WAAU,UAAS,SAAS,OACjD,YAAE,QAAQ,GACb;AAAA,UACA,4CAAC,wBAAO,WAAU,UAAS,SAAS,MAAM,cAAc,IAAI,GAAG,UAAU,CAAC,WAAW,aAAa,CAAC,IAAI,eACpG,YAAE,UAAU,GACf;AAAA,WACF;AAAA,SACF;AAAA,OAEJ,GACF;AAAA,IAEA,4CAAC,+CAAkB,IAAQ,OAAO,EAAE,oBAAoB,GAAG,cAAa,gCAA0B,gBAAe,oBAC/G;AAAA,MAAC;AAAA;AAAA,QACC,MAAM,kBAAkB;AAAA,QACvB,GAAG,wCAAgB,qBAAqB,EAAE,MAAM,kBAAkB,kBAAkB,QAAI,+BAAe,OAAO,EAAE,GAAG,CAAC;AAAA,QACrH,QAAQ,GAAG;AAAA,QACX,SAAS,CAAC,EAAE,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAAC;AAAA;AAAA,IACnD,GACF;AAAA,KACF;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../src/components/transfer-collection-ownership.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport { UserRoundCog } from \"lucide-react\";\nimport { normalizeAddress } from \"@medialane/sdk\";\nimport { Button } from \"./button.js\";\nimport { Dialog, DialogContent, DialogDescription, DialogTitle } from \"./dialog.js\";\nimport { Input } from \"./input.js\";\nimport { Label } from \"./label.js\";\nimport { MarketplaceConfirmStep } from \"./marketplace-dialog-primitives.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\nimport { TransactionDialog } from \"./transaction-dialog.js\";\nimport { TransactionSuccess } from \"./transaction-success.js\";\nimport { shortenAddress } from \"../utils/address.js\";\nimport { runIntentCalls } from \"../utils/run-intent-calls.js\";\nimport { successMessages } from \"../utils/success-messages.js\";\nimport { useTransaction } from \"../utils/use-transaction.js\";\nimport { useT } from \"../i18n/provider.js\";\n\nexport interface TransferCollectionOwnershipProps {\n collectionId: string;\n currentOwner: string;\n collectionName?: string | null;\n onTransferred?: () => void;\n}\n\nexport function TransferCollectionOwnership({ collectionId, currentOwner, collectionName, onTransferred }: TransferCollectionOwnershipProps) {\n const t = useT();\n const app = useMedialaneApp();\n const tx = useTransaction();\n const [open, setOpen] = useState(false);\n const [confirming, setConfirming] = useState(false);\n const [newOwner, setNewOwner] = useState(\"\");\n\n const trimmed = newOwner.trim();\n const isValid = /^0x[0-9a-fA-F]{1,64}$/.test(trimmed);\n const wouldNoop = isValid && normalizeAddress(\"STARKNET\", trimmed) === normalizeAddress(\"STARKNET\", currentOwner);\n\n const close = () => {\n setOpen(false);\n setConfirming(false);\n };\n\n const transfer = () => {\n close();\n void tx\n .run(async (signer) => {\n await runIntentCalls(signer, () =>\n app.getClient().createIntent(\"transfer-collection-ownership\", { owner: signer.address, collectionId: String(collectionId), newOwner: trimmed }),\n );\n })\n .then((ok) => {\n if (ok) onTransferred?.();\n });\n };\n\n return (\n <>\n <Button variant=\"soft\" size=\"sm\" className=\"gap-2\" onClick={() => { setNewOwner(\"\"); setOpen(true); }}>\n <UserRoundCog className=\"h-4 w-4\" />\n {t(\"Transfer ownership\")}\n </Button>\n\n <Dialog open={open} onOpenChange={(next) => { if (!next) close(); }}>\n <DialogContent className=\"max-w-[calc(100%-6px)] sm:max-w-md p-0 overflow-hidden gap-0 rounded-2xl\">\n <DialogTitle className=\"sr-only\">{t(\"Transfer ownership of\")} {collectionName ?? t(\"collection\")}</DialogTitle>\n <DialogDescription className=\"sr-only\">{t(\"Transfer collection ownership.\")}</DialogDescription>\n\n {confirming ? (\n <MarketplaceConfirmStep\n description={t(\"Transfer ownership to {address}?\", { address: shortenAddress(trimmed) })}\n secondaryLabel={t(\"Back\")}\n onSecondary={() => setConfirming(false)}\n primaryLabel={t(\"Transfer ownership\")}\n onPrimary={transfer}\n primaryIcon={<UserRoundCog className=\"h-4 w-4\" />}\n />\n ) : (\n <div className=\"p-6 space-y-4\">\n <div className=\"flex items-center gap-2\">\n <UserRoundCog className=\"h-5 w-5\" />\n <p className=\"font-bold text-lg\">{t(\"Transfer collection ownership\")}</p>\n </div>\n <p className=\"text-sm text-muted-foreground\">\n {t(\"The new owner controls minting.\")}\n </p>\n <div className=\"space-y-2\">\n <Label htmlFor=\"new-owner\">{t(\"New owner address\")}</Label>\n <Input\n id=\"new-owner\"\n placeholder=\"0x…\"\n value={newOwner}\n onChange={(e) => setNewOwner(e.target.value)}\n className=\"tabular-nums text-sm\"\n spellCheck={false}\n autoComplete=\"off\"\n />\n {trimmed && !isValid && <p className=\"text-xs text-destructive\">{t(\"Not a valid Starknet address.\")}</p>}\n {wouldNoop && <p className=\"text-xs text-brand-orange\">{t(\"This is already the current owner.\")}</p>}\n </div>\n <div className=\"flex gap-2 pt-2\">\n <Button variant=\"ghost\" className=\"flex-1\" onClick={close}>\n {t(\"Cancel\")}\n </Button>\n <Button className=\"flex-1\" onClick={() => setConfirming(true)} disabled={!isValid || wouldNoop || !app.walletAddress}>\n {t(\"Continue\")}\n </Button>\n </div>\n </div>\n )}\n </DialogContent>\n </Dialog>\n\n <TransactionDialog tx={tx} title={t(\"Transfer ownership\")} workingLabel={t(\"Transferring ownership…\")} firstStepLabel={t(\"Prepare transfer\")}>\n <TransactionSuccess\n name={collectionName ?? \"Collection\"}\n {...successMessages.ownershipTransferred({ name: collectionName ?? \"the collection\", to: shortenAddress(trimmed) }, t)}\n txHash={tx.txHash}\n actions={[{ label: t(\"Done\"), onClick: tx.reset }]}\n />\n </TransactionDialog>\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAyDI;AAvDJ,mBAAyB;AACzB,0BAA6B;AAC7B,iBAAiC;AACjC,oBAAuB;AACvB,oBAAsE;AACtE,mBAAsB;AACtB,mBAAsB;AACtB,2CAAuC;AACvC,2BAAgC;AAChC,gCAAkC;AAClC,iC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SAAS,OACjD,YAAE,QAAQ,GACb;AAAA,UACA,4CAAC,wBAAO,WAAU,UAAS,SAAS,MAAM,cAAc,IAAI,GAAG,UAAU,CAAC,WAAW,aAAa,CAAC,IAAI,eACpG,YAAE,UAAU,GACf;AAAA,WACF;AAAA,SACF;AAAA,OAEJ,GACF;AAAA,IAEA,4CAAC,+CAAkB,IAAQ,OAAO,EAAE,oBAAoB,GAAG,cAAc,EAAE,8BAAyB,GAAG,gBAAgB,EAAE,kBAAkB,GACzI;AAAA,MAAC;AAAA;AAAA,QACC,MAAM,kBAAkB;AAAA,QACvB,GAAG,wCAAgB,qBAAqB,EAAE,MAAM,kBAAkB,kBAAkB,QAAI,+BAAe,OAAO,EAAE,GAAG,CAAC;AAAA,QACrH,QAAQ,GAAG;AAAA,QACX,SAAS,CAAC,EAAE,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAAC;AAAA;AAAA,IACnD,GACF;AAAA,KACF;AAEJ;","names":[]}
@@ -97,7 +97,7 @@ function TransferCollectionOwnership({ collectionId, currentOwner, collectionNam
97
97
  ] })
98
98
  ] })
99
99
  ] }) }),
100
- /* @__PURE__ */ jsx(TransactionDialog, { tx, title: t("Transfer ownership"), workingLabel: "Transferring ownership\u2026", firstStepLabel: "Prepare transfer", children: /* @__PURE__ */ jsx(
100
+ /* @__PURE__ */ jsx(TransactionDialog, { tx, title: t("Transfer ownership"), workingLabel: t("Transferring ownership\u2026"), firstStepLabel: t("Prepare transfer"), children: /* @__PURE__ */ jsx(
101
101
  TransactionSuccess,
102
102
  {
103
103
  name: collectionName ?? "Collection",
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/transfer-collection-ownership.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport { UserRoundCog } from \"lucide-react\";\nimport { normalizeAddress } from \"@medialane/sdk\";\nimport { Button } from \"./button.js\";\nimport { Dialog, DialogContent, DialogDescription, DialogTitle } from \"./dialog.js\";\nimport { Input } from \"./input.js\";\nimport { Label } from \"./label.js\";\nimport { MarketplaceConfirmStep } from \"./marketplace-dialog-primitives.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\nimport { TransactionDialog } from \"./transaction-dialog.js\";\nimport { TransactionSuccess } from \"./transaction-success.js\";\nimport { shortenAddress } from \"../utils/address.js\";\nimport { runIntentCalls } from \"../utils/run-intent-calls.js\";\nimport { successMessages } from \"../utils/success-messages.js\";\nimport { useTransaction } from \"../utils/use-transaction.js\";\nimport { useT } from \"../i18n/provider.js\";\n\nexport interface TransferCollectionOwnershipProps {\n collectionId: string;\n currentOwner: string;\n collectionName?: string | null;\n onTransferred?: () => void;\n}\n\nexport function TransferCollectionOwnership({ collectionId, currentOwner, collectionName, onTransferred }: TransferCollectionOwnershipProps) {\n const t = useT();\n const app = useMedialaneApp();\n const tx = useTransaction();\n const [open, setOpen] = useState(false);\n const [confirming, setConfirming] = useState(false);\n const [newOwner, setNewOwner] = useState(\"\");\n\n const trimmed = newOwner.trim();\n const isValid = /^0x[0-9a-fA-F]{1,64}$/.test(trimmed);\n const wouldNoop = isValid && normalizeAddress(\"STARKNET\", trimmed) === normalizeAddress(\"STARKNET\", currentOwner);\n\n const close = () => {\n setOpen(false);\n setConfirming(false);\n };\n\n const transfer = () => {\n close();\n void tx\n .run(async (signer) => {\n await runIntentCalls(signer, () =>\n app.getClient().createIntent(\"transfer-collection-ownership\", { owner: signer.address, collectionId: String(collectionId), newOwner: trimmed }),\n );\n })\n .then((ok) => {\n if (ok) onTransferred?.();\n });\n };\n\n return (\n <>\n <Button variant=\"soft\" size=\"sm\" className=\"gap-2\" onClick={() => { setNewOwner(\"\"); setOpen(true); }}>\n <UserRoundCog className=\"h-4 w-4\" />\n {t(\"Transfer ownership\")}\n </Button>\n\n <Dialog open={open} onOpenChange={(next) => { if (!next) close(); }}>\n <DialogContent className=\"max-w-[calc(100%-6px)] sm:max-w-md p-0 overflow-hidden gap-0 rounded-2xl\">\n <DialogTitle className=\"sr-only\">{t(\"Transfer ownership of\")} {collectionName ?? t(\"collection\")}</DialogTitle>\n <DialogDescription className=\"sr-only\">{t(\"Transfer collection ownership.\")}</DialogDescription>\n\n {confirming ? (\n <MarketplaceConfirmStep\n description={t(\"Transfer ownership to {address}?\", { address: shortenAddress(trimmed) })}\n secondaryLabel={t(\"Back\")}\n onSecondary={() => setConfirming(false)}\n primaryLabel={t(\"Transfer ownership\")}\n onPrimary={transfer}\n primaryIcon={<UserRoundCog className=\"h-4 w-4\" />}\n />\n ) : (\n <div className=\"p-6 space-y-4\">\n <div className=\"flex items-center gap-2\">\n <UserRoundCog className=\"h-5 w-5\" />\n <p className=\"font-bold text-lg\">{t(\"Transfer collection ownership\")}</p>\n </div>\n <p className=\"text-sm text-muted-foreground\">\n {t(\"The new owner controls minting.\")}\n </p>\n <div className=\"space-y-2\">\n <Label htmlFor=\"new-owner\">{t(\"New owner address\")}</Label>\n <Input\n id=\"new-owner\"\n placeholder=\"0x…\"\n value={newOwner}\n onChange={(e) => setNewOwner(e.target.value)}\n className=\"tabular-nums text-sm\"\n spellCheck={false}\n autoComplete=\"off\"\n />\n {trimmed && !isValid && <p className=\"text-xs text-destructive\">{t(\"Not a valid Starknet address.\")}</p>}\n {wouldNoop && <p className=\"text-xs text-brand-orange\">{t(\"This is already the current owner.\")}</p>}\n </div>\n <div className=\"flex gap-2 pt-2\">\n <Button variant=\"ghost\" className=\"flex-1\" onClick={close}>\n {t(\"Cancel\")}\n </Button>\n <Button className=\"flex-1\" onClick={() => setConfirming(true)} disabled={!isValid || wouldNoop || !app.walletAddress}>\n {t(\"Continue\")}\n </Button>\n </div>\n </div>\n )}\n </DialogContent>\n </Dialog>\n\n <TransactionDialog tx={tx} title={t(\"Transfer ownership\")} workingLabel=\"Transferring ownership…\" firstStepLabel=\"Prepare transfer\">\n <TransactionSuccess\n name={collectionName ?? \"Collection\"}\n {...successMessages.ownershipTransferred({ name: collectionName ?? \"the collection\", to: shortenAddress(trimmed) }, t)}\n txHash={tx.txHash}\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,UAAU,CAAC,MAAM,YAAY,EAAE,OAAO,KAAK;AAAA,cAC3C,WAAU;AAAA,cACV,YAAY;AAAA,cACZ,cAAa;AAAA;AAAA,UACf;AAAA,UACC,WAAW,CAAC,WAAW,oBAAC,OAAE,WAAU,4BAA4B,YAAE,+BAA+B,GAAE;AAAA,UACnG,aAAa,oBAAC,OAAE,WAAU,6BAA6B,YAAE,oCAAoC,GAAE;AAAA,WAClG;AAAA,QACA,qBAAC,SAAI,WAAU,mBACb;AAAA,8BAAC,UAAO,SAAQ,SAAQ,WAAU,UAAS,SAAS,OACjD,YAAE,QAAQ,GACb;AAAA,UACA,oBAAC,UAAO,WAAU,UAAS,SAAS,MAAM,cAAc,IAAI,GAAG,UAAU,CAAC,WAAW,aAAa,CAAC,IAAI,eACpG,YAAE,UAAU,GACf;AAAA,WACF;AAAA,SACF;AAAA,OAEJ,GACF;AAAA,IAEA,oBAAC,qBAAkB,IAAQ,OAAO,EAAE,oBAAoB,GAAG,cAAa,gCAA0B,gBAAe,oBAC/G;AAAA,MAAC;AAAA;AAAA,QACC,MAAM,kBAAkB;AAAA,QACvB,GAAG,gBAAgB,qBAAqB,EAAE,MAAM,kBAAkB,kBAAkB,IAAI,eAAe,OAAO,EAAE,GAAG,CAAC;AAAA,QACrH,QAAQ,GAAG;AAAA,QACX,SAAS,CAAC,EAAE,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAAC;AAAA;AAAA,IACnD,GACF;AAAA,KACF;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../src/components/transfer-collection-ownership.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport { UserRoundCog } from \"lucide-react\";\nimport { normalizeAddress } from \"@medialane/sdk\";\nimport { Button } from \"./button.js\";\nimport { Dialog, DialogContent, DialogDescription, DialogTitle } from \"./dialog.js\";\nimport { Input } from \"./input.js\";\nimport { Label } from \"./label.js\";\nimport { MarketplaceConfirmStep } from \"./marketplace-dialog-primitives.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\nimport { TransactionDialog } from \"./transaction-dialog.js\";\nimport { TransactionSuccess } from \"./transaction-success.js\";\nimport { shortenAddress } from \"../utils/address.js\";\nimport { runIntentCalls } from \"../utils/run-intent-calls.js\";\nimport { successMessages } from \"../utils/success-messages.js\";\nimport { useTransaction } from \"../utils/use-transaction.js\";\nimport { useT } from \"../i18n/provider.js\";\n\nexport interface TransferCollectionOwnershipProps {\n collectionId: string;\n currentOwner: string;\n collectionName?: string | null;\n onTransferred?: () => void;\n}\n\nexport function TransferCollectionOwnership({ collectionId, currentOwner, collectionName, onTransferred }: TransferCollectionOwnershipProps) {\n const t = useT();\n const app = useMedialaneApp();\n const tx = useTransaction();\n const [open, setOpen] = useState(false);\n const [confirming, setConfirming] = useState(false);\n const [newOwner, setNewOwner] = useState(\"\");\n\n const trimmed = newOwner.trim();\n const isValid = /^0x[0-9a-fA-F]{1,64}$/.test(trimmed);\n const wouldNoop = isValid && normalizeAddress(\"STARKNET\", trimmed) === normalizeAddress(\"STARKNET\", currentOwner);\n\n const close = () => {\n setOpen(false);\n setConfirming(false);\n };\n\n const transfer = () => {\n close();\n void tx\n .run(async (signer) => {\n await runIntentCalls(signer, () =>\n app.getClient().createIntent(\"transfer-collection-ownership\", { owner: signer.address, collectionId: String(collectionId), newOwner: trimmed }),\n );\n })\n .then((ok) => {\n if (ok) onTransferred?.();\n });\n };\n\n return (\n <>\n <Button variant=\"soft\" size=\"sm\" className=\"gap-2\" onClick={() => { setNewOwner(\"\"); setOpen(true); }}>\n <UserRoundCog className=\"h-4 w-4\" />\n {t(\"Transfer ownership\")}\n </Button>\n\n <Dialog open={open} onOpenChange={(next) => { if (!next) close(); }}>\n <DialogContent className=\"max-w-[calc(100%-6px)] sm:max-w-md p-0 overflow-hidden gap-0 rounded-2xl\">\n <DialogTitle className=\"sr-only\">{t(\"Transfer ownership of\")} {collectionName ?? t(\"collection\")}</DialogTitle>\n <DialogDescription className=\"sr-only\">{t(\"Transfer collection ownership.\")}</DialogDescription>\n\n {confirming ? (\n <MarketplaceConfirmStep\n description={t(\"Transfer ownership to {address}?\", { address: shortenAddress(trimmed) })}\n secondaryLabel={t(\"Back\")}\n onSecondary={() => setConfirming(false)}\n primaryLabel={t(\"Transfer ownership\")}\n onPrimary={transfer}\n primaryIcon={<UserRoundCog className=\"h-4 w-4\" />}\n />\n ) : (\n <div className=\"p-6 space-y-4\">\n <div className=\"flex items-center gap-2\">\n <UserRoundCog className=\"h-5 w-5\" />\n <p className=\"font-bold text-lg\">{t(\"Transfer collection ownership\")}</p>\n </div>\n <p className=\"text-sm text-muted-foreground\">\n {t(\"The new owner controls minting.\")}\n </p>\n <div className=\"space-y-2\">\n <Label htmlFor=\"new-owner\">{t(\"New owner address\")}</Label>\n <Input\n id=\"new-owner\"\n placeholder=\"0x…\"\n value={newOwner}\n onChange={(e) => setNewOwner(e.target.value)}\n className=\"tabular-nums text-sm\"\n spellCheck={false}\n autoComplete=\"off\"\n />\n {trimmed && !isValid && <p className=\"text-xs text-destructive\">{t(\"Not a valid Starknet address.\")}</p>}\n {wouldNoop && <p className=\"text-xs text-brand-orange\">{t(\"This is already the current owner.\")}</p>}\n </div>\n <div className=\"flex gap-2 pt-2\">\n <Button variant=\"ghost\" className=\"flex-1\" onClick={close}>\n {t(\"Cancel\")}\n </Button>\n <Button className=\"flex-1\" onClick={() => setConfirming(true)} disabled={!isValid || wouldNoop || !app.walletAddress}>\n {t(\"Continue\")}\n </Button>\n </div>\n </div>\n )}\n </DialogContent>\n </Dialog>\n\n <TransactionDialog tx={tx} title={t(\"Transfer ownership\")} workingLabel={t(\"Transferring ownership…\")} firstStepLabel={t(\"Prepare transfer\")}>\n <TransactionSuccess\n name={collectionName ?? \"Collection\"}\n {...successMessages.ownershipTransferred({ name: collectionName ?? \"the collection\", to: shortenAddress(trimmed) }, t)}\n txHash={tx.txHash}\n actions={[{ label: t(\"Done\"), onClick: tx.reset }]}\n />\n </TransactionDialog>\n </>\n );\n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AAA,cACV,YAAY;AAAA,cACZ,cAAa;AAAA;AAAA,UACf;AAAA,UACC,WAAW,CAAC,WAAW,oBAAC,OAAE,WAAU,4BAA4B,YAAE,+BAA+B,GAAE;AAAA,UACnG,aAAa,oBAAC,OAAE,WAAU,6BAA6B,YAAE,oCAAoC,GAAE;AAAA,WAClG;AAAA,QACA,qBAAC,SAAI,WAAU,mBACb;AAAA,8BAAC,UAAO,SAAQ,SAAQ,WAAU,UAAS,SAAS,OACjD,YAAE,QAAQ,GACb;AAAA,UACA,oBAAC,UAAO,WAAU,UAAS,SAAS,MAAM,cAAc,IAAI,GAAG,UAAU,CAAC,WAAW,aAAa,CAAC,IAAI,eACpG,YAAE,UAAU,GACf;AAAA,WACF;AAAA,SACF;AAAA,OAEJ,GACF;AAAA,IAEA,oBAAC,qBAAkB,IAAQ,OAAO,EAAE,oBAAoB,GAAG,cAAc,EAAE,8BAAyB,GAAG,gBAAgB,EAAE,kBAAkB,GACzI;AAAA,MAAC;AAAA;AAAA,QACC,MAAM,kBAAkB;AAAA,QACvB,GAAG,gBAAgB,qBAAqB,EAAE,MAAM,kBAAkB,kBAAkB,IAAI,eAAe,OAAO,EAAE,GAAG,CAAC;AAAA,QACrH,QAAQ,GAAG;AAAA,QACX,SAAS,CAAC,EAAE,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAAC;AAAA;AAAA,IACnD,GACF;AAAA,KACF;AAEJ;","names":[]}
@@ -24,28 +24,18 @@ __export(wallet_required_exports, {
24
24
  module.exports = __toCommonJS(wallet_required_exports);
25
25
  var import_jsx_runtime = require("react/jsx-runtime");
26
26
  var import_lucide_react = require("lucide-react");
27
- var import_skeleton = require("./skeleton.js");
27
+ var import_page_state = require("./page-state.js");
28
28
  var import_medialane_app = require("./medialane-app.js");
29
29
  var import_provider = require("../i18n/provider.js");
30
30
  var import_action_button = require("./action-button.js");
31
- function WalletRequired({ icon: Icon, iconClassName = "text-muted-foreground", title, description, children }) {
31
+ function WalletRequired({ icon: Icon, iconClassName, title, description, children }) {
32
32
  const t = (0, import_provider.useT)();
33
33
  const { walletAddress, walletLoading, onRequireWallet, connectLabel } = (0, import_medialane_app.useMedialaneApp)();
34
34
  if (walletAddress) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children });
35
35
  if (walletLoading) {
36
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "max-w-lg mx-auto px-4 pt-24 pb-8 space-y-4", children: [
37
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, { className: "h-10 w-10 rounded-full mx-auto" }),
38
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, { className: "h-7 w-56 mx-auto" }),
39
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, { className: "h-4 w-72 mx-auto" }),
40
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, { className: "h-10 w-44 mx-auto rounded-xl" })
41
- ] });
36
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_page_state.PageStateSkeleton, { action: true });
42
37
  }
43
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "max-w-lg mx-auto px-4 pt-24 pb-8 text-center space-y-4", children: [
44
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, { className: `h-10 w-10 mx-auto ${iconClassName}` }),
45
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h1", { className: "text-2xl font-bold", children: title }),
46
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-muted-foreground", children: description }),
47
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_action_button.ActionButton, { solid: true, onClick: onRequireWallet, icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Wallet, { className: "h-4 w-4" }), children: connectLabel ?? t("Connect") })
48
- ] });
38
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_page_state.PageState, { icon: Icon, iconClassName, title, description, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_action_button.ActionButton, { solid: true, onClick: onRequireWallet, icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Wallet, { className: "h-4 w-4" }), children: connectLabel ?? t("Connect") }) });
49
39
  }
50
40
  // Annotate the CommonJS export names for ESM import in node:
51
41
  0 && (module.exports = {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/wallet-required.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ElementType, ReactNode } from \"react\";\nimport { Wallet } from \"lucide-react\";\nimport { Skeleton } from \"./skeleton.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\nimport { useT } from \"../i18n/provider.js\";\nimport { ActionButton } from \"./action-button.js\";\n\nexport interface WalletRequiredProps {\n icon: ElementType;\n iconClassName?: string;\n title: string;\n description: string;\n children: ReactNode;\n}\n\nexport function WalletRequired({ icon: Icon, iconClassName = \"text-muted-foreground\", title, description, children }: WalletRequiredProps) {\n const t = useT();\n const { walletAddress, walletLoading, onRequireWallet, connectLabel } = useMedialaneApp();\n\n if (walletAddress) return <>{children}</>;\n\n if (walletLoading) {\n return (\n <div className=\"max-w-lg mx-auto px-4 pt-24 pb-8 space-y-4\">\n <Skeleton className=\"h-10 w-10 rounded-full mx-auto\" />\n <Skeleton className=\"h-7 w-56 mx-auto\" />\n <Skeleton className=\"h-4 w-72 mx-auto\" />\n <Skeleton className=\"h-10 w-44 mx-auto rounded-xl\" />\n </div>\n );\n }\n\n return (\n <div className=\"max-w-lg mx-auto px-4 pt-24 pb-8 text-center space-y-4\">\n <Icon className={`h-10 w-10 mx-auto ${iconClassName}`} />\n <h1 className=\"text-2xl font-bold\">{title}</h1>\n <p className=\"text-muted-foreground\">{description}</p>\n <ActionButton solid onClick={onRequireWallet} icon={<Wallet className=\"h-4 w-4\" />}>\n {connectLabel ?? t(\"Connect\")}\n </ActionButton>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAqB4B;AAlB5B,0BAAuB;AACvB,sBAAyB;AACzB,2BAAgC;AAChC,sBAAqB;AACrB,2BAA6B;AAUtB,SAAS,eAAe,EAAE,MAAM,MAAM,gBAAgB,yBAAyB,OAAO,aAAa,SAAS,GAAwB;AACzI,QAAM,QAAI,sBAAK;AACf,QAAM,EAAE,eAAe,eAAe,iBAAiB,aAAa,QAAI,sCAAgB;AAExF,MAAI,cAAe,QAAO,2EAAG,UAAS;AAEtC,MAAI,eAAe;AACjB,WACE,6CAAC,SAAI,WAAU,8CACb;AAAA,kDAAC,4BAAS,WAAU,kCAAiC;AAAA,MACrD,4CAAC,4BAAS,WAAU,oBAAmB;AAAA,MACvC,4CAAC,4BAAS,WAAU,oBAAmB;AAAA,MACvC,4CAAC,4BAAS,WAAU,gCAA+B;AAAA,OACrD;AAAA,EAEJ;AAEA,SACE,6CAAC,SAAI,WAAU,0DACb;AAAA,gDAAC,QAAK,WAAW,qBAAqB,aAAa,IAAI;AAAA,IACvD,4CAAC,QAAG,WAAU,sBAAsB,iBAAM;AAAA,IAC1C,4CAAC,OAAE,WAAU,yBAAyB,uBAAY;AAAA,IAClD,4CAAC,qCAAa,OAAK,MAAC,SAAS,iBAAiB,MAAM,4CAAC,8BAAO,WAAU,WAAU,GAC7E,0BAAgB,EAAE,SAAS,GAC9B;AAAA,KACF;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../src/components/wallet-required.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ElementType, ReactNode } from \"react\";\nimport { Wallet } from \"lucide-react\";\nimport { PageState, PageStateSkeleton } from \"./page-state.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\nimport { useT } from \"../i18n/provider.js\";\nimport { ActionButton } from \"./action-button.js\";\n\nexport interface WalletRequiredProps {\n icon: ElementType;\n iconClassName?: string;\n title: string;\n description: string;\n children: ReactNode;\n}\n\nexport function WalletRequired({ icon: Icon, iconClassName, title, description, children }: WalletRequiredProps) {\n const t = useT();\n const { walletAddress, walletLoading, onRequireWallet, connectLabel } = useMedialaneApp();\n\n if (walletAddress) return <>{children}</>;\n\n if (walletLoading) {\n return (\n <PageStateSkeleton action />\n );\n }\n\n return (\n <PageState icon={Icon} iconClassName={iconClassName} title={title} description={description}>\n <ActionButton solid onClick={onRequireWallet} icon={<Wallet className=\"h-4 w-4\" />}>\n {connectLabel ?? t(\"Connect\")}\n </ActionButton>\n </PageState>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAqB4B;AAlB5B,0BAAuB;AACvB,wBAA6C;AAC7C,2BAAgC;AAChC,sBAAqB;AACrB,2BAA6B;AAUtB,SAAS,eAAe,EAAE,MAAM,MAAM,eAAe,OAAO,aAAa,SAAS,GAAwB;AAC/G,QAAM,QAAI,sBAAK;AACf,QAAM,EAAE,eAAe,eAAe,iBAAiB,aAAa,QAAI,sCAAgB;AAExF,MAAI,cAAe,QAAO,2EAAG,UAAS;AAEtC,MAAI,eAAe;AACjB,WACE,4CAAC,uCAAkB,QAAM,MAAC;AAAA,EAE9B;AAEA,SACE,4CAAC,+BAAU,MAAM,MAAM,eAA8B,OAAc,aACjE,sDAAC,qCAAa,OAAK,MAAC,SAAS,iBAAiB,MAAM,4CAAC,8BAAO,WAAU,WAAU,GAC7E,0BAAgB,EAAE,SAAS,GAC9B,GACF;AAEJ;","names":[]}
@@ -1,28 +1,18 @@
1
1
  "use client";
2
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
+ import { Fragment, jsx } from "react/jsx-runtime";
3
3
  import { Wallet } from "lucide-react";
4
- import { Skeleton } from "./skeleton.js";
4
+ import { PageState, PageStateSkeleton } from "./page-state.js";
5
5
  import { useMedialaneApp } from "./medialane-app.js";
6
6
  import { useT } from "../i18n/provider.js";
7
7
  import { ActionButton } from "./action-button.js";
8
- function WalletRequired({ icon: Icon, iconClassName = "text-muted-foreground", title, description, children }) {
8
+ function WalletRequired({ icon: Icon, iconClassName, title, description, children }) {
9
9
  const t = useT();
10
10
  const { walletAddress, walletLoading, onRequireWallet, connectLabel } = useMedialaneApp();
11
11
  if (walletAddress) return /* @__PURE__ */ jsx(Fragment, { children });
12
12
  if (walletLoading) {
13
- return /* @__PURE__ */ jsxs("div", { className: "max-w-lg mx-auto px-4 pt-24 pb-8 space-y-4", children: [
14
- /* @__PURE__ */ jsx(Skeleton, { className: "h-10 w-10 rounded-full mx-auto" }),
15
- /* @__PURE__ */ jsx(Skeleton, { className: "h-7 w-56 mx-auto" }),
16
- /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-72 mx-auto" }),
17
- /* @__PURE__ */ jsx(Skeleton, { className: "h-10 w-44 mx-auto rounded-xl" })
18
- ] });
13
+ return /* @__PURE__ */ jsx(PageStateSkeleton, { action: true });
19
14
  }
20
- return /* @__PURE__ */ jsxs("div", { className: "max-w-lg mx-auto px-4 pt-24 pb-8 text-center space-y-4", children: [
21
- /* @__PURE__ */ jsx(Icon, { className: `h-10 w-10 mx-auto ${iconClassName}` }),
22
- /* @__PURE__ */ jsx("h1", { className: "text-2xl font-bold", children: title }),
23
- /* @__PURE__ */ jsx("p", { className: "text-muted-foreground", children: description }),
24
- /* @__PURE__ */ jsx(ActionButton, { solid: true, onClick: onRequireWallet, icon: /* @__PURE__ */ jsx(Wallet, { className: "h-4 w-4" }), children: connectLabel ?? t("Connect") })
25
- ] });
15
+ return /* @__PURE__ */ jsx(PageState, { icon: Icon, iconClassName, title, description, children: /* @__PURE__ */ jsx(ActionButton, { solid: true, onClick: onRequireWallet, icon: /* @__PURE__ */ jsx(Wallet, { className: "h-4 w-4" }), children: connectLabel ?? t("Connect") }) });
26
16
  }
27
17
  export {
28
18
  WalletRequired
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/wallet-required.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ElementType, ReactNode } from \"react\";\nimport { Wallet } from \"lucide-react\";\nimport { Skeleton } from \"./skeleton.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\nimport { useT } from \"../i18n/provider.js\";\nimport { ActionButton } from \"./action-button.js\";\n\nexport interface WalletRequiredProps {\n icon: ElementType;\n iconClassName?: string;\n title: string;\n description: string;\n children: ReactNode;\n}\n\nexport function WalletRequired({ icon: Icon, iconClassName = \"text-muted-foreground\", title, description, children }: WalletRequiredProps) {\n const t = useT();\n const { walletAddress, walletLoading, onRequireWallet, connectLabel } = useMedialaneApp();\n\n if (walletAddress) return <>{children}</>;\n\n if (walletLoading) {\n return (\n <div className=\"max-w-lg mx-auto px-4 pt-24 pb-8 space-y-4\">\n <Skeleton className=\"h-10 w-10 rounded-full mx-auto\" />\n <Skeleton className=\"h-7 w-56 mx-auto\" />\n <Skeleton className=\"h-4 w-72 mx-auto\" />\n <Skeleton className=\"h-10 w-44 mx-auto rounded-xl\" />\n </div>\n );\n }\n\n return (\n <div className=\"max-w-lg mx-auto px-4 pt-24 pb-8 text-center space-y-4\">\n <Icon className={`h-10 w-10 mx-auto ${iconClassName}`} />\n <h1 className=\"text-2xl font-bold\">{title}</h1>\n <p className=\"text-muted-foreground\">{description}</p>\n <ActionButton solid onClick={onRequireWallet} icon={<Wallet className=\"h-4 w-4\" />}>\n {connectLabel ?? t(\"Connect\")}\n </ActionButton>\n </div>\n );\n}\n"],"mappings":";AAqB4B,wBAItB,YAJsB;AAlB5B,SAAS,cAAc;AACvB,SAAS,gBAAgB;AACzB,SAAS,uBAAuB;AAChC,SAAS,YAAY;AACrB,SAAS,oBAAoB;AAUtB,SAAS,eAAe,EAAE,MAAM,MAAM,gBAAgB,yBAAyB,OAAO,aAAa,SAAS,GAAwB;AACzI,QAAM,IAAI,KAAK;AACf,QAAM,EAAE,eAAe,eAAe,iBAAiB,aAAa,IAAI,gBAAgB;AAExF,MAAI,cAAe,QAAO,gCAAG,UAAS;AAEtC,MAAI,eAAe;AACjB,WACE,qBAAC,SAAI,WAAU,8CACb;AAAA,0BAAC,YAAS,WAAU,kCAAiC;AAAA,MACrD,oBAAC,YAAS,WAAU,oBAAmB;AAAA,MACvC,oBAAC,YAAS,WAAU,oBAAmB;AAAA,MACvC,oBAAC,YAAS,WAAU,gCAA+B;AAAA,OACrD;AAAA,EAEJ;AAEA,SACE,qBAAC,SAAI,WAAU,0DACb;AAAA,wBAAC,QAAK,WAAW,qBAAqB,aAAa,IAAI;AAAA,IACvD,oBAAC,QAAG,WAAU,sBAAsB,iBAAM;AAAA,IAC1C,oBAAC,OAAE,WAAU,yBAAyB,uBAAY;AAAA,IAClD,oBAAC,gBAAa,OAAK,MAAC,SAAS,iBAAiB,MAAM,oBAAC,UAAO,WAAU,WAAU,GAC7E,0BAAgB,EAAE,SAAS,GAC9B;AAAA,KACF;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../src/components/wallet-required.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ElementType, ReactNode } from \"react\";\nimport { Wallet } from \"lucide-react\";\nimport { PageState, PageStateSkeleton } from \"./page-state.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\nimport { useT } from \"../i18n/provider.js\";\nimport { ActionButton } from \"./action-button.js\";\n\nexport interface WalletRequiredProps {\n icon: ElementType;\n iconClassName?: string;\n title: string;\n description: string;\n children: ReactNode;\n}\n\nexport function WalletRequired({ icon: Icon, iconClassName, title, description, children }: WalletRequiredProps) {\n const t = useT();\n const { walletAddress, walletLoading, onRequireWallet, connectLabel } = useMedialaneApp();\n\n if (walletAddress) return <>{children}</>;\n\n if (walletLoading) {\n return (\n <PageStateSkeleton action />\n );\n }\n\n return (\n <PageState icon={Icon} iconClassName={iconClassName} title={title} description={description}>\n <ActionButton solid onClick={onRequireWallet} icon={<Wallet className=\"h-4 w-4\" />}>\n {connectLabel ?? t(\"Connect\")}\n </ActionButton>\n </PageState>\n );\n}\n"],"mappings":";AAqB4B;AAlB5B,SAAS,cAAc;AACvB,SAAS,WAAW,yBAAyB;AAC7C,SAAS,uBAAuB;AAChC,SAAS,YAAY;AACrB,SAAS,oBAAoB;AAUtB,SAAS,eAAe,EAAE,MAAM,MAAM,eAAe,OAAO,aAAa,SAAS,GAAwB;AAC/G,QAAM,IAAI,KAAK;AACf,QAAM,EAAE,eAAe,eAAe,iBAAiB,aAAa,IAAI,gBAAgB;AAExF,MAAI,cAAe,QAAO,gCAAG,UAAS;AAEtC,MAAI,eAAe;AACjB,WACE,oBAAC,qBAAkB,QAAM,MAAC;AAAA,EAE9B;AAEA,SACE,oBAAC,aAAU,MAAM,MAAM,eAA8B,OAAc,aACjE,8BAAC,gBAAa,OAAK,MAAC,SAAS,iBAAiB,MAAM,oBAAC,UAAO,WAAU,WAAU,GAC7E,0BAAgB,EAAE,SAAS,GAC9B,GACF;AAEJ;","names":[]}