Skip to content

Commit f240f64

Browse files
add image block skeleton
1 parent 007a427 commit f240f64

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

components/block.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ function PureBlock({
477477
})}
478478
>
479479
{isDocumentsFetching && !block.content ? (
480-
<DocumentSkeleton />
480+
<DocumentSkeleton blockKind={block.kind} />
481481
) : block.kind === 'code' ? (
482482
<CodeEditor
483483
content={

components/document-skeleton.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
'use client';
22

3-
export const DocumentSkeleton = () => {
4-
return (
3+
import { BlockKind } from './block';
4+
5+
export const DocumentSkeleton = ({ blockKind }: { blockKind: BlockKind }) => {
6+
return blockKind === 'image' ? (
7+
<div className="flex flex-col gap-4 w-full justify-center items-center h-[calc(100dvh-60px)]">
8+
<div className="animate-pulse rounded-lg bg-muted-foreground/20 size-96" />
9+
</div>
10+
) : (
511
<div className="flex flex-col gap-4 w-full">
612
<div className="animate-pulse rounded-lg h-12 bg-muted-foreground/20 w-1/2" />
713
<div className="animate-pulse rounded-lg h-5 bg-muted-foreground/20 w-full" />

0 commit comments

Comments
 (0)