File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import {
1414import { Fragment , jsx , jsxs } from 'react/jsx-runtime' ;
1515import { DynamicCodeBlock } from 'fumadocs-ui/components/dynamic-codeblock' ;
1616import defaultMdxComponents from 'fumadocs-ui/mdx' ;
17+ import { Skeleton } from '../ui/Skeleton' ;
1718
1819export interface Processor {
1920 process : ( content : string ) => Promise < ReactNode > ;
@@ -65,7 +66,7 @@ export function Markdown({ text }: { text: string }) {
6566 const deferredText = useDeferredValue ( text ) ;
6667
6768 return (
68- < Suspense fallback = { text } >
69+ < Suspense fallback = { < Skeleton /> } >
6970 < Renderer text = { deferredText } />
7071 </ Suspense >
7172 ) ;
Original file line number Diff line number Diff line change 1+ export function Skeleton ( { lines = 4 } : { lines ?: number } ) {
2+ return (
3+ < div className = "animate-pulse space-y-2" >
4+ { Array . from ( { length : lines } ) . map ( ( _ , i ) => (
5+ < div
6+ key = { i }
7+ className = { `rounded bg-fd-muted-foreground/10 ${ i === 0 ? 'h-4 w-3/4' : 'h-3 w-full' } ` }
8+ />
9+ ) ) }
10+ </ div >
11+ ) ;
12+ }
You can’t perform that action at this time.
0 commit comments