"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.OpenShiftVersionModal = void 0;
const tslib_1 = require("tslib");
const react_1 = tslib_1.__importDefault(require("react"));
const react_core_1 = require("@patternfly/react-core");
const OpenShiftSelectWithSearch_1 = require("./OpenShiftSelectWithSearch");
const formik_1 = require("formik");
require("./OpenShiftVersionModal.css");
const OpenShiftVersionModal = ({ allVersions, onClose, getHelperText, }) => {
    const { values, setFieldValue } = (0, formik_1.useFormikContext)();
    return (react_1.default.createElement(react_core_1.Modal, { id: "available-openshift-versions-modal", isOpen: true, onClose: onClose, variant: react_core_1.ModalVariant.small },
        react_1.default.createElement(react_core_1.ModalHeader, { title: "Available OpenShift Versions" }),
        react_1.default.createElement(react_core_1.ModalBody, null,
            react_1.default.createElement(react_core_1.FormGroup, { id: `form-control__customOpenshiftSelect`, fieldId: 'customOpenshiftSelect', label: 'OpenShift version', isRequired: true },
                react_1.default.createElement(OpenShiftSelectWithSearch_1.OpenShiftSelectWithSearch, { versions: allVersions, getHelperText: getHelperText }))),
        react_1.default.createElement(react_core_1.ModalFooter, null,
            react_1.default.createElement(react_core_1.Button, { key: "select-custom-ocp", variant: react_core_1.ButtonVariant.primary, onClick: () => {
                    setFieldValue('openshiftVersion', values.customOpenshiftSelect);
                    onClose();
                } }, "Select"),
            react_1.default.createElement(react_core_1.Button, { key: "close-custom-ocp", variant: react_core_1.ButtonVariant.link, onClick: onClose }, "Cancel"))));
};
exports.OpenShiftVersionModal = OpenShiftVersionModal;
//# sourceMappingURL=OpenShiftVersionModal.js.map