import React, {useState} from 'react' import {View} from 'react-native' import {RadioButton} from './RadioButton' export interface RadioGroupItem { label: string key: string } export function RadioGroup({ items, onSelect, }: { items: RadioGroupItem[] onSelect: (key: string) => void }) { const [selection, setSelection] = useState('') const onSelectInner = (key: string) => { setSelection(key) onSelect(key) } return ( {items.map(item => ( onSelectInner(item.key)} /> ))} ) }