import React from 'react';
import List, { type IListItem, ListItem } from './list';
interface IRadioGroup {
onChange: React.ChangeEventHandler;
children: React.ReactElement<{ onChange: React.ChangeEventHandler }>[];
}
const RadioGroup = ({ onChange, children }: IRadioGroup) => {
const childrenWithProps = React.Children.map(children, child =>
React.cloneElement(child, { onChange }),
);
return {childrenWithProps}
;
};
interface IRadioItem extends IListItem {
label: React.ReactNode;
hint?: React.ReactNode;
value: string;
checked: boolean;
onChange?: React.ChangeEventHandler;
}
const RadioItem: React.FC = ({ label, hint, checked = false, onChange, value, ...props }) => (
);
export {
RadioGroup,
RadioItem,
};