"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MenuPicker = void 0;
var tslib_1 = require("tslib");
var React = tslib_1.__importStar(require("react"));
var picker_1 = require("@react-native-picker/picker");
var TestProps_1 = require("./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
 */
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_1.Picker, tslib_1.__assign({ prompt: prompt, selectedValue: selectedItemKey, onValueChange: function (value, index) { return onChange(value, index); }, style: tslib_1.__assign({}, style) }, (0, TestProps_1.testProps)(testID)), collection.map(function (item, index) { return (React.createElement(picker_1.Picker.Item, tslib_1.__assign({ label: item.label, key: index, value: item.value }, (0, TestProps_1.testProps)(item.testID)))); })));
};
exports.MenuPicker = MenuPicker;
//# sourceMappingURL=MenuPicker.android.js.map