28 lines
602 B
TypeScript
28 lines
602 B
TypeScript
import React from 'react';
|
|
|
|
interface LoadingSpinnerProps {
|
|
size?: number;
|
|
color?: string;
|
|
className?: string;
|
|
}
|
|
|
|
export function LoadingSpinner({ size = 8, color = '#3b82f6', className = '' }: LoadingSpinnerProps) {
|
|
const style: React.CSSProperties = {
|
|
width: `${size * 0.25}rem`,
|
|
height: `${size * 0.25}rem`,
|
|
border: '2px solid transparent',
|
|
borderTopColor: color,
|
|
borderLeftColor: color,
|
|
borderRadius: '9999px',
|
|
};
|
|
|
|
return (
|
|
<div
|
|
className={`animate-spin ${className}`}
|
|
style={style}
|
|
role="status"
|
|
aria-label="Loading"
|
|
/>
|
|
);
|
|
}
|