fix: resolve React version conflict in DocArticle and await async params
This commit is contained in:
parent
31cae2b83d
commit
3367e38b8a
2
next-env.d.ts
vendored
2
next-env.d.ts
vendored
@ -1,6 +1,6 @@
|
||||
/// <reference types="next" />
|
||||
/// <reference types="next/image-types/global" />
|
||||
import "./.next/types/routes.d.ts";
|
||||
import "./.next/dev/types/routes.d.ts";
|
||||
|
||||
// NOTE: This file should not be edited
|
||||
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
|
||||
|
||||
@ -1,24 +1,17 @@
|
||||
import { compileMDX } from 'next-mdx-remote/rsc'
|
||||
|
||||
import DocCallout from './DocCallout'
|
||||
import DocSteps from './DocSteps'
|
||||
import { marked } from 'marked'
|
||||
|
||||
interface DocArticleProps {
|
||||
content: string
|
||||
}
|
||||
|
||||
export default async function DocArticle({ content }: DocArticleProps) {
|
||||
const mdx = await compileMDX({
|
||||
source: content,
|
||||
components: {
|
||||
Callout: DocCallout,
|
||||
Steps: DocSteps,
|
||||
},
|
||||
})
|
||||
// Convert markdown to HTML
|
||||
const htmlContent = await marked(content)
|
||||
|
||||
return (
|
||||
<article className="prose prose-slate max-w-none prose-headings:scroll-mt-24 prose-a:text-brand prose-a:no-underline hover:prose-a:underline">
|
||||
{mdx.content}
|
||||
</article>
|
||||
<article
|
||||
className="prose prose-slate max-w-none dark:prose-invert prose-headings:scroll-mt-24 prose-a:text-brand prose-a:no-underline hover:prose-a:underline"
|
||||
dangerouslySetInnerHTML={{ __html: htmlContent }}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user