import React from 'react'; import { ImageStyle, StyleSheet, TextStyle, View, ViewStyle, Text } from 'react-native'; import { Image } from 'expo-image'; import { MultiSelect } from 'react-native-element-dropdown'; export interface DropdownOption { label: string; value: string; } export interface MultiSelectDropdownProps { data: DropdownOption[]; value: string[]; onChange: (value: string[]) => void; placeholder?: string; labelField?: string; valueField?: string; style?: ViewStyle; dropdownStyle?: ViewStyle; placeholderStyle?: TextStyle; selectedTextStyle?: TextStyle; inputSearchStyle?: TextStyle; iconStyle?: ImageStyle; search?: boolean; maxHeight?: number; disabled?: boolean; } const MultiSelectDropdown: React.FC = ({ data, value, onChange, placeholder = 'Select', labelField = 'label', valueField = 'value', style, dropdownStyle, placeholderStyle, selectedTextStyle, inputSearchStyle, iconStyle, search = true, maxHeight = 300, disabled = false, }) => { return ( { const isSelected = value.includes(item.value); return ( {item.label} ); }} /> ); }; const styles = StyleSheet.create({ dropdown: { borderColor: '#ccc', borderWidth: 1, borderRadius: 8, padding: 8, backgroundColor: '#fff', }, placeholderStyle: { color: '#888', fontSize: 16, }, selectedTextStyle: { color: '#333', fontSize: 16, fontWeight: 'bold', }, itemTextStyle: { color: '#333', fontSize: 16, }, inputSearchStyle: { color: '#333', fontSize: 16, }, iconStyle: { width: 24, height: 24, } as ImageStyle, item: { padding: 10, borderRadius: 6, backgroundColor: '#fff', marginVertical: 2, }, selectedItem: { backgroundColor: '#e0f0ff', // Light blue for selected }, }); export default MultiSelectDropdown;