import React from 'react' import PropTypes from 'prop-types' import { View, TouchableOpacity } from 'react-native' import AppText from '../common/app-text' import styles from '../../styles' export default function SelectBoxGroup({ labels, onSelect, optionsState }) { return ( {Object.keys(labels).map(key => { const style = [styles.selectBox] const textStyle = [] if (optionsState[key]) { style.push(styles.selectBoxActive) textStyle.push(styles.selectBoxTextActive) } return ( onSelect(key)} key={key} > {labels[key]} ) })} ) } SelectBoxGroup.propTypes = { labels: PropTypes.object.isRequired, onSelect: PropTypes.func.isRequired, optionsState: PropTypes.object.isRequired }