import { type CSSProperties } from 'react'; export type SkeletonVariant = 'text' | 'avatar' | 'card' | 'list' | 'bento'; export interface SkeletonProps { /** * Variant of skeleton * - text: Single line of text * - avatar: Circular avatar * - card: Full card with header and content * - list: Multiple list items * - bento: Bento card style (original BentoSkeleton) */ variant?: SkeletonVariant; /** * Number of skeleton items to render */ count?: number; /** * Width (for text variant) */ width?: string | number; /** * Height (for custom sizing) */ height?: string | number; /** * Additional CSS classes */ className?: string; /** * Whether to animate * @default true */ animate?: boolean; } const baseClasses = 'bg-dark-800/50 rounded'; const animateClasses = 'animate-pulse'; export function Skeleton({ variant = 'text', count = 1, width, height, className = '', animate = true, }: SkeletonProps) { const animation = animate ? animateClasses : ''; const renderSkeleton = (index: number) => { const style: CSSProperties = { '--stagger': index, width: width, height: height, } as CSSProperties; switch (variant) { case 'text': return (
); case 'avatar': return ( ); case 'card': return (