-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmdx-components.tsx
More file actions
48 lines (45 loc) · 1.57 KB
/
mdx-components.tsx
File metadata and controls
48 lines (45 loc) · 1.57 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
36
37
38
39
40
41
42
43
44
45
46
47
48
import { Accordion, Accordions } from 'fumadocs-ui/components/accordion'
import { Banner } from 'fumadocs-ui/components/banner'
import { Callout } from 'fumadocs-ui/components/callout'
import * as FilesComponents from 'fumadocs-ui/components/files'
import * as TabsComponents from 'fumadocs-ui/components/tabs'
import { TypeTable } from 'fumadocs-ui/components/type-table'
import defaultMdxComponents from 'fumadocs-ui/mdx'
import * as icons from 'lucide-react'
import type { MDXComponents } from 'mdx/types'
import type { ComponentProps, FC } from 'react'
import { APIPage } from '@/components/docs/api-page'
import { Update, Updates } from '@/components/fumadocs/updates'
import { Mermaid } from '@/components/mdx/mermaid'
export function getMDXComponents(components?: MDXComponents) {
return {
...(icons as unknown as MDXComponents),
...defaultMdxComponents,
...TabsComponents,
...FilesComponents,
Accordion,
Accordions,
Updates,
Update,
Mermaid,
TypeTable,
Callout,
blockquote: Callout as unknown as FC<ComponentProps<'blockquote'>>,
APIPage,
Banner,
...components,
} satisfies MDXComponents
}
declare module 'mdx/types.js' {
// Augment the MDX types to make it understand React.
// eslint-disable-next-line @typescript-eslint/no-namespace
namespace JSX {
type Element = React.JSX.Element
type ElementClass = React.JSX.ElementClass
type ElementType = React.JSX.ElementType
type IntrinsicElements = React.JSX.IntrinsicElements
}
}
declare global {
type MDXProvidedComponents = ReturnType<typeof getMDXComponents>
}