import { useMemo } from 'react' import { FieldRadioGroupProps } from './types' import { FormErrorMessage, FormLabel, Box, RadioButton } from '@/design-system/components' export const FieldRadioGroup = ({ selectedItem, items, onSelectItem, isRequired, errorMessage, isError, size = 'md', label, labelStyle, isDisabled, radioRef, }: FieldRadioGroupProps) => { const renderRadioButtons = useMemo( () => items?.map((item, index) => { return ( onSelectItem(item.value)} label={item.label} size={size} /> ) }), [items, radioRef, isDisabled, isError, selectedItem, size, onSelectItem] ) return ( {renderRadioButtons} ) } FieldRadioGroup.displayName = 'RadioGroup'