({ label, options, value, onChange })
| 2 | import { View, Text, Button, StyleSheet } from 'react-native' |
| 3 | |
| 4 | export default function Toggle({ label, options, value, onChange }) { |
| 5 | return ( |
| 6 | <View style={styles.container}> |
| 7 | <Text style={styles.label}>{label}</Text> |
| 8 | <View style={styles.optionsContainer}> |
| 9 | {options.map((option) => ( |
| 10 | <Button |
| 11 | color={option === value ? '#3B6CD4' : '#AAA'} |
| 12 | onPress={() => onChange(option)} |
| 13 | title={option} |
| 14 | key={option} |
| 15 | /> |
| 16 | ))} |
| 17 | </View> |
| 18 | </View> |
| 19 | ) |
| 20 | } |
| 21 | |
| 22 | const styles = StyleSheet.create({ |
| 23 | container: { |
nothing calls this directly
no outgoing calls
no test coverage detected