"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const react_1 = tslib_1.__importDefault(require("react"));
const react_core_1 = require("@patternfly/react-core");
const common_1 = require("../../../../common");
const ModalDialogsContext_1 = require("../../hosts/ModalDialogsContext");
const Day2WizardContext_1 = require("./Day2WizardContext");
const Day2WizardNav_1 = tslib_1.__importDefault(require("./Day2WizardNav"));
const DownloadIpxeScript_1 = tslib_1.__importDefault(require("../../../../common/components/clusterConfiguration/DownloadIpxeScript"));
const Day2DownloadISO = () => {
    const { day2DiscoveryImageDialog } = (0, ModalDialogsContext_1.useModalDialogsContext)();
    const { close, data } = day2DiscoveryImageDialog;
    const cluster = data.cluster;
    const wizardContext = (0, Day2WizardContext_1.useDay2WizardContext)();
    const isoDownloadUrl = wizardContext.selectedIsoUrl;
    const ipxeDownloadUrl = wizardContext.selectedIpxeUrl;
    const nameImageSuffix = `${cluster.name || ''}`;
    return (react_1.default.createElement(common_1.ClusterWizardStep, { navigation: react_1.default.createElement(Day2WizardNav_1.default, null) },
        react_1.default.createElement(react_core_1.Stack, { hasGutter: true },
            react_1.default.createElement(react_core_1.StackItem, null,
                react_1.default.createElement(common_1.ClusterWizardStepHeader, null, "Download Discovery ISO")),
            react_1.default.createElement(react_core_1.StackItem, null,
                isoDownloadUrl && (react_1.default.createElement(common_1.DownloadIso, { fileName: `discovery_image_${nameImageSuffix}.iso`, downloadUrl: isoDownloadUrl, isSNO: (0, common_1.isSNO)(cluster), onReset: () => wizardContext.moveBack(), onClose: close })),
                ipxeDownloadUrl && (react_1.default.createElement(DownloadIpxeScript_1.default, { fileName: `discovery_ipxe_script_${nameImageSuffix}.txt`, downloadUrl: ipxeDownloadUrl, isSNO: (0, common_1.isSNO)(cluster), onReset: () => wizardContext.moveBack(), onClose: close }))))));
};
exports.default = Day2DownloadISO;
//# sourceMappingURL=Day2DownloadISO.js.map