"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.VMRebootConfigurationContent = void 0;
const tslib_1 = require("tslib");
const react_1 = tslib_1.__importDefault(require("react"));
const react_core_1 = require("@patternfly/react-core");
const info_circle_icon_1 = require("@patternfly/react-icons/dist/js/icons/info-circle-icon");
const react_i18next_1 = require("react-i18next");
const ui_1 = require("../../../common/components/ui");
const use_translation_wrapper_1 = require("../../hooks/use-translation-wrapper");
const VMRebootConfigurationContent = () => {
    const { t } = (0, use_translation_wrapper_1.useTranslation)();
    return (react_1.default.createElement(react_core_1.Content, null,
        react_1.default.createElement(react_core_1.Content, { component: react_core_1.ContentVariants.p }, t('ai:Your libvirt virtual machines should be configured to restart automatically after a reboot. You can check this by running:')),
        react_1.default.createElement(ui_1.PrismCode, { code: "virsh dumpxml <name> | grep on_reboot" }),
        react_1.default.createElement(react_core_1.Content, { component: react_core_1.ContentVariants.p }, t('ai:And verify that this is the output:')),
        react_1.default.createElement(ui_1.PrismCode, { code: "<on_reboot>restart</on_reboot>" }),
        react_1.default.createElement(react_core_1.Content, { component: react_core_1.ContentVariants.p }, t('ai:If not, please start your VMs with the following configuration:')),
        react_1.default.createElement(ui_1.PrismCode, { code: "--events on_reboot=restart" }),
        react_1.default.createElement(react_i18next_1.Trans, { t: t, components: { code: react_1.default.createElement("code", null) }, i18nKey: "ai:When using <code>{{executionCommand}}</code>, please run:", values: { executionCommand: 'virt-install' } }),
        react_1.default.createElement(ui_1.PrismCode, { code: "virt-install --wait -1 <rest of the command>" }),
        react_1.default.createElement(react_core_1.Content, { component: react_core_1.ContentVariants.p }, t('ai:Otherwise, the VMs will not be able to reboot during the installation process.'))));
};
exports.VMRebootConfigurationContent = VMRebootConfigurationContent;
const VMRebootConfigurationInfo = () => {
    const { t } = (0, use_translation_wrapper_1.useTranslation)();
    return (react_1.default.createElement(react_core_1.Content, { component: "p" },
        react_1.default.createElement(react_core_1.Popover, { bodyContent: react_1.default.createElement(exports.VMRebootConfigurationContent, null), minWidth: "35rem" },
            react_1.default.createElement(react_core_1.Button, { variant: react_core_1.ButtonVariant.link, isInline: true },
                react_1.default.createElement(react_1.default.Fragment, null,
                    react_1.default.createElement(react_core_1.Icon, { size: "sm" },
                        react_1.default.createElement(info_circle_icon_1.InfoCircleIcon, null)),
                    "\u00A0"),
                t('ai:Check your VM reboot configuration')))));
};
exports.default = VMRebootConfigurationInfo;
//# sourceMappingURL=VMRebootConfigurationInfo.js.map