-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmdx-components.tsx
More file actions
19 lines (18 loc) · 839 Bytes
/
mdx-components.tsx
File metadata and controls
19 lines (18 loc) · 839 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import type { MDXComponents } from "mdx/types";
import text from "./core/styles/text.module.css";
import { H1, H2, H3, H4, H5, H6, P } from "./core/components/text/text";
export function useMDXComponents(components: MDXComponents): MDXComponents {
return {
...components,
h1: ({ children }) => <H1>{children}</H1>,
h2: ({ children }) => <H2>{children}</H2>,
h3: ({ children }) => <H3>{children}</H3>,
h4: ({ children }) => <H4>{children}</H4>,
h5: ({ children }) => <H5>{children}</H5>,
h6: ({ children }) => <H6>{children}</H6>,
p: ({ children }) => <P>{children}</P>,
ul: ({ children }) => <ul className={text.paragraph}>{children}</ul>,
ol: ({ children }) => <ol className={text.paragraph}>{children}</ol>,
small: ({ children }) => <small className={text.small}>{children}</small>,
};
}