import type { RadioButtonProps } from "$/types/InputTypes";
import { Radio } from "@headlessui/react";
import clsx from "clsx";


export default function RadioButton({
	id,
	className,
	labelClassName,
	size = "sm",
	value,
	children
}: RadioButtonProps){
	return (
		<Radio
			id={id}
			value={value}
			className="group flex flex-row items-center justify-center gap-x-2 cursor-pointer"
		>
			<div
				className={clsx(
					"rounded-full not-group-data-checked:border",
					className,
					{
						"": size === "none",
						"size-3": size === "xs",
						"size-4": size === "sm",
						"size-5": size === "md",
						"size-6": size === "lg",
						"size-7": size === "xl"
					}
				)}
			/>
			{
				children &&
				<div
					className={labelClassName}
				>
					{children}
				</div>
			}
		</Radio>
	);
}
