import { RadioChecked, RadioUnchecked } from "@app/assets/images/icons"; import { RadioProps } from "@app/models/components"; import React, { useId } from "react"; import "./radio-styles.scss"; const Radio: React.FC = ({ name, containerID = "", onChange, value, checked, label, size = "md", icons, rightIcon, }) => { const sizeMapping = { sm: "radio-sm", md: "radio-md", lg: "radio-lg", }; const inputID = useId(); const checkedIcon = icons?.checkedIcon || RadioChecked; const uncheckedIcon = icons?.uncheckedIcon || RadioUnchecked; return (
{checked ? checkedIcon : uncheckedIcon} {label && } {rightIcon}
); }; export default Radio;