import { Icon } from '../../general/Icon/Icon'; import { IconPathsType } from '../../general/Icon/icons'; import { Flex } from '../../general/Flex/Flex'; import { RadioHighlight, RadioLabel, RadioLabelContainer, } from './RadioGroup.style'; export type RadioOption = { label: string; value: string; sublabel?: string; icon?: IconPathsType; disabled?: boolean; hidden?: boolean; highlightColor?: string; }; type Props = { options: RadioOption[]; selected?: string; onClick: (value: string) => void; }; export const RadioGroup = ({ options, selected, onClick }: Props) => ( {options.map((option) => { const isSelected = option.value === selected; return ( onClick(option.value)} > {isSelected && } {option.icon && ( )} {option.label} ); })} );