import { Box, HStack, useRadio, useRadioGroup } from "@chakra-ui/react"; const RatingRadioButton = (props) => { const { getInputProps, getCheckboxProps } = useRadio(props); const input = getInputProps(); const checkbox = getCheckboxProps(); return ( {props.children} ); }; const RatingRadioGroup = (props) => { const { min, max, onChange } = props; const { getRadioProps, getRootProps } = useRadioGroup({ name: "rating", defaultValue: `${min}`, onChange: onChange, }); const group = getRootProps(); const options = Array.from(new Array(1 + max - min), (x, i) => `${i + min}`); return ( {options.map((option) => { const radio = getRadioProps({ value: option }); return ( {option} ); })} ); }; export default RatingRadioGroup;