interface SpinnerProps {
  /** Optional caption rendered under the ring. */
  label?: string;
}

/** Indeterminate loading ring with an optional label. */
export function Spinner({ label }: SpinnerProps) {
  return (
    <div className="spinner" role="status" aria-live="polite">
      <span className="spinner__ring" aria-hidden="true" />
      {label && <span>{label}</span>}
    </div>
  );
}
