import { Pressable, Text, View } from "react-native"; import { Fonts } from "../styles"; import Style, { defaultItemHeight } from "../styles/Style"; const OptionSelector = ({ optionTypeList = {}, selected, setSelected, containerStyle = {}, colorMap = {}, }) => { return ( {Object.entries(optionTypeList).map(([key, value], index) => { const isSelected = key === selected; return ( setSelected(key)} style={{ ...Style.containerItem, ...Style.containerCenter, flex: 1, padding: 0, height: defaultItemHeight, margin: defaultItemHeight * 0.2, backgroundColor: isSelected ? colorMap[key]?.secondary : "transparent", borderWidth: 1, borderColor: isSelected ? colorMap[key]?.primary : "transparent", }} > {value} ); })} ); }; export default OptionSelector;