import React, { memo } from 'react'; import { TouchableOpacity, StyleSheet } from 'react-native'; import CheckBox from '../CheckBox'; const DropdownListItem = ({ item, optionLabel, optionValue, isMultiple, selectedOption, onChange, primaryColor, checkboxSize, checkboxStyle, checkboxLabelStyle, checkboxComponentStyles, checkboxComponent, checkboxControls, }: any) => { return ( {} : () => onChange(item[optionValue]) // intentionally didn't use the disable property } > onChange(item[optionValue])} primaryColor={primaryColor} checkboxControls={checkboxControls} checkboxSize={checkboxComponentStyles?.checkboxSize || checkboxSize} checkboxStyle={checkboxComponentStyles?.checkboxStyle || checkboxStyle} checkboxLabelStyle={ checkboxComponentStyles?.checkboxLabelStyle || checkboxLabelStyle } disabled={item.disabled} checkboxComponent={checkboxComponent} /> ); }; const styles = StyleSheet.create({ listItemContainerStyle: { paddingHorizontal: 20, paddingVertical: 10, flexDirection: 'row', alignItems: 'center', }, }); export default memo(DropdownListItem);