import { cn } from '@/lib/utils'

const SIZES = {
  sm: 'h-4 w-4 border-2',
  md: 'h-8 w-8 border-4',
  lg: 'h-12 w-12 border-4',
} as const

interface SpinnerProps {
  size?: keyof typeof SIZES
  className?: string
}

export function Spinner({ size = 'md', className }: SpinnerProps) {
  return (
    <div
      className={cn(
        'animate-spin rounded-full border-border border-t-primary',
        SIZES[size],
        className
      )}
    />
  )
}

export default Spinner
