import React from 'react'; import { Box } from '../../primitives'; import { FormControlContext, IFormControlContext, } from '../../composites/FormControl'; import type { IRadioGroupProps } from './props'; export const RadioContext = React.createContext({}); const RadioGroup = ({ size, children, onChange, colorScheme, value, defaultValue, ...props }: IRadioGroupProps) => { const formControlContext: IFormControlContext = React.useContext( FormControlContext ); const [selected, setSelected] = React.useState(value || defaultValue || []); const onChangeHandler = (radioValue: string | number) => { setSelected(radioValue); onChange && onChange(radioValue); }; return ( {children} ); }; export default RadioGroup;