Skip to content

Commit

Permalink
add suspense
Browse files Browse the repository at this point in the history
  • Loading branch information
velascoandres committed Apr 14, 2024
1 parent 168a3da commit cb2631a
Showing 1 changed file with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { Suspense } from 'react'

import { IntercepModal } from '@/app/_shared/components/modal/intercep-modal'
import { Skeleton } from '@/app/_shared/components/ui/skeleton'
import { getPublicWhiteboard } from '@/app/_whiteboards/actions/public-whiteboard'
import { WhiterboardFromCompressed } from '@/app/_whiteboards/components/whiteboard'

Expand All @@ -10,11 +13,13 @@ export default async function Page({ params }: {params: {id: string}}) {
return (
<IntercepModal title={whiteboard.name}>
<section className="h-[calc(100dvh-300px)] w-full">
<WhiterboardFromCompressed
viewModeEnabled
id={whiteboard?.id}
initialRawCompressed={whiteboard.compressedRawContent}
/>
<Suspense fallback={<Skeleton className="h-[calc(100dvh-300px)] w-full" />}>
<WhiterboardFromCompressed
viewModeEnabled
id={whiteboard?.id}
initialRawCompressed={whiteboard.compressedRawContent}
/>
</Suspense>
</section>
</IntercepModal>
)
Expand Down

0 comments on commit cb2631a

Please sign in to comment.