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