import React, { CSSProperties, HTMLAttributes } from 'react' import classNames from 'classnames' import _ from 'lodash' import { RadioGroupContext } from './util' import Radio, { RadioProps } from './radio' interface RadioGroupProps extends Omit, 'onChange'> { value?: V onChange?: (value: V) => void name?: string options?: RadioProps[] className?: string style?: CSSProperties } function RadioGroup({ value, onChange = _.noop, name, options = [], className, children, ...rest }: RadioGroupProps) { const handleChange = (rValue: V): void => { console.log(value) onChange(rValue) } const isOptions = options?.length > 0 return (
{isOptions ? options.map((option, index) => ) : children}
) } export default RadioGroup export type { RadioGroupProps }