import type { RadioChangeEvent, RadioGroupProps, SpaceProps } from 'antd'; import { Radio as AntRadio, Space } from 'antd'; import type { CheckboxOptionType } from 'antd/lib/checkbox'; import type { Key } from 'react'; type RadioProps = Omit & { onChange?: (value: unknown) => void; options?: CheckboxOptionType[]; spaceProps?: SpaceProps; }; export function Radio({ value = null, options, spaceProps, onChange, ...props }: RadioProps) { function handleChange(event: RadioChangeEvent) { if (onChange) onChange(event.target.value); } const buttons = options?.map((option) => ( {option.label} )); return ( {spaceProps ? {buttons} : buttons} ); }