import SpinnerRing from "../SpinnerRing.tsx"

interface SpinnerProps {
  label: string
  className?: string
}

export default function Spinner({ label, className }: SpinnerProps) {
  return (
    <div
      role="status"
      aria-live="polite"
      aria-busy="true"
      className={["rk-spinner flex justify-center py-12", className].filter(Boolean).join(" ")}
    >
      <SpinnerRing className="h-16 w-16 border-[6px] border-primary" />
      <span className="sr-only">{label}</span>
    </div>
  )
}
