-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmdx-components.tsx
More file actions
34 lines (33 loc) · 1.09 KB
/
Copy pathmdx-components.tsx
File metadata and controls
34 lines (33 loc) · 1.09 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
// File: mdx-components.tsx
import defaultMdxComponents from "fumadocs-ui/mdx";
import type { MDXComponents } from "mdx/types";
import { ComponentPreview } from "@/components/bilalUi/component-preview";
import { Tab, Tabs } from "fumadocs-ui/components/tabs";
import { Step, Steps } from "fumadocs-ui/components/steps";
import { Callout } from "@/components/ui/callout";
import { cn } from "@/lib/utils";
export function getMDXComponents(components?: MDXComponents): MDXComponents {
return {
...defaultMdxComponents,
pre: ({ className, children, ...props }: React.ComponentProps<"pre">) => (
<div className="relative overflow-x-auto dark:bg-black py-4 rounded-lg border border-white/10 my-6">
<defaultMdxComponents.pre
className={cn(
"bg-transparent! border-none! shadow-none! p-0! m-0! font-mono text-[14px] leading-6",
className,
)}
{...props}
>
{children}
</defaultMdxComponents.pre>
</div>
),
ComponentPreview,
Tab,
Tabs,
Step,
Steps,
Callout,
...components,
};
}