Skip to content

Commit 7370fd1

Browse files
committed
Add fallback UI for code editor loading
1 parent 45cb74c commit 7370fd1

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

lazyweb/components/snippets/main.tsx

+9-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ const Code = dynamic(() => import('./micro/Code'), { ssr: false })
88

99
type Props = {}
1010

11+
const FallBackUI = () => {
12+
return (
13+
<div className='w-full h-full flex items-center justify-center'>
14+
<div className=' text-2xl font-bold'>Loading Editor...</div>
15+
</div>
16+
)
17+
}
18+
1119
const SnippetsContainer = (props: Props) => {
1220
const router = useRouter()
1321

@@ -16,7 +24,7 @@ const SnippetsContainer = (props: Props) => {
1624
<NavBar />
1725
<div className='min-h-[100vh] relative flex px-[10vw] py-[calc(10vh+80px)] items-center flex-col justify-center w-full bg-[#202123]'>
1826
<Container>
19-
<Suspense fallback={<div>Loading Editor...</div>}>
27+
<Suspense fallback={<FallBackUI />}>
2028
<div className='relative'>
2129

2230
<Code />

0 commit comments

Comments
 (0)