import React from "react"; import type { MDXComponents } from "mdx/types"; import H1 from "../../layout/H1"; import H2 from "../../layout/H2"; import H3 from "../../layout/H3"; import H4 from "../../layout/H4"; import CodeBlock from "../../elements/CodeBlock"; type Params = { components: MDXComponents; codeBgColor?: string; }; export default function useMDXComponents({ components, codeBgColor, }: Params): MDXComponents { return { h1: ({ children }) =>

{children}

, h2: ({ children }) =>

{children}

, h3: ({ children }) =>

{children}

, h4: ({ children }) =>

{children}

, pre: ({ children, ...props }) => { if (React.isValidElement(children) && children.props) { return ( {children.props.children} ); } return ( {children} ); }, ...components, }; }