el.xwx.moe/components/RadioButton.tsx

31 lines
821 B
TypeScript
Raw Normal View History

2023-05-15 14:18:33 -05:00
import { ChangeEventHandler } from "react";
type Props = {
label: string;
state: boolean;
onClick: ChangeEventHandler<HTMLInputElement>;
};
export default function RadioButton({ label, state, onClick }: Props) {
return (
<label className="cursor-pointer flex items-center gap-2">
<input
type="radio"
value={label}
className="peer sr-only"
checked={state}
onChange={onClick}
/>
2023-12-17 16:28:42 -06:00
{/*<FontAwesomeIcon*/}
{/* icon={faCircleCheck}*/}
{/* className="w-5 h-5 text-primary peer-checked:block hidden"*/}
{/*/>*/}
{/*<FontAwesomeIcon*/}
{/* icon={faCircle}*/}
{/* className="w-5 h-5 text-primary peer-checked:hidden block"*/}
{/*/>*/}
2023-11-24 07:39:55 -06:00
<span className="rounded select-none">{label}</span>
2023-05-15 14:18:33 -05:00
</label>
);
}