File size: 724 Bytes
cbf89ee
 
 
 
 
 
 
 
 
 
2251e03
cbf89ee
 
 
 
 
 
 
 
 
5f83845
cbf89ee
 
 
5f83845
cbf89ee
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import React from 'react';

type LoadingProps = {
  size?: 'sm' | 'md' | 'lg';
  text?: string;
};

/**
 * Loading spinner component
 */
const Loading = ({ size = 'md', text }: LoadingProps) => {
  const sizeClasses = {
    sm: 'h-4 w-4',
    md: 'h-8 w-8',
    lg: 'h-12 w-12',
  };

  return (
    <div className="flex flex-col items-center justify-center p-4">
      <div
        className={`${sizeClasses[size]} animate-spin rounded-full border-4 border-gray-200 dark:border-zinc-700 border-t-blue-600 dark:border-t-blue-500`}
        role="status"
        aria-label="Loading"
      />
      {text && <p className="mt-2 text-sm text-gray-600 dark:text-zinc-400">{text}</p>}
    </div>
  );
};

export default Loading;