18 lines
502 B
TypeScript
18 lines
502 B
TypeScript
import { ImageZoom } from 'fumadocs-ui/components/image-zoom';
|
|
import defaultMdxComponents from 'fumadocs-ui/mdx';
|
|
import type { MDXComponents } from 'mdx/types';
|
|
|
|
export function getMDXComponents(components?: MDXComponents) {
|
|
return {
|
|
...defaultMdxComponents,
|
|
img: (props) => <ImageZoom {...props} />,
|
|
...components,
|
|
} satisfies MDXComponents;
|
|
}
|
|
|
|
export const useMDXComponents = getMDXComponents;
|
|
|
|
declare global {
|
|
type MDXProvidedComponents = ReturnType<typeof getMDXComponents>;
|
|
}
|