"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 utils_1 = require("./utils");
const use_translation_wrapper_1 = require("../../hooks/use-translation-wrapper");
const HostsCount = ({ cluster, inParenthesis = false, valueId = 'hosts-count', }) => {
    const { t } = (0, use_translation_wrapper_1.useTranslation)();
    const body = (react_1.default.createElement(react_1.default.Fragment, null,
        'readyHostCount' in cluster && (react_1.default.createElement(react_core_1.Level, null,
            react_1.default.createElement(react_core_1.LevelItem, null, t('ai:Ready for the installation')),
            react_1.default.createElement(react_core_1.LevelItem, null, (0, utils_1.getReadyHostCount)(cluster)))),
        'enabledHostCount' in cluster && (react_1.default.createElement(react_core_1.Level, null,
            react_1.default.createElement(react_core_1.LevelItem, null, t('ai:Enabled for the installation')),
            react_1.default.createElement(react_core_1.LevelItem, null, (0, utils_1.getEnabledHostCount)(cluster)))),
        react_1.default.createElement(react_core_1.Level, null,
            react_1.default.createElement(react_core_1.LevelItem, null, t('ai:All discovered')),
            react_1.default.createElement(react_core_1.LevelItem, null, (0, utils_1.getTotalHostCount)(cluster)))));
    const summary = 'enabledHostCount' in cluster ? (0, utils_1.getEnabledHostCount)(cluster) : (0, utils_1.getTotalHostCount)(cluster);
    return (react_1.default.createElement(react_core_1.Popover, { headerContent: t('ai:Hosts in the cluster'), bodyContent: body },
        react_1.default.createElement("a", { id: valueId },
            inParenthesis && '(',
            summary,
            inParenthesis && ')')));
};
exports.default = HostsCount;
//# sourceMappingURL=HostsCount.js.map