import type { ReactElement, ReactNode } from 'react'; import React from 'react'; import type { StyleProp, ViewStyle } from 'react-native'; import type { IconName } from '../Icon'; import { Circle, InnerCircle, StyledRadio } from './StyledRadio'; interface RadioProps { /** * Whether the radio is checked. */ checked?: boolean; /** * Press event handler. */ onPress: () => void; /** * Radio text. */ text: string; /** * Additional style. */ style?: StyleProp; /** * Radio subtext. */ subText?: string; /** * Testing id of the component. */ testID?: string; /** * Idle background color of the Radio. */ inactiveIntent?: 'light' | 'dark'; /** * Children to be rendered inside the component. */ children?: ReactNode; /** * Prefix to be rendered before the radio text. */ prefix?: IconName | ReactElement; } const RadioCircle = ({ checked, text, }: Pick) => ( {checked && } ); const Radio = ({ text, checked = false, onPress, style, subText, testID, inactiveIntent = 'light', children, prefix, }: RadioProps): ReactElement => ( } style={style} testID={testID} themeIntent={inactiveIntent} themeChecked={checked} > {children} ); export default Radio;