11import type { Page } from "fumadocs-core/source" ;
2+ import type { DocOut } from "fumadocs-mdx/runtime/next" ;
23import { CodeBlock , Pre } from "fumadocs-ui/components/codeblock" ;
34import { Heading } from "fumadocs-ui/components/heading" ;
45import { Step , Steps } from "fumadocs-ui/components/steps" ;
56import { Tab , Tabs } from "fumadocs-ui/components/tabs" ;
67import defaultComponents from "fumadocs-ui/mdx" ;
78import type { MDXComponents } from "mdx/types" ;
89import dynamic from "next/dynamic" ;
10+ import Link from "next/link" ;
911import type * as React from "react" ;
12+ import { Alert , AlertDescription , AlertTitle } from "@/components/ui/alert" ;
13+ import { Kbd } from "@/components/ui/kbd" ;
1014import { Table , TableCell , TableHead , TableRow } from "@/components/ui/table" ;
1115import { cn } from "@/lib/utils" ;
1216
@@ -25,9 +29,6 @@ const CSSVariablesTable = dynamic(() =>
2529 default : mod . CSSVariablesTable ,
2630 } ) ) ,
2731) ;
28- const Kbd = dynamic ( ( ) =>
29- import ( "@/components/kbd" ) . then ( ( mod ) => ( { default : mod . Kbd } ) ) ,
30- ) ;
3132const AutoTypeTable = dynamic ( ( ) =>
3233 import ( "@/components/auto-type-table" ) . then ( ( mod ) => ( {
3334 default : mod . AutoTypeTable ,
@@ -85,7 +86,23 @@ export function useMdxComponents(
8586 < Pre > { children } </ Pre >
8687 </ CodeBlock >
8788 ) ,
88- kbd : ( props ) => < Kbd variant = "outline" { ...props } /> ,
89+ Link : ( { className, ...props } : React . ComponentProps < typeof Link > ) => (
90+ < Link
91+ className = { cn ( "underline underline-offset-4" , className ) }
92+ { ...props }
93+ />
94+ ) ,
95+ Alert : ( { className, ...props } : React . ComponentProps < typeof Alert > ) => (
96+ < Alert
97+ className = { cn ( "not-prose my-2 bg-background" , className ) }
98+ { ...props }
99+ />
100+ ) ,
101+ AlertTitle,
102+ AlertDescription,
103+ Kbd : ( { className, ...props } : React . ComponentProps < typeof Kbd > ) => (
104+ < Kbd className = { cn ( "not-prose" , className ) } { ...props } />
105+ ) ,
89106 ComponentTabs,
90107 ComponentSource,
91108 Steps,
@@ -99,9 +116,7 @@ export function useMdxComponents(
99116}
100117
101118interface MdxProps {
102- page : Page & {
103- data : { body : React . ComponentType < { components : MDXComponents } > } ;
104- } ;
119+ page : Page < DocOut > ;
105120 components ?: Partial < MDXComponents > ;
106121}
107122
0 commit comments