import type { CircleSpinningDotProps } from "$/types/Loading";

export default function CircleSpinningDot({
	width,
	height,
	className,
	animationDuration = 0.75,
	stroke,
	fill,
	trackClassName = "fill-transparent",
	trackStroke,
	trackFill
}: CircleSpinningDotProps){
	//https://github.com/n3r4zzurr0/svg-spinners/blob/main/svg-smil/dot-revolve.svg
	return (
		<svg
			width={width}
			height={height}
			viewBox="0 0 24 24"
			xmlns="http://www.w3.org/2000/svg"
		>
			<path
				d="M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z"
				className={trackClassName}
				stroke={trackStroke}
				fill={trackFill}
			/>
			<circle
				cx="12"
				cy="2.5"
				r="1.5"
				className={className}
				stroke={stroke}
				fill={fill}
			>
				<animateTransform
					attributeName="transform"
					type="rotate"
					dur={animationDuration}
					values="0 12 12;360 12 12"
					repeatCount="indefinite"
				/>
			</circle>
		</svg>
	);
}
