-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathmdx-components.tsx
More file actions
35 lines (33 loc) · 1.02 KB
/
mdx-components.tsx
File metadata and controls
35 lines (33 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import type { MDXComponents } from 'mdx/types'
import { createGenerator } from 'fumadocs-typescript'
import { AutoTypeTable } from 'fumadocs-typescript/ui'
import { Step, Steps } from 'fumadocs-ui/components/steps'
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
import defaultMdxComponents from 'fumadocs-ui/mdx'
import { APITable } from '@/components/mdx/api-table'
import { Mermaid } from '@/components/mdx/mermaid'
import { MetaData } from '@/components/mdx/meta-data'
import { PlaygroundFrame } from '@/components/playground'
const generator = createGenerator()
// use this function to get MDX components, you will need it for rendering MDX
export function getMDXComponents(components?: MDXComponents): MDXComponents {
return {
...defaultMdxComponents,
...components,
Tabs,
Tab,
Steps,
Step,
Mermaid,
MetaData,
AutoTypeTable: props => (
<AutoTypeTable
class="hidden"
{...props}
generator={generator}
/>
),
APITable,
PlaygroundFrame,
}
}