@flamingo-stack/openframe-frontend-core 0.0.296 → 0.0.297

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 (276) hide show
  1. package/README.md +9 -0
  2. package/dist/{chunk-7RIYT7ZH.js → chunk-2QG57XOJ.js} +1067 -205
  3. package/dist/chunk-2QG57XOJ.js.map +1 -0
  4. package/dist/{chunk-WHMATDVP.js → chunk-3JIQVE7T.js} +9 -15
  5. package/dist/{chunk-WHMATDVP.js.map → chunk-3JIQVE7T.js.map} +1 -1
  6. package/dist/{chunk-GLLDTKZK.cjs → chunk-4PSQS3SW.cjs} +7 -9
  7. package/dist/chunk-4PSQS3SW.cjs.map +1 -0
  8. package/dist/{chunk-OY7OF7E7.js → chunk-4TLE6VLU.js} +30 -24
  9. package/dist/chunk-4TLE6VLU.js.map +1 -0
  10. package/dist/{chunk-W6M2FLLT.cjs → chunk-53FUMSZ5.cjs} +40 -46
  11. package/dist/chunk-53FUMSZ5.cjs.map +1 -0
  12. package/dist/{chunk-D3LEFMOA.cjs → chunk-54KNMC2R.cjs} +3 -3
  13. package/dist/{chunk-D3LEFMOA.cjs.map → chunk-54KNMC2R.cjs.map} +1 -1
  14. package/dist/{chunk-EYEW6PTA.cjs → chunk-6C526VNN.cjs} +358 -118
  15. package/dist/chunk-6C526VNN.cjs.map +1 -0
  16. package/dist/{chunk-XREEV72C.cjs → chunk-7OVGB2DQ.cjs} +19 -25
  17. package/dist/chunk-7OVGB2DQ.cjs.map +1 -0
  18. package/dist/{chunk-6GCI7JOE.js → chunk-AD6C23QY.js} +8 -7
  19. package/dist/{chunk-6GCI7JOE.js.map → chunk-AD6C23QY.js.map} +1 -1
  20. package/dist/chunk-F5OB2YAL.cjs +144 -0
  21. package/dist/chunk-F5OB2YAL.cjs.map +1 -0
  22. package/dist/chunk-FBWXMMRB.cjs +2 -0
  23. package/dist/chunk-FBWXMMRB.cjs.map +1 -0
  24. package/dist/{chunk-YIGPRLQY.cjs → chunk-FCDQNTDG.cjs} +21 -20
  25. package/dist/chunk-FCDQNTDG.cjs.map +1 -0
  26. package/dist/{chunk-IE6OU3WQ.cjs → chunk-FQOTC3UU.cjs} +318 -16
  27. package/dist/chunk-FQOTC3UU.cjs.map +1 -0
  28. package/dist/{chunk-QHIXS3W2.cjs → chunk-GUTS7HGA.cjs} +11590 -2105
  29. package/dist/chunk-GUTS7HGA.cjs.map +1 -0
  30. package/dist/chunk-GZ4C3XW6.js +2 -0
  31. package/dist/chunk-GZ4C3XW6.js.map +1 -0
  32. package/dist/{chunk-5P3B2LZW.js → chunk-IL47XWV5.js} +8 -14
  33. package/dist/{chunk-5P3B2LZW.js.map → chunk-IL47XWV5.js.map} +1 -1
  34. package/dist/{chunk-LCNMR277.js → chunk-IZ7JSBFP.js} +1 -1
  35. package/dist/chunk-IZ7JSBFP.js.map +1 -0
  36. package/dist/{chunk-EL6QLAWX.js → chunk-JALO4TAZ.js} +357 -55
  37. package/dist/chunk-JALO4TAZ.js.map +1 -0
  38. package/dist/{chunk-AQOWFSMB.cjs → chunk-L6PSSIUQ.cjs} +1 -1
  39. package/dist/chunk-L6PSSIUQ.cjs.map +1 -0
  40. package/dist/{chunk-MBFWU2EM.js → chunk-L7ULJKG7.js} +6 -10
  41. package/dist/{chunk-MBFWU2EM.js.map → chunk-L7ULJKG7.js.map} +1 -1
  42. package/dist/{chunk-K2PFPBMF.js → chunk-PC746XCO.js} +15050 -5565
  43. package/dist/chunk-PC746XCO.js.map +1 -0
  44. package/dist/{chunk-3ZXUQQL4.js → chunk-PI4WSYQV.js} +2 -2
  45. package/dist/{chunk-E4XABBSU.js → chunk-PWQUAVA3.js} +338 -98
  46. package/dist/chunk-PWQUAVA3.js.map +1 -0
  47. package/dist/chunk-SA2WPJVO.js +144 -0
  48. package/dist/chunk-SA2WPJVO.js.map +1 -0
  49. package/dist/{chunk-X6BV7MB7.cjs → chunk-UNVE2SDJ.cjs} +37 -31
  50. package/dist/chunk-UNVE2SDJ.cjs.map +1 -0
  51. package/dist/{chunk-5E2HOSSH.cjs → chunk-WMSTJAZT.cjs} +913 -51
  52. package/dist/chunk-WMSTJAZT.cjs.map +1 -0
  53. package/dist/{chunk-ZP4AVIZP.js → chunk-X4DOXQRT.js} +4 -6
  54. package/dist/{chunk-ZP4AVIZP.js.map → chunk-X4DOXQRT.js.map} +1 -1
  55. package/dist/{chunk-X647HY3F.cjs → chunk-YBYI62OE.cjs} +33 -37
  56. package/dist/chunk-YBYI62OE.cjs.map +1 -0
  57. package/dist/components/case-studies/index.cjs +126 -0
  58. package/dist/components/case-studies/index.cjs.map +1 -0
  59. package/dist/components/case-studies/index.d.ts +2 -0
  60. package/dist/components/case-studies/index.d.ts.map +1 -0
  61. package/dist/components/case-studies/index.js +126 -0
  62. package/dist/components/case-studies/index.js.map +1 -0
  63. package/dist/components/case-studies/share-experience-section.d.ts +48 -0
  64. package/dist/components/case-studies/share-experience-section.d.ts.map +1 -0
  65. package/dist/components/chat/index.cjs +8 -18
  66. package/dist/components/chat/index.cjs.map +1 -1
  67. package/dist/components/chat/index.js +75 -85
  68. package/dist/components/contact/index.cjs +8 -15
  69. package/dist/components/contact/index.cjs.map +1 -1
  70. package/dist/components/contact/index.js +7 -14
  71. package/dist/components/docs/doc-viewer.d.ts +39 -2
  72. package/dist/components/docs/doc-viewer.d.ts.map +1 -1
  73. package/dist/components/docs/docs-hub-page.d.ts +46 -0
  74. package/dist/components/docs/docs-hub-page.d.ts.map +1 -0
  75. package/dist/components/docs/index.cjs +17 -9
  76. package/dist/components/docs/index.cjs.map +1 -1
  77. package/dist/components/docs/index.d.ts +4 -0
  78. package/dist/components/docs/index.d.ts.map +1 -1
  79. package/dist/components/docs/index.js +16 -8
  80. package/dist/components/docs/skeletons.d.ts +32 -0
  81. package/dist/components/docs/skeletons.d.ts.map +1 -0
  82. package/dist/components/docs/use-docs-resolve-link.d.ts +20 -0
  83. package/dist/components/docs/use-docs-resolve-link.d.ts.map +1 -0
  84. package/dist/components/docs/use-document-tree.d.ts.map +1 -1
  85. package/dist/components/embeds/embed-container.d.ts +37 -0
  86. package/dist/components/embeds/embed-container.d.ts.map +1 -0
  87. package/dist/components/embeds/embed-iframe.d.ts.map +1 -1
  88. package/dist/components/embeds/file-download-card.d.ts +18 -0
  89. package/dist/components/embeds/file-download-card.d.ts.map +1 -0
  90. package/dist/components/embeds/index.cjs +38 -15
  91. package/dist/components/embeds/index.cjs.map +1 -1
  92. package/dist/components/embeds/index.d.ts +8 -0
  93. package/dist/components/embeds/index.d.ts.map +1 -1
  94. package/dist/components/embeds/index.js +40 -17
  95. package/dist/components/embeds/linkedin-embed-client.d.ts +8 -0
  96. package/dist/components/embeds/linkedin-embed-client.d.ts.map +1 -0
  97. package/dist/components/embeds/markdown-image.d.ts +5 -0
  98. package/dist/components/embeds/markdown-image.d.ts.map +1 -0
  99. package/dist/components/embeds/reddit-embed-client.d.ts +7 -0
  100. package/dist/components/embeds/reddit-embed-client.d.ts.map +1 -0
  101. package/dist/components/embeds/rich-markdown-runtime.d.ts +46 -0
  102. package/dist/components/embeds/rich-markdown-runtime.d.ts.map +1 -0
  103. package/dist/components/embeds/twitter-embed-client.d.ts +8 -0
  104. package/dist/components/embeds/twitter-embed-client.d.ts.map +1 -0
  105. package/dist/components/faq/index.cjs +9 -16
  106. package/dist/components/faq/index.cjs.map +1 -1
  107. package/dist/components/faq/index.js +8 -15
  108. package/dist/components/features/index.cjs +8 -16
  109. package/dist/components/features/index.cjs.map +1 -1
  110. package/dist/components/features/index.js +24 -32
  111. package/dist/components/index.cjs +257 -452
  112. package/dist/components/index.cjs.map +1 -1
  113. package/dist/components/index.js +781 -976
  114. package/dist/components/index.js.map +1 -1
  115. package/dist/components/layout/page-header.d.ts +78 -0
  116. package/dist/components/layout/page-header.d.ts.map +1 -0
  117. package/dist/components/layout/page-layout.d.ts +10 -1
  118. package/dist/components/layout/page-layout.d.ts.map +1 -1
  119. package/dist/components/layout/page-with-header.d.ts +67 -0
  120. package/dist/components/layout/page-with-header.d.ts.map +1 -0
  121. package/dist/components/layout/title-block.d.ts +17 -1
  122. package/dist/components/layout/title-block.d.ts.map +1 -1
  123. package/dist/components/navigation/index.cjs +7 -15
  124. package/dist/components/navigation/index.cjs.map +1 -1
  125. package/dist/components/navigation/index.js +9 -17
  126. package/dist/components/onboarding-guides/index.cjs +35 -36
  127. package/dist/components/onboarding-guides/index.cjs.map +1 -1
  128. package/dist/components/onboarding-guides/index.js +13 -14
  129. package/dist/components/onboarding-guides/index.js.map +1 -1
  130. package/dist/components/onboarding-guides/onboarding-guide-detail-view.d.ts +1 -1
  131. package/dist/components/onboarding-guides/onboarding-guide-detail-view.d.ts.map +1 -1
  132. package/dist/components/related-content/index.cjs +9 -16
  133. package/dist/components/related-content/index.cjs.map +1 -1
  134. package/dist/components/related-content/index.js +8 -15
  135. package/dist/components/shared/dev-section/dev-section-page.d.ts +9 -0
  136. package/dist/components/shared/dev-section/dev-section-page.d.ts.map +1 -1
  137. package/dist/components/shared/dev-section/dev-section-view.d.ts.map +1 -1
  138. package/dist/components/shared/dev-section/index.d.ts +1 -1
  139. package/dist/components/shared/dev-section/index.d.ts.map +1 -1
  140. package/dist/components/shared/doc-search/use-doc-search.d.ts.map +1 -1
  141. package/dist/components/shared/legal-document/legal-document-page.d.ts.map +1 -1
  142. package/dist/components/shared/product-release/release-detail-page.d.ts.map +1 -1
  143. package/dist/components/tickets/index.cjs +100 -112
  144. package/dist/components/tickets/index.cjs.map +1 -1
  145. package/dist/components/tickets/index.js +20 -32
  146. package/dist/components/tickets/index.js.map +1 -1
  147. package/dist/components/ui/file-manager/index.cjs +50 -52
  148. package/dist/components/ui/file-manager/index.cjs.map +1 -1
  149. package/dist/components/ui/file-manager/index.js +4 -6
  150. package/dist/components/ui/file-manager/index.js.map +1 -1
  151. package/dist/components/ui/index.cjs +13 -19
  152. package/dist/components/ui/index.cjs.map +1 -1
  153. package/dist/components/ui/index.d.ts +2 -0
  154. package/dist/components/ui/index.d.ts.map +1 -1
  155. package/dist/components/ui/index.js +133 -139
  156. package/dist/components/ui/release-changelog-section.d.ts +6 -2
  157. package/dist/components/ui/release-changelog-section.d.ts.map +1 -1
  158. package/dist/components/ui/rich-markdown-renderer.d.ts +34 -0
  159. package/dist/components/ui/rich-markdown-renderer.d.ts.map +1 -0
  160. package/dist/components/ui/simple-markdown-renderer.d.ts +2 -8
  161. package/dist/components/ui/simple-markdown-renderer.d.ts.map +1 -1
  162. package/dist/contexts/chat-runtime-context.d.ts +14 -0
  163. package/dist/contexts/chat-runtime-context.d.ts.map +1 -1
  164. package/dist/contexts/index.cjs +3 -3
  165. package/dist/contexts/index.js +5 -5
  166. package/dist/embed-shims/index.cjs +3 -3
  167. package/dist/embed-shims/index.cjs.map +1 -1
  168. package/dist/embed-shims/index.js +4 -4
  169. package/dist/hooks/index.cjs +4 -9
  170. package/dist/hooks/index.cjs.map +1 -1
  171. package/dist/hooks/index.js +6 -11
  172. package/dist/index.cjs +14 -20
  173. package/dist/index.cjs.map +1 -1
  174. package/dist/index.js +362 -368
  175. package/dist/types/doc-source.d.ts +31 -1
  176. package/dist/types/doc-source.d.ts.map +1 -1
  177. package/dist/utils/index.cjs +4 -0
  178. package/dist/utils/index.cjs.map +1 -1
  179. package/dist/utils/index.d.ts +1 -0
  180. package/dist/utils/index.d.ts.map +1 -1
  181. package/dist/utils/index.js +4 -1
  182. package/dist/utils/index.js.map +1 -1
  183. package/dist/utils/page-header-constants.d.ts +15 -0
  184. package/dist/utils/page-header-constants.d.ts.map +1 -0
  185. package/dist/utils/social-embed-cache.d.ts +29 -0
  186. package/dist/utils/social-embed-cache.d.ts.map +1 -0
  187. package/package.json +7 -1
  188. package/src/components/case-studies/index.ts +4 -0
  189. package/src/components/case-studies/share-experience-section.tsx +185 -0
  190. package/src/components/chat/embeddable-chat.tsx +1 -1
  191. package/src/components/docs/doc-viewer.tsx +111 -19
  192. package/src/components/docs/docs-hub-page.tsx +149 -0
  193. package/src/components/docs/index.ts +17 -0
  194. package/src/components/docs/skeletons.tsx +138 -0
  195. package/src/components/docs/use-docs-resolve-link.ts +52 -0
  196. package/src/components/docs/use-document-tree.ts +21 -0
  197. package/src/components/embeds/embed-container.tsx +80 -0
  198. package/src/components/embeds/embed-iframe.tsx +7 -9
  199. package/src/components/embeds/file-download-card.tsx +54 -0
  200. package/src/components/embeds/index.ts +30 -0
  201. package/src/components/embeds/linkedin-embed-client.tsx +100 -0
  202. package/src/components/embeds/markdown-image.tsx +88 -0
  203. package/src/components/embeds/og-link-preview.tsx +13 -13
  204. package/src/components/embeds/reddit-embed-client.tsx +550 -0
  205. package/src/components/embeds/rich-markdown-runtime.tsx +79 -0
  206. package/src/components/embeds/twitter-embed-client.tsx +308 -0
  207. package/src/components/layout/page-header.tsx +182 -0
  208. package/src/components/layout/page-layout.tsx +14 -1
  209. package/src/components/layout/page-with-header.tsx +110 -0
  210. package/src/components/layout/title-block.tsx +40 -62
  211. package/src/components/onboarding-guides/onboarding-guide-detail-view.tsx +3 -3
  212. package/src/components/shared/dev-section/dev-section-page.tsx +9 -1
  213. package/src/components/shared/dev-section/dev-section-view.tsx +14 -9
  214. package/src/components/shared/dev-section/index.ts +1 -1
  215. package/src/components/shared/doc-search/use-doc-search.ts +7 -3
  216. package/src/components/shared/legal-document/legal-document-page.tsx +2 -2
  217. package/src/components/shared/product-release/release-detail-page.tsx +6 -4
  218. package/src/components/ui/index.ts +2 -0
  219. package/src/components/ui/release-changelog-section.tsx +7 -2
  220. package/src/components/ui/rich-markdown-renderer.tsx +1203 -0
  221. package/src/components/ui/simple-markdown-renderer.tsx +7 -11
  222. package/src/contexts/chat-runtime-context.tsx +14 -0
  223. package/src/types/doc-source.ts +33 -1
  224. package/src/utils/index.ts +1 -0
  225. package/src/utils/page-header-constants.ts +15 -0
  226. package/src/utils/social-embed-cache.ts +391 -0
  227. package/dist/chunk-26PKDALD.js +0 -2379
  228. package/dist/chunk-26PKDALD.js.map +0 -1
  229. package/dist/chunk-3MCHAFHB.js +0 -89
  230. package/dist/chunk-3MCHAFHB.js.map +0 -1
  231. package/dist/chunk-5E2HOSSH.cjs.map +0 -1
  232. package/dist/chunk-66AANIOC.cjs +0 -619
  233. package/dist/chunk-66AANIOC.cjs.map +0 -1
  234. package/dist/chunk-6JINAOI7.cjs +0 -311
  235. package/dist/chunk-6JINAOI7.cjs.map +0 -1
  236. package/dist/chunk-7RIYT7ZH.js.map +0 -1
  237. package/dist/chunk-AQOWFSMB.cjs.map +0 -1
  238. package/dist/chunk-BOCFIKYS.cjs +0 -3009
  239. package/dist/chunk-BOCFIKYS.cjs.map +0 -1
  240. package/dist/chunk-D652TJBQ.js +0 -3009
  241. package/dist/chunk-D652TJBQ.js.map +0 -1
  242. package/dist/chunk-E4XABBSU.js.map +0 -1
  243. package/dist/chunk-EL6QLAWX.js.map +0 -1
  244. package/dist/chunk-EYEW6PTA.cjs.map +0 -1
  245. package/dist/chunk-FQJK446R.js +0 -1606
  246. package/dist/chunk-FQJK446R.js.map +0 -1
  247. package/dist/chunk-GLLDTKZK.cjs.map +0 -1
  248. package/dist/chunk-IE6OU3WQ.cjs.map +0 -1
  249. package/dist/chunk-J54Z3OCR.cjs +0 -1606
  250. package/dist/chunk-J54Z3OCR.cjs.map +0 -1
  251. package/dist/chunk-K2PFPBMF.js.map +0 -1
  252. package/dist/chunk-KXCRGTRN.cjs +0 -2379
  253. package/dist/chunk-KXCRGTRN.cjs.map +0 -1
  254. package/dist/chunk-LCNMR277.js.map +0 -1
  255. package/dist/chunk-LFGGF7OT.cjs +0 -449
  256. package/dist/chunk-LFGGF7OT.cjs.map +0 -1
  257. package/dist/chunk-M2OCXTNT.js +0 -311
  258. package/dist/chunk-M2OCXTNT.js.map +0 -1
  259. package/dist/chunk-ME4EVDFP.js +0 -619
  260. package/dist/chunk-ME4EVDFP.js.map +0 -1
  261. package/dist/chunk-OQ6X7ZOC.js +0 -449
  262. package/dist/chunk-OQ6X7ZOC.js.map +0 -1
  263. package/dist/chunk-OY7OF7E7.js.map +0 -1
  264. package/dist/chunk-POKKCWKF.js +0 -354
  265. package/dist/chunk-POKKCWKF.js.map +0 -1
  266. package/dist/chunk-QHIXS3W2.cjs.map +0 -1
  267. package/dist/chunk-TFSYSWPS.cjs +0 -89
  268. package/dist/chunk-TFSYSWPS.cjs.map +0 -1
  269. package/dist/chunk-W6M2FLLT.cjs.map +0 -1
  270. package/dist/chunk-X647HY3F.cjs.map +0 -1
  271. package/dist/chunk-X6BV7MB7.cjs.map +0 -1
  272. package/dist/chunk-XREEV72C.cjs.map +0 -1
  273. package/dist/chunk-YETA25JW.cjs +0 -354
  274. package/dist/chunk-YETA25JW.cjs.map +0 -1
  275. package/dist/chunk-YIGPRLQY.cjs.map +0 -1
  276. /package/dist/{chunk-3ZXUQQL4.js.map → chunk-PI4WSYQV.js.map} +0 -0
@@ -0,0 +1,308 @@
1
+ "use client";
2
+
3
+ import { useState, useEffect, useRef } from 'react';
4
+ import { XLogo } from '../icons/x-logo';
5
+ import { socialCache } from '../../utils/social-embed-cache';
6
+ import { TwitterContainer } from './embed-container';
7
+ import { useRichMarkdownRuntime } from './rich-markdown-runtime';
8
+
9
+ // Using inline SVG icons to avoid dependency issues
10
+ const MessageCircleIcon = () => (
11
+ <svg width="16" height="16" fill="none" stroke="currentColor" viewBox="0 0 24 24">
12
+ <path d="M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"/>
13
+ </svg>
14
+ );
15
+
16
+ const ExternalLinkIcon = () => (
17
+ <svg width="16" height="16" fill="none" stroke="currentColor" viewBox="0 0 24 24">
18
+ <path d="M18 13v6a2 2 0 01-2 2H5a2 2 0 01-2-2V8a2 2 0 012-2h6"/>
19
+ <polyline points="15,3 21,3 21,9"/>
20
+ <line x1="10" y1="14" x2="21" y2="3"/>
21
+ </svg>
22
+ );
23
+
24
+ const HeartIcon = () => (
25
+ <svg width="16" height="16" fill="none" stroke="currentColor" viewBox="0 0 24 24">
26
+ <path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"/>
27
+ </svg>
28
+ );
29
+
30
+ const RepeatIcon = () => (
31
+ <svg width="16" height="16" fill="none" stroke="currentColor" viewBox="0 0 24 24">
32
+ <polyline points="17,1 21,5 17,9"/>
33
+ <path d="M3 11V9a4 4 0 0 1 4-4h14"/>
34
+ <polyline points="7,23 3,19 7,15"/>
35
+ <path d="M21 13v2a4 4 0 0 1-4 4H3"/>
36
+ </svg>
37
+ );
38
+
39
+ const ClockIcon = () => (
40
+ <svg width="12" height="12" fill="none" stroke="currentColor" viewBox="0 0 24 24">
41
+ <circle cx="12" cy="12" r="10"/>
42
+ <polyline points="12,6 12,12 16,14"/>
43
+ </svg>
44
+ );
45
+
46
+ const UserIcon = () => (
47
+ <svg width="12" height="12" fill="none" stroke="currentColor" viewBox="0 0 24 24">
48
+ <path d="M20 21v-2a4 4 0 00-4-4H8a4 4 0 00-4 4v2"/>
49
+ <circle cx="12" cy="7" r="4"/>
50
+ </svg>
51
+ );
52
+
53
+ // X glyph: the lib's standard XLogo (color follows the text context).
54
+ const XIcon = () => <XLogo className="w-5 h-5" color="currentColor" />;
55
+
56
+
57
+
58
+ interface TwitterOEmbedResponse {
59
+ url: string;
60
+ author_name: string;
61
+ author_url: string;
62
+ html: string;
63
+ width: number;
64
+ height: number;
65
+ type: string;
66
+ cache_age: string;
67
+ provider_name: string;
68
+ provider_url: string;
69
+ version: string;
70
+ }
71
+
72
+ interface TwitterEmbedProps {
73
+ url: string;
74
+ tweetId?: string;
75
+ maxWidth?: number;
76
+ }
77
+
78
+ export function TwitterEmbedClient({ url, tweetId, maxWidth = 700 }: TwitterEmbedProps) {
79
+ const { twitterProxyUrl } = useRichMarkdownRuntime();
80
+ const [tweetData, setTweetData] = useState<TwitterOEmbedResponse | null>(null);
81
+ const [loading, setLoading] = useState(true);
82
+ const [error, setError] = useState<string | null>(null);
83
+ const initializationDone = useRef(false);
84
+
85
+ // Extract tweet ID from URL if not provided
86
+ const extractedTweetId = tweetId || url.match(/status\/(\d+)/)?.[1];
87
+
88
+ // Normalize the Twitter URL
89
+ const tweetUrl = url.includes('twitter.com') || url.includes('x.com')
90
+ ? url
91
+ : `https://twitter.com/twitter/status/${extractedTweetId}`;
92
+
93
+ useEffect(() => {
94
+ // Only run once
95
+ if (initializationDone.current) return;
96
+ initializationDone.current = true;
97
+
98
+ if (!extractedTweetId) {
99
+ setError('Invalid tweet URL or ID');
100
+ setLoading(false);
101
+ return;
102
+ }
103
+
104
+ // Use centralized cache hierarchy
105
+ socialCache.fetchWithHierarchy({
106
+ platform: 'twitter',
107
+ url: tweetUrl,
108
+ apiEndpoint: twitterProxyUrl,
109
+ dataValidator: (data) => data && data.html,
110
+ onDataUpdate: (data) => setTweetData(data),
111
+ onError: (errorMsg) => setError(errorMsg),
112
+ onLoading: (loading) => setLoading(loading)
113
+ });
114
+ }, []); // Empty dependency array - only run once
115
+
116
+ if (loading) {
117
+ return (
118
+ <TwitterContainer>
119
+ <div className="border border-ods-border rounded-lg p-6 bg-ods-card animate-pulse">
120
+ <div className="flex items-center space-x-3 mb-4">
121
+ <div className="w-12 h-12 bg-ods-border rounded-full"></div>
122
+ <div>
123
+ <div className="h-4 bg-ods-border rounded w-32 mb-2"></div>
124
+ <div className="h-3 bg-ods-border rounded w-24"></div>
125
+ </div>
126
+ </div>
127
+ <div className="space-y-2 mb-4">
128
+ <div className="h-4 bg-ods-border rounded w-full"></div>
129
+ <div className="h-4 bg-ods-border rounded w-3/4"></div>
130
+ </div>
131
+ <div className="flex items-center space-x-4">
132
+ <div className="h-4 bg-ods-border rounded w-16"></div>
133
+ <div className="h-4 bg-ods-border rounded w-16"></div>
134
+ <div className="h-4 bg-ods-border rounded w-16"></div>
135
+ </div>
136
+ </div>
137
+ </TwitterContainer>
138
+ );
139
+ }
140
+
141
+ if (error || !tweetData) {
142
+ return (
143
+ <TwitterContainer>
144
+ <div className="border border-ods-border rounded-lg p-6 bg-ods-card">
145
+ <div className="flex items-center space-x-3 text-ods-text-secondary mb-4">
146
+ <XIcon />
147
+ <span>Tweet unavailable</span>
148
+ </div>
149
+
150
+ <div className="text-center">
151
+ <p className="text-ods-text-secondary text-sm mb-4">
152
+ This tweet could not be loaded. It may have been deleted, made private, or the account may be suspended.
153
+ </p>
154
+ <a
155
+ href={url}
156
+ target="_blank"
157
+ rel="noopener noreferrer"
158
+ className="inline-flex items-center space-x-2 px-4 py-2 bg-ods-bg-secondary text-ods-text-primary rounded-md text-sm font-medium hover:bg-ods-bg-tertiary transition-colors"
159
+ >
160
+ <XIcon />
161
+ <span>View on X</span>
162
+ </a>
163
+ </div>
164
+ </div>
165
+ </TwitterContainer>
166
+ );
167
+ }
168
+
169
+ // Parse the HTML to extract detailed tweet information and media
170
+ const parser = new DOMParser();
171
+ const doc = parser.parseFromString(tweetData.html, 'text/html');
172
+ const blockquote = doc.querySelector('blockquote');
173
+
174
+ // Extract tweet text (remove attribution line)
175
+ const fullText = blockquote?.textContent || '';
176
+ const tweetText = fullText.replace(/- .* \(@.*\).*$/, '').trim();
177
+
178
+ // Extract username from author_url (e.g., https://twitter.com/username)
179
+ const username = tweetData.author_url ? tweetData.author_url.split('/').pop() : '';
180
+
181
+
182
+
183
+ // Extract any links from the tweet
184
+ const links = Array.from(blockquote?.querySelectorAll('a') || [])
185
+ .map(link => ({
186
+ url: link.href,
187
+ text: link.textContent || link.href
188
+ }))
189
+ .filter(link => !link.url.includes('twitter.com') && !link.url.includes('x.com'));
190
+
191
+ // Format time (simulated - we don't have real timestamp from oEmbed)
192
+ const formatTime = () => {
193
+ return 'on X'; // Simplified since we don't have actual timestamp
194
+ };
195
+
196
+ const truncateText = (text: string, maxLength: number = 600) => {
197
+ if (text.length <= maxLength) return text;
198
+ return text.slice(0, maxLength) + '...';
199
+ };
200
+
201
+ // Profile picture URL using Unavatar service.
202
+ // The hub used to proxy this via `useProxiedImageUrl` (chat runtime), but
203
+ // docs / blog pages don't mount a chat runtime, so we fetch unavatar
204
+ // directly. Embedders that need a proxy can register a runtime later.
205
+ const getProfilePicUrl = (username: string | undefined) => {
206
+ if (!username) return '';
207
+ return `https://unavatar.io/twitter/${username}`;
208
+ };
209
+
210
+ return (
211
+ <TwitterContainer>
212
+ <div className="border border-ods-border rounded-lg bg-ods-card overflow-hidden">
213
+ {/* Header with Profile Picture */}
214
+ <div className="p-4 border-b border-ods-border">
215
+ <div className="flex items-center justify-between">
216
+ <div className="flex items-center space-x-3">
217
+ {/* User Profile Picture */}
218
+ <div className="w-8 h-8 rounded-full overflow-hidden flex-shrink-0">
219
+ <img
220
+ src={getProfilePicUrl(username)}
221
+ alt={`${tweetData.author_name} profile picture`}
222
+ className="w-full h-full object-cover"
223
+ onError={(e) => {
224
+ // Simple fallback without state updates
225
+ const target = e.target as HTMLImageElement;
226
+ target.src = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIGZpbGw9Im5vbmUiIHN0cm9rZT0iY3VycmVudENvbG9yIiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik0yMCAyMXYtMmE0IDQgMCAwIDAtNC00SDhhNCA0IDAgMCAwLTQgNHYyIi8+PGNpcmNsZSBjeD0iMTIiIGN5PSI3IiByPSI0Ii8+PC9zdmc+';
227
+ }}
228
+ />
229
+ </div>
230
+ <div>
231
+ <p className="text-ods-text-primary font-medium">@{username}</p>
232
+ <div className="flex items-center space-x-2 text-ods-text-secondary text-sm">
233
+ <UserIcon />
234
+ <span>{tweetData.author_name}</span>
235
+ <ClockIcon />
236
+ <span>{formatTime()}</span>
237
+ </div>
238
+ </div>
239
+ </div>
240
+ </div>
241
+ </div>
242
+
243
+ {/* Content */}
244
+ <div className="p-4">
245
+ {tweetText && (
246
+ <div
247
+ className="text-ods-text-secondary text-sm leading-relaxed mb-4 overflow-hidden"
248
+ style={{ maxHeight: `${maxWidth - 200}px` }}
249
+ >
250
+ <p className="whitespace-pre-wrap">
251
+ {truncateText(tweetText)}
252
+ </p>
253
+ </div>
254
+ )}
255
+
256
+
257
+
258
+ {/* Links Section */}
259
+ {links.length > 0 && (
260
+ <div className="mb-4 space-y-2">
261
+ {links.map((link, index) => (
262
+ <a
263
+ key={index}
264
+ href={link.url}
265
+ target="_blank"
266
+ rel="noopener noreferrer"
267
+ className="inline-flex items-center space-x-2 text-[#1DA1F2] hover:text-ods-accent transition-colors text-sm"
268
+ >
269
+ <ExternalLinkIcon />
270
+ <span className="underline">{link.text}</span>
271
+ </a>
272
+ ))}
273
+ </div>
274
+ )}
275
+
276
+ {/* Stats */}
277
+ <div className="flex items-center space-x-6 text-ods-text-secondary text-sm">
278
+ <div className="flex items-center space-x-1">
279
+ <HeartIcon />
280
+ <span>Likes</span>
281
+ </div>
282
+ <div className="flex items-center space-x-1">
283
+ <RepeatIcon />
284
+ <span>Retweets</span>
285
+ </div>
286
+ <div className="flex items-center space-x-1">
287
+ <MessageCircleIcon />
288
+ <span>Replies</span>
289
+ </div>
290
+ </div>
291
+ </div>
292
+
293
+ {/* Footer */}
294
+ <div className="px-4 py-3 bg-ods-bg-secondary border-t border-ods-border">
295
+ <a
296
+ href={url}
297
+ target="_blank"
298
+ rel="noopener noreferrer"
299
+ className="inline-flex items-center space-x-2 text-ods-accent hover:opacity-80 transition-colors text-sm font-medium"
300
+ >
301
+ <ExternalLinkIcon />
302
+ <span>View on X</span>
303
+ </a>
304
+ </div>
305
+ </div>
306
+ </TwitterContainer>
307
+ );
308
+ }
@@ -0,0 +1,182 @@
1
+ 'use client'
2
+
3
+ import React from 'react'
4
+ import { cn } from '../../utils/cn'
5
+ import { EntityImage } from '../ui/entity-image'
6
+ import { BackButton } from './back-button'
7
+
8
+ /**
9
+ * Page-header primitive — the canonical "back-button + title + subtitle
10
+ * + (optional) image / actions" chrome every lib page uses.
11
+ *
12
+ * Owns the SSOT for the page-header DOM/CSS that the rest of the lib
13
+ * was duplicating: pre-`mb` top padding, h1 typography (`text-h2`), h6
14
+ * subtitle (`text-h6`), the gap between the back button and the title
15
+ * block, and the right-side actions slot. Consumers either render this
16
+ * directly (e.g. `<DocViewer>` / `<DocsHubPage>`) or compose it through
17
+ * the `<TitleBlock>` adapter which adds the `PageActions` /
18
+ * `ActionsMenu` / selector wiring on top.
19
+ *
20
+ * Why this exists: knowledge-hub vs releases sat at different vertical
21
+ * rhythms (px-perfect mismatch on title baseline + subtitle offset)
22
+ * because the docs surface hand-rolled its own chrome instead of going
23
+ * through `TitleBlock`. Centralizing the layout here means every
24
+ * embeddable lib page (DocViewer, DevSectionPage, LegalDocumentPage,
25
+ * OnboardingGuideDetailView) renders pixel-identical title/subtitle/
26
+ * back-button typography + spacing — and a future spacing/typography
27
+ * tweak is one file.
28
+ */
29
+ export interface PageHeaderProps {
30
+ /** Page title (h1). Plain string — ReactNode is intentionally not
31
+ * supported here so every consumer renders the same typography. */
32
+ title?: string
33
+ /** Optional icon rendered inline before the title text (e.g. the
34
+ * rocket emoji on /releases, the docs icon on /knowledge-base).
35
+ * Same `flex items-center gap-3` row as `<DevSectionView>`'s hero. */
36
+ titleIcon?: React.ReactNode
37
+ /** Page subtitle (description paragraph). */
38
+ subtitle?: string
39
+ /**
40
+ * Render a yellow accent dot (`.`) after the title. Mirrors the
41
+ * hub's legacy `<AdminPageHeader accentDot>` flag — now lib-wide so
42
+ * surfaces like `/knowledge-base` keep their existing accent styling
43
+ * after the migration.
44
+ */
45
+ accentDot?: boolean
46
+ /** Optional thumbnail / hero image rendered to the left of the
47
+ * title block. Used by entity-image-style headers (onboarding
48
+ * guides, knowledge-base entries). */
49
+ image?: { src: string; alt?: string }
50
+ /** Back-button shown above the title block. Hidden on mobile (matches
51
+ * the existing TitleBlock + DocViewer behavior). */
52
+ backButton?: { label?: string; onClick: () => void }
53
+ /** Right-side actions slot (action buttons / menu / tab selector).
54
+ * Composed externally (e.g. `<TitleBlock>` builds `PageActions` + menu
55
+ * + selector and passes the result here). */
56
+ actions?: React.ReactNode
57
+ /**
58
+ * Visual variant.
59
+ * - `plain` (default): transparent background, no border.
60
+ * - `card`: card background, border, and padding on mobile only —
61
+ * collapses to plain on md+ (legacy `TitleBlock` variant — kept so
62
+ * surfaces that depend on the card affordance don't regress).
63
+ */
64
+ variant?: 'plain' | 'card'
65
+ /** When the consumer wraps `<PageHeader>` in its OWN spacing container
66
+ * (e.g. `<DevSectionView>`'s `gap-10 flex-col`), the default `mb-l`
67
+ * bottom margin doubles up. Pass `noBottomMargin` to opt out. */
68
+ noBottomMargin?: boolean
69
+ /** Same as `noBottomMargin` for the default `pt-l` top padding. Set
70
+ * this when PageHeader is nested INSIDE another layout that already
71
+ * provides top spacing (e.g. `<DevSectionView>`'s hero, which sits
72
+ * inside `<PageLayout>`'s children flow). */
73
+ noTopPadding?: boolean
74
+ className?: string
75
+ }
76
+
77
+ // Title typography — copied verbatim from <DevSectionView>'s hero h1
78
+ // (`src/components/shared/dev-section/dev-section-view.tsx`). The user-
79
+ // reported "header text not aligned" between /knowledge-base and
80
+ // /releases bottomed out here: DevSectionView rendered text-h1 with
81
+ // tracking-[-1.12px] while this component used text-h2 — visually huge
82
+ // gap. Now both render through the exact same class string. DevSectionView
83
+ // is being refactored in this commit to delegate to <PageHeader> so the
84
+ // shared-component claim is enforced at the code level too.
85
+ const TITLE_CLASS = 'text-h1 tracking-[-1.12px] text-ods-text-primary flex items-center gap-3'
86
+ // Subtitle ALWAYS occupies exactly 2 lines of vertical space.
87
+ // `min-h-[56px]` (= 2 × 28px leading) reserves the row height so a
88
+ // single-line subtitle doesn't shrink the header — page-to-page height
89
+ // stays consistent.
90
+ // `line-clamp-2` caps long copy at 2 lines + ellipsis so wrapping doesn't
91
+ // push the search bar down.
92
+ const SUBTITLE_CLASS = "font-['DM_Sans'] font-medium text-[18px] leading-[28px] text-ods-text-secondary max-w-3xl line-clamp-2 min-h-[56px]"
93
+
94
+ export function PageHeader({
95
+ title,
96
+ titleIcon,
97
+ subtitle,
98
+ accentDot,
99
+ image,
100
+ backButton,
101
+ actions,
102
+ variant = 'plain',
103
+ noBottomMargin = false,
104
+ noTopPadding = false,
105
+ className,
106
+ }: PageHeaderProps) {
107
+ return (
108
+ <div
109
+ className={cn(
110
+ 'flex items-end justify-between gap-[var(--spacing-system-m)]',
111
+ 'md:flex-col md:items-start md:justify-start lg:flex-row lg:items-end lg:justify-between',
112
+ !noTopPadding && 'pt-[var(--spacing-system-l)]',
113
+ variant === 'card'
114
+ ? cn(
115
+ 'bg-ods-card border-b border-ods-border',
116
+ 'px-[var(--spacing-system-l)] pb-[var(--spacing-system-l)]',
117
+ 'md:bg-transparent md:border-b-0',
118
+ 'md:px-0 md:pb-0',
119
+ !noBottomMargin && 'md:mb-[var(--spacing-system-l)]',
120
+ )
121
+ : !noBottomMargin && 'mb-[var(--spacing-system-l)]',
122
+ className,
123
+ )}
124
+ >
125
+ <div className="flex flex-col gap-[var(--spacing-system-xs)] flex-1 min-w-0">
126
+ {backButton && (
127
+ <BackButton
128
+ onClick={backButton.onClick}
129
+ label={backButton.label}
130
+ className="hidden md:inline-flex"
131
+ />
132
+ )}
133
+ {/* Title + subtitle stack. Matches `<DevSectionView>`'s hero
134
+ * exactly: `space-y-4` between h1 and p, `flex items-center
135
+ * gap-3` for icon-inline title row, identical class strings.
136
+ * Image (entity-image-style) prefixes the title row, NOT a
137
+ * separate column with its own vertical rhythm — that's the
138
+ * legacy TitleBlock 2-col layout which broke the title-to-
139
+ * subtitle gap. */}
140
+ {(title || subtitle || image || titleIcon) && (
141
+ <div className="space-y-4">
142
+ {(title || image || titleIcon) && (
143
+ <h1 className={TITLE_CLASS}>
144
+ {image && (
145
+ <EntityImage
146
+ src={image.src}
147
+ alt={image.alt}
148
+ fallbackText={image.alt || title}
149
+ />
150
+ )}
151
+ {titleIcon}
152
+ {title && (
153
+ <span>
154
+ {title}
155
+ {accentDot && <span className="text-ods-accent">.</span>}
156
+ </span>
157
+ )}
158
+ </h1>
159
+ )}
160
+ {(title || titleIcon || image) && (
161
+ // Always render the subtitle <p> when the title block exists,
162
+ // even when `subtitle` is empty — `SUBTITLE_CLASS` reserves
163
+ // `min-h-[56px]` so headers WITH and WITHOUT subtitles share a
164
+ // baseline (the JSDoc on SUBTITLE_CLASS claims "ALWAYS occupies
165
+ // exactly 2 lines"; gating the <p> on truthy `subtitle` broke
166
+ // that contract — pages without subtitle were ~56px shorter).
167
+ // Falsy subtitles render an NBSP placeholder so the empty <p>
168
+ // still takes its reserved height.
169
+ <p className={SUBTITLE_CLASS}>{subtitle || ' '}</p>
170
+ )}
171
+ </div>
172
+ )}
173
+ </div>
174
+
175
+ {actions && (
176
+ <div className="flex gap-2 items-center shrink-0">{actions}</div>
177
+ )}
178
+ </div>
179
+ )
180
+ }
181
+
182
+ export default PageHeader
@@ -10,6 +10,11 @@ export interface PageLayoutProps {
10
10
  children: React.ReactNode
11
11
  title?: string
12
12
  subtitle?: string
13
+ /** Inline icon rendered before the title text — forwarded to
14
+ * TitleBlock/PageHeader. Same shape as DevSectionPage's hero icon. */
15
+ titleIcon?: React.ReactNode
16
+ /** Yellow accent dot after the title — forwarded to TitleBlock/PageHeader. */
17
+ accentDot?: boolean
13
18
  image?: { src: string; alt?: string }
14
19
  backButton?: { label?: string; onClick: () => void }
15
20
  actions?: PageActionButton[]
@@ -33,6 +38,8 @@ export function PageLayout({
33
38
  children,
34
39
  title,
35
40
  subtitle,
41
+ titleIcon,
42
+ accentDot,
36
43
  image,
37
44
  backButton,
38
45
  actions,
@@ -46,14 +53,16 @@ export function PageLayout({
46
53
  }: PageLayoutProps) {
47
54
  const hasActions = actions && actions.length > 0
48
55
  const needsBottomPadding = hasActions && actionsVariant === 'primary-buttons'
49
- const hasHeader = showHeader && (title || subtitle || image || backButton || hasActions || selector)
56
+ const hasHeader = showHeader && (title || subtitle || titleIcon || image || backButton || hasActions || selector)
50
57
 
51
58
  return (
52
59
  <div className={cn('flex flex-col w-full', className)}>
53
60
  {hasHeader && (
54
61
  <TitleBlock
55
62
  title={title}
63
+ titleIcon={titleIcon}
56
64
  subtitle={subtitle}
65
+ accentDot={accentDot}
57
66
  image={image}
58
67
  backButton={backButton}
59
68
  actions={actions}
@@ -74,4 +83,8 @@ export function PageLayout({
74
83
  export type { PageActionButton } from '../ui/page-actions'
75
84
  export { TitleBlock } from './title-block'
76
85
  export type { TitleBlockProps } from './title-block'
86
+ export { PageHeader } from './page-header'
87
+ export type { PageHeaderProps } from './page-header'
88
+ export { PageWithHeader } from './page-with-header'
89
+ export type { PageWithHeaderProps } from './page-with-header'
77
90
  export default PageLayout
@@ -0,0 +1,110 @@
1
+ 'use client'
2
+
3
+ import React from 'react'
4
+ import { useRouter } from '../../embed-shims/next-navigation'
5
+ import { PageShell } from './article-detail-layout'
6
+ import { PageLayout } from './page-layout'
7
+ import { PageHeader, type PageHeaderProps } from './page-header'
8
+
9
+ /**
10
+ * `<PageWithHeader>` — the canonical 4-layer unified-chrome wrapper that
11
+ * every public lib/hub page now uses (Knowledge Hub, Roadmap, FAQs,
12
+ * Authors, Blog, Vendors, Case Studies, Interviews, Investor Updates,
13
+ * /webinars-/podcasts-/events, hub admin-but-public pages, …).
14
+ *
15
+ * Renders the same JSX tree every consumer was hand-rolling individually
16
+ * before this helper landed:
17
+ *
18
+ * PageShell ← bg-ods-bg, min-h-screen, max-w-[1920px],
19
+ * page-shell-px/pt/pb gutters
20
+ * PageLayout backButton ← TitleBlock → PageHeader #1 (back-btn row
21
+ * only, pt-l + mb-l)
22
+ * div.w-full.flex-col.gap-10 ← matches DevSectionView's hero container
23
+ * PageHeader title/subtitle ← PageHeader #2 (noTopPadding +
24
+ * titleIcon accentDot noBottomMargin so PageLayout's gap-l owns
25
+ * noTopPadding the spacing between #1 and #2)
26
+ * noBottomMargin
27
+ * children ← page-specific body (search, lists, forms)
28
+ *
29
+ * Why this exists: 15+ pages copy-pasted the EXACT same nesting + the
30
+ * EXACT same `noTopPadding + noBottomMargin + accentDot` triplet on the
31
+ * inner `<PageHeader>`. Forgetting one of those flags collapsed the gap
32
+ * to ~8px (the FAQs-vs-Onboarding-Guides bug). Centralizing the chain
33
+ * here makes the spacing invariant compiler-enforced — consumers can't
34
+ * pick the wrong combination.
35
+ *
36
+ * **Back button is config-driven by default.** Consumers don't have to
37
+ * thread `useRouter()` + `() => router.push('/')` themselves anymore —
38
+ * the helper supplies a sane default (`{ label: 'Back to home', href: '/' }`).
39
+ * Hosts whose `/` lives elsewhere should pass their own `href`. Pass
40
+ * `backButton={false}` to suppress entirely (the lib's own
41
+ * `<DocsHubPage>` does this on the platform-home docs landing).
42
+ */
43
+ export interface PageWithHeaderProps {
44
+ /** Title — passed straight to inner `<PageHeader>`. */
45
+ title?: string
46
+ /** Inline icon rendered before the title (lucide / SVG node). Wrap with
47
+ * `SECTION_HERO_ICON_CLASS` at the call site, or use the lib's
48
+ * `<PageHeader>`'s `titleIcon` ReactNode signature directly. */
49
+ titleIcon?: PageHeaderProps['titleIcon']
50
+ /** Subtitle (1-2 lines, auto-clamped to 2 + min-h-[56px]). */
51
+ subtitle?: string
52
+ /** Render yellow accent dot after the title (default true — matches every
53
+ * unified surface). Pass `false` to opt out. */
54
+ accentDot?: boolean
55
+ /** Back-button config. Defaults to `{ label: 'Back to home', href: '/' }`.
56
+ * Pass `false` to hide entirely (platform-home docs landings). */
57
+ backButton?: { label?: string; href?: string } | false
58
+ /** Optional image (entity-image-style — onboarding guides etc.). */
59
+ image?: PageHeaderProps['image']
60
+ /** Optional actions slot (right side of header). */
61
+ actions?: React.ReactNode
62
+ /** Page body — search bars, lists, forms, sections. Rendered INSIDE the
63
+ * gap-10 flex column so it shares gutters + vertical rhythm with the
64
+ * header. */
65
+ children: React.ReactNode
66
+ /** Extra class applied to the gap-10 content wrapper. */
67
+ contentClassName?: string
68
+ }
69
+
70
+ export function PageWithHeader({
71
+ title,
72
+ titleIcon,
73
+ subtitle,
74
+ accentDot = true,
75
+ backButton,
76
+ image,
77
+ actions,
78
+ children,
79
+ contentClassName,
80
+ }: PageWithHeaderProps) {
81
+ const router = useRouter()
82
+
83
+ const backCfg =
84
+ backButton === false
85
+ ? undefined
86
+ : {
87
+ label: backButton?.label ?? 'Back to home',
88
+ onClick: () => router.push(backButton?.href ?? '/'),
89
+ }
90
+
91
+ return (
92
+ <PageShell>
93
+ <PageLayout backButton={backCfg}>
94
+ <div className={`w-full flex flex-col gap-10${contentClassName ? ` ${contentClassName}` : ''}`}>
95
+ <PageHeader
96
+ title={title}
97
+ titleIcon={titleIcon}
98
+ subtitle={subtitle}
99
+ accentDot={accentDot}
100
+ image={image}
101
+ actions={actions}
102
+ noTopPadding
103
+ noBottomMargin
104
+ />
105
+ {children}
106
+ </div>
107
+ </PageLayout>
108
+ </PageShell>
109
+ )
110
+ }