import React from 'react'; import { Loader2 } from 'lucide-react'; import { clsx } from 'clsx'; interface LoadingProps { size?: 'sm' | 'md' | 'lg'; text?: string; fullScreen?: boolean; className?: string; } export const Loading: React.FC = ({ size = 'md', text, fullScreen = false, className, }) => { const sizeStyles = { sm: 'h-4 w-4', md: 'h-8 w-8', lg: 'h-12 w-12', }; const content = (
{text && (

{text}

)}
); if (fullScreen) { return (
{content}
); } return content; }; interface LoadingSkeletonProps { className?: string; count?: number; type?: 'text' | 'card' | 'image'; } export const LoadingSkeleton: React.FC = ({ className, count = 1, type = 'text', }) => { const baseStyles = 'skeleton'; const typeStyles = { text: 'h-4 w-full rounded', card: 'h-32 w-full rounded-xl', image: 'aspect-square w-full rounded-lg', }; return ( <> {Array.from({ length: count }).map((_, index) => (
))} ); };