Updates
This commit is contained in:
@@ -5,6 +5,7 @@ import H2 from "../../layout/H2";
|
||||
import H3 from "../../layout/H3";
|
||||
import H4 from "../../layout/H4";
|
||||
import CodeBlock from "../../elements/CodeBlock";
|
||||
import { twMerge } from "tailwind-merge";
|
||||
|
||||
type Params = {
|
||||
components: MDXComponents;
|
||||
@@ -17,13 +18,12 @@ export default function useMDXComponents({
|
||||
}: Params): MDXComponents {
|
||||
return {
|
||||
h1: ({ children }) => <H1>{children}</H1>,
|
||||
h2: ({ children }) => <H2>{children}</H2>,
|
||||
h3: ({ children }) => <H3>{children}</H3>,
|
||||
h4: ({ children }) => <H4>{children}</H4>,
|
||||
pre: ({ children, ...props }) => {
|
||||
if (React.isValidElement(children) && children.props) {
|
||||
return (
|
||||
<CodeBlock {...props} backgroundColor={codeBgColor}>
|
||||
{/* @ts-ignore */}
|
||||
{children.props.children}
|
||||
</CodeBlock>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user