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

22 lines
597 B
TypeScript

import React from "react"
import type { MDXComponents } from "mdx/types"
import Security from "./Security"
import type { OpenAPI } from "types"
import H2 from "./H2"
import { 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} />,
h2: (props: React.HTMLAttributes<HTMLHeadingElement>) => <H2 {...props} />,
}
}
export default getCustomComponents