import React, { PropsWithChildren, useState } from 'react'; import { RadioListProps } from '../radioProps'; import { styRadioList } from '../styles/styles'; import Radio from '../Radio/Radio'; const RadioList = (props: PropsWithChildren): JSX.Element => { const { direction = 'row', options, checked, onChange, onRadioChange, ...rest } = props; const className = `${styRadioList(direction)}`; const [selected, setSelected] = useState(null); const handleRadioChange = (value: any): void => { setSelected(value); if (onChange != null) { onChange(value); } }; return (
{options.map((option: any, index: number) => ( {option.label} ))}
); }; export default RadioList;