import * as React from 'react';
import { Picker } from '@react-native-picker/picker';
import { testProps } from './TestProps';
/*
 * The MenuPicker was created because the RN Core Picker was deprecated (preventing us from updating to RN 0.66).
 * MenuPicker uses the community Picker package for Android
 */
export const MenuPicker = (props) => {
    const { prompt, selected, onChange, collection, style, testID } = props;
    let selectedItemKey;
    collection.forEach((item) => {
        if (item.value == selected) {
            selectedItemKey = item.value;
        }
    });
    return (React.createElement(Picker, { prompt: prompt, selectedValue: selectedItemKey, onValueChange: (value, index) => onChange(value, index), style: { ...style }, ...testProps(testID) }, collection.map((item, index) => (React.createElement(Picker.Item, { label: item.label, key: index, value: item.value, ...testProps(item.testID) })))));
};
//# sourceMappingURL=MenuPicker.android.js.map