import React from 'react'; import { Loader2 } from 'lucide-react'; interface LoadingSpinnerProps { /** Size of the spinner */ size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'; /** Color of the spinner */ color?: 'default' | 'white' | 'brand' | 'blue'; /** Optional label to display below spinner */ label?: string; /** Center spinner in container */ centered?: boolean; /** Additional class name */ className?: string; } const sizeClasses = { xs: 'h-3 w-3', sm: 'h-4 w-4', md: 'h-6 w-6', lg: 'h-8 w-8', xl: 'h-12 w-12', }; const colorClasses = { default: 'text-gray-500 dark:text-gray-400', white: 'text-white', brand: 'text-brand-600 dark:text-brand-400', blue: 'text-blue-600 dark:text-blue-400', }; export const LoadingSpinner: React.FC = ({ size = 'md', color = 'default', label, centered = false, className = '', }) => { const spinner = (
{label && ( {label} )}
); if (centered) { return (
{spinner}
); } return spinner; }; /** Full page loading state */ export const PageLoading: React.FC<{ label?: string }> = ({ label = 'Loading...' }) => (
); /** Inline loading indicator */ export const InlineLoading: React.FC<{ label?: string }> = ({ label }) => ( {label && {label}} ); export default LoadingSpinner;