import React, { useCallback } from 'react' import classNames from 'classnames' import { Radio, RadioProps } from '../Radio/Radio' import { InfoTooltip } from '../InfoTooltip' import { RadioOptionsProps } from './RadioOptions.types' import './RadioOptions.css' export const RadioOptions = ( props: RadioOptionsProps ) => { const { onChange, value, options, className } = props const handleChange = useCallback( (_evt: React.FormEvent, data: RadioProps) => { if (data.value !== undefined) { return onChange(data.value as T) } }, [onChange] ) return (
{options.map((option) => ( {option.name} {option.info ? : null} } value={option.value} checked={option.value === value} /> ))}
) }