11import type React from 'react'
22import { findNeighbour } from 'fumadocs-core/page-tree'
3+ import { Pre } from 'fumadocs-ui/components/codeblock'
34import defaultMdxComponents from 'fumadocs-ui/mdx'
45import { DocsBody , DocsDescription , DocsPage , DocsTitle } from 'fumadocs-ui/page'
56import { ChevronLeft , ChevronRight } from 'lucide-react'
@@ -21,6 +22,7 @@ export default async function Page(props: { params: Promise<{ slug?: string[]; l
2122 const data = page . data as PageData
2223 const MDX = data . body
2324 const baseUrl = 'https://docs.sim.ai'
25+ const markdownContent = await data . getText ( 'processed' )
2426
2527 const pageTreeRecord = source . pageTree as Record < string , any >
2628 const pageTree =
@@ -200,7 +202,7 @@ export default async function Page(props: { params: Promise<{ slug?: string[]; l
200202 < div className = 'relative mt-6 sm:mt-0' >
201203 < div className = 'absolute top-1 right-0 flex items-center gap-2' >
202204 < div className = 'hidden sm:flex' >
203- < LLMCopyButton markdownUrl = { ` ${ page . url } .mdx` } />
205+ < LLMCopyButton content = { markdownContent } />
204206 </ div >
205207 < PageNavigationArrows previous = { neighbours ?. previous } next = { neighbours ?. next } />
206208 </ div >
@@ -211,7 +213,11 @@ export default async function Page(props: { params: Promise<{ slug?: string[]; l
211213 < MDX
212214 components = { {
213215 ...defaultMdxComponents ,
214- CodeBlock,
216+ pre : ( props : React . HTMLAttributes < HTMLPreElement > ) => (
217+ < CodeBlock { ...props } >
218+ < Pre > { props . children } </ Pre >
219+ </ CodeBlock >
220+ ) ,
215221 h1 : ( props : React . HTMLAttributes < HTMLHeadingElement > ) => (
216222 < Heading as = 'h1' { ...props } />
217223 ) ,
0 commit comments