import type { LoadingSpinnerProps } from "$/types/LoadingTypes";


export default function HalfSpinner({
	width,
	height,
	animationDuration = 1,
	className,
	stroke,
	fill,
	trackClassName = "fill-transparent",
	trackStroke,
	trackFill
}: LoadingSpinnerProps){
	//https://github.com/n3r4zzurr0/svg-spinners/blob/main/svg-smil/180-ring-with-bg.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}
			/>
			<path
				d="M12,4a8,8,0,0,1,7.89,6.7A1.53,1.53,0,0,0,21.38,12h0a1.5,1.5,0,0,0,1.48-1.75,11,11,0,0,0-21.72,0A1.5,1.5,0,0,0,2.62,12h0a1.53,1.53,0,0,0,1.49-1.3A8,8,0,0,1,12,4Z"
				className={className}
				stroke={stroke}
				fill={fill}
			>
				<animateTransform
					attributeName="transform"
					type="rotate"
					dur={animationDuration}
					values="0 12 12;360 12 12"
					repeatCount="indefinite"
				/>
			</path>
		</svg>
	);
}
