chatbot-template/components/document-skeleton.tsx

36 lines
1.7 KiB
TypeScript
Raw Normal View History

2024-10-30 16:01:24 +05:30
'use client';
2025-01-15 19:59:29 +05:30
import { BlockKind } from './block';
export const DocumentSkeleton = ({ blockKind }: { blockKind: BlockKind }) => {
return blockKind === 'image' ? (
<div className="flex flex-col gap-4 w-full justify-center items-center h-[calc(100dvh-60px)]">
<div className="animate-pulse rounded-lg bg-muted-foreground/20 size-96" />
</div>
) : (
2024-10-30 16:01:24 +05:30
<div className="flex flex-col gap-4 w-full">
<div className="animate-pulse rounded-lg h-12 bg-muted-foreground/20 w-1/2" />
<div className="animate-pulse rounded-lg h-5 bg-muted-foreground/20 w-full" />
<div className="animate-pulse rounded-lg h-5 bg-muted-foreground/20 w-full" />
<div className="animate-pulse rounded-lg h-5 bg-muted-foreground/20 w-1/3" />
<div className="animate-pulse rounded-lg h-5 bg-transparent w-52" />
<div className="animate-pulse rounded-lg h-8 bg-muted-foreground/20 w-52" />
<div className="animate-pulse rounded-lg h-5 bg-muted-foreground/20 w-2/3" />
</div>
);
};
export const InlineDocumentSkeleton = () => {
return (
<div className="flex flex-col gap-4 w-full">
<div className="animate-pulse rounded-lg h-4 bg-muted-foreground/20 w-48" />
<div className="animate-pulse rounded-lg h-4 bg-muted-foreground/20 w-3/4" />
<div className="animate-pulse rounded-lg h-4 bg-muted-foreground/20 w-1/2" />
<div className="animate-pulse rounded-lg h-4 bg-muted-foreground/20 w-64" />
<div className="animate-pulse rounded-lg h-4 bg-muted-foreground/20 w-40" />
<div className="animate-pulse rounded-lg h-4 bg-muted-foreground/20 w-36" />
<div className="animate-pulse rounded-lg h-4 bg-muted-foreground/20 w-64" />
</div>
);
};