Files
medusa-store/www/apps/api-reference/components/MDXComponents/index.tsx
2025-03-18 17:37:51 +02:00

22 lines
590 B
TypeScript

import type { MDXComponents } from "mdx/types"
import Security from "./Security"
import type { OpenAPI } from "types"
import H2 from "./H2"
import { Link, MDXComponents as UiMDXComponents } from "docs-ui"
export type ScopeType = {
specs?: OpenAPI.OpenAPIV3.Document
addToSidebar?: boolean
}
const getCustomComponents = (scope?: ScopeType): MDXComponents => {
return {
...UiMDXComponents,
Security: () => <Security specs={scope?.specs} />,
a: Link,
h2: (props: React.HTMLAttributes<HTMLHeadingElement>) => <H2 {...props} />,
}
}
export default getCustomComponents