"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.HostRequirementsList = void 0;
const tslib_1 = require("tslib");
const react_core_1 = require("@patternfly/react-core");
const React = tslib_1.__importStar(require("react"));
const ExternalLink_1 = tslib_1.__importDefault(require("../ui/ExternalLink"));
const use_translation_wrapper_1 = require("../../hooks/use-translation-wrapper");
const utils_1 = require("../../utils");
const docs_links_1 = require("../../config/docs_links");
const parseRAM = (req) => (0, utils_1.fileSize)(((req === null || req === void 0 ? void 0 : req.ramMib) || 16 * 1024) * 1024 * 1024, 2, 'iec');
const HostRequirementsList = ({ master, worker, sno, isSNOCluster, }) => {
    const masterRam = parseRAM(master);
    const workerRam = parseRAM(worker);
    const snoRam = parseRAM(sno);
    const { t } = (0, use_translation_wrapper_1.useTranslation)();
    return (React.createElement(react_core_1.List, null,
        !isSNOCluster && (React.createElement(React.Fragment, null,
            React.createElement(react_core_1.ListItem, null, t('ai:Control plane nodes: At least {{master_cpu_cores}} CPU cores, {{master_ram}} RAM, {{master_disksize}} GB disk size for every control plane node.', {
                master_cpu_cores: (master === null || master === void 0 ? void 0 : master.cpuCores) || 4,
                master_ram: masterRam,
                master_disksize: (master === null || master === void 0 ? void 0 : master.diskSizeGb) || 120,
            })),
            React.createElement(react_core_1.ListItem, null, t('ai:Workers: At least {{worker_cpu_cores}} CPU cores, {{worker_ram}} RAM, {{worker_disksize}} GB disk size for each worker ', {
                worker_cpu_cores: (worker === null || worker === void 0 ? void 0 : worker.cpuCores) || 2,
                worker_ram: workerRam,
                worker_disksize: (worker === null || worker === void 0 ? void 0 : worker.diskSizeGb) || 12,
            })))),
        (isSNOCluster === true || isSNOCluster === undefined) && (React.createElement(React.Fragment, null,
            React.createElement(react_core_1.ListItem, null, t('ai:SNO: One host is required with at least {{sno_cpu_cores}} CPU cores, {{snoRam}} of RAM, and {{sno_disksize}} GB of disk size storage.', {
                sno_cpu_cores: (sno === null || sno === void 0 ? void 0 : sno.cpuCores) || 4,
                snoRam: snoRam,
                sno_disksize: (sno === null || sno === void 0 ? void 0 : sno.diskSizeGb) || 120,
            })))),
        React.createElement(react_core_1.ListItem, null,
            t("ai:Also note that each host's disk write speed should meet the minimum requirements to run OpenShift. "),
            React.createElement(ExternalLink_1.default, { href: docs_links_1.HOST_REQUIREMENTS_LINK }, t('ai:Learn more')))));
};
exports.HostRequirementsList = HostRequirementsList;
const HostRequirements = (props) => (React.createElement(exports.HostRequirementsList, Object.assign({}, props)));
exports.default = HostRequirements;
//# sourceMappingURL=HostRequirements.js.map