import { __assign } from "tslib";
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 var MenuPicker = function (props) {
    var prompt = props.prompt, selected = props.selected, onChange = props.onChange, collection = props.collection, style = props.style, testID = props.testID;
    var selectedItemKey;
    collection.forEach(function (item) {
        if (item.value == selected) {
            selectedItemKey = item.value;
        }
    });
    return (React.createElement(Picker, __assign({ prompt: prompt, selectedValue: selectedItemKey, onValueChange: function (value, index) { return onChange(value, index); }, style: __assign({}, style) }, testProps(testID)), collection.map(function (item, index) { return (React.createElement(Picker.Item, __assign({ label: item.label, key: index, value: item.value }, testProps(item.testID)))); })));
};
//# sourceMappingURL=MenuPicker.android.js.map