import React, { ReactNode } from 'react'; import { Text, Pressable, StyleSheet, Image, TouchableOpacity, ImageStyle, ViewStyle, TextStyle, } from 'react-native'; import { extractTextStylesFromArray } from '../../utils'; export interface DropdownSelectedItemProps { onPress: () => void; style?: (TextStyle | ViewStyle)[]; label: string | ReactNode; removeItemIcon?: ReactNode; onRemoveItem?: () => void; showRemoveIcon?: boolean; disabled: boolean; closeIconStyles?: ImageStyle; testId?: string; } const DropdownSelectedItem = ({ onPress, style, label, removeItemIcon, onRemoveItem, showRemoveIcon, closeIconStyles, testId, disabled, ...rest }: DropdownSelectedItemProps) => { return ( onPress()} {...rest} style={[styles.dropdownInputContent, ...(style ?? [])]} testID={`dropdown-selected-item-${testId}`} > {label} {showRemoveIcon && ( onRemoveItem?.()} testID={`dropdown-selected-item-remove-icon-${testId}`} > {removeItemIcon || ( )} )} ); }; const styles = StyleSheet.create({ dropdownInputContent: { display: 'flex', justifyContent: 'center', alignItems: 'center', flexDirection: 'row', gap: 8, }, removeItemIcon: { height: 10, width: 10, }, }); export default DropdownSelectedItem;