1 /* eslint-disable @typescript-eslint/ban-ts-comment */
2 "use server"
3
4 import React from "react"
5 import { MDXRemote } from "next-mdx-remote/rsc"
6 import getCustomComponents from "../../MDXComponents"
7 import type { ScopeType } from "../../MDXComponents"
8 import type { MDXRemoteProps } from "next-mdx-remote"
9
10 export type MDXContentServerProps = {
11 // eslint-disable-next-line @typescript-eslint/no-explicit-any
12 content: any
13 } & Partial<MDXRemoteProps>
14
15 const MDXContentServer = ({ content, ...props }: MDXContentServerProps) => {
16 return (
17 <>
18 {/* @ts-ignore promise error */}
19 <MDXRemote
20 source={content}
21 components={getCustomComponents((props.scope as ScopeType) || {})}
22 options={{
23 scope: props.scope,
24 mdxOptions: {
25 development: process.env.NEXT_PUBLIC_ENV === "development",
26 },
27 }}
28 {...props}
29 />
30 </>
31 )
32 }
33
34 export default MDXContentServer