ActivityIndicator.jsx 450 B

123456789101112131415
  1. import { h } from 'preact';
  2. const sizes = {
  3. sm: 'h-4 w-4 border-2 border-t-2',
  4. md: 'h-8 w-8 border-4 border-t-4',
  5. lg: 'h-16 w-16 border-8 border-t-8',
  6. };
  7. export default function ActivityIndicator({ size = 'md' }) {
  8. return (
  9. <div className="w-full flex items-center justify-center" aria-label="Loading…">
  10. <div className={`activityindicator ease-in rounded-full border-gray-200 text-blue-500 ${sizes[size]}`} />
  11. </div>
  12. );
  13. }