1- import type { ReactNode } from "react" ;
2- import { Analytics } from "@vercel/analytics/react" ;
31import { baseOptions } from "@/app/layout.config" ;
42import { CustomDocsLayout } from "@/components/CustomDocsLayout" ;
53import { Footer } from "@/components/Footer" ;
64import { ProBadge } from "@/components/ProBadge" ;
75import { source } from "@/lib/source/examples" ;
86import { getExampleData } from "@/util/getExampleData" ;
7+ import type { ReactNode } from "react" ;
8+ import * as Sentry from "@sentry/nextjs" ;
99
1010export default function Layout ( { children } : { children : ReactNode } ) {
1111 // Add Pro badges to example pages in sidebar.
@@ -22,7 +22,7 @@ export default function Layout({ children }: { children: ReactNode }) {
2222
2323 page . name = (
2424 < span >
25- { exampleData . title }
25+ < span className = "mr-1" > { exampleData . title } </ span >
2626 { exampleData . isPro && < ProBadge /> }
2727 </ span >
2828 ) ;
@@ -34,10 +34,25 @@ export default function Layout({ children }: { children: ReactNode }) {
3434 return (
3535 < >
3636 < CustomDocsLayout tree = { source . pageTree } { ...baseOptions } >
37- { children }
37+ < Sentry . ErrorBoundary
38+ fallback = {
39+ < div >
40+ We encountered an error trying to show this page. Please report
41+ this to us on GitHub at{ " " }
42+ < a href = "https://github.com/TypeCellOS/BlockNote/issues" >
43+ https://github.com/TypeCellOS/BlockNote/issues
44+ </ a >
45+ </ div >
46+ }
47+ beforeCapture = { ( scope ) => {
48+ scope . setTag ( "type" , "react-render" ) ;
49+ scope . setTag ( "page" , "examples" ) ;
50+ } }
51+ >
52+ { children }
53+ </ Sentry . ErrorBoundary >
3854 </ CustomDocsLayout >
3955 < Footer />
40- < Analytics />
4156 </ >
4257 ) ;
4358}
0 commit comments