import { cn } from "@/lib/utils";

interface SpinnerProps {
  size?: "xs" | "sm" | "md";
  className?: string;
}

const sizeMap = {
  xs: "w-3.5 h-3.5 border-2",
  sm: "w-4 h-4 border-2",
  md: "w-6 h-6 border-2",
};

export default function Spinner({ size = "sm", className }: SpinnerProps) {
  return (
    <span
      className={cn(
        "inline-block rounded-full border-t-transparent animate-spin",
        "border-current",
        sizeMap[size],
        className
      )}
    />
  );
}
