import type { CSSProperties } from 'react'; import { useEffect, useRef } from 'react'; export interface SpinnerProps { style?: CSSProperties; } export default function Spinner(props: SpinnerProps) { // Trick to spin the element without defining keyframes. const style: CSSProperties = { transform: 'rotate(0deg)', transition: 'transform 60s linear', ...props.style, }; const ref = useRef(null); useEffect(() => { if (!ref.current) return; ref.current.style.transform = 'rotate(36000deg)'; }, []); return ( ); }