Files
Shahed Nasser 4d632e7a5d docs: added tests for components in api-reference project (#14428)
* add tests (WIP)

* added test for h2

* finished adding tests

* fixes

* fixes

* fixes
2026-01-05 10:56:56 +02:00

35 lines
947 B
TypeScript

/* eslint-disable @typescript-eslint/ban-ts-comment */
"use server"
import React from "react"
import { MDXRemote } from "next-mdx-remote/rsc"
import getCustomComponents from "../../MDXComponents"
import type { ScopeType } from "../../MDXComponents"
import type { MDXRemoteProps } from "next-mdx-remote"
export type MDXContentServerProps = {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
content: any
} & Partial<MDXRemoteProps>
const MDXContentServer = ({ content, ...props }: MDXContentServerProps) => {
return (
<>
{/* @ts-ignore promise error */}
<MDXRemote
source={content}
components={getCustomComponents((props.scope as ScopeType) || {})}
options={{
scope: props.scope,
mdxOptions: {
development: process.env.NEXT_PUBLIC_ENV === "development",
},
}}
{...props}
/>
</>
)
}
export default MDXContentServer