Files
medusa-store/www/api-reference/components/MDXComponents/index.tsx
Shahed Nasser f07dc0384f docs,api-ref: added search filters (#4830)
* initial implementation of search modal

* added hit and search suggestions

* added support for multiple indices

* updated sample env

* added close when click outside dropdown

* test for mobile

* added mobile design

* added shortcut

* dark mode fixes

* added search to docs

* added plugins filter

* added React import

* moved filters to configurations

* handled error on page load

* change suggestion text

* removed hits limit

* handle select all

* open link in current tab

* change highlight colors

* added support for shortcuts + auto focus

* change header and footer

* redesigned search ui
2023-08-24 18:36:06 +03:00

25 lines
623 B
TypeScript

import type { MDXComponents } from "mdx/types"
import Security from "./Security"
import type { OpenAPIV3 } from "openapi-types"
import Link from "./Link"
import CodeWrapper from "./CodeWrapper"
import H2 from "./H2"
import Kbd from "./Kbd"
export type ScopeType = {
specs?: OpenAPIV3.Document
addToSidebar?: boolean
}
const getCustomComponents = (scope?: ScopeType): MDXComponents => {
return {
Security: () => <Security specs={scope?.specs} />,
code: CodeWrapper,
a: Link,
h2: (props) => <H2 addToSidebar={scope?.addToSidebar} {...props} />,
kbd: Kbd,
}
}
export default getCustomComponents