"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const react_core_1 = require("@patternfly/react-core");
const react_1 = tslib_1.__importDefault(require("react"));
const common_1 = require("../../../common");
const FinalizingProgress_1 = require("../../../common/components/clusterDetail/FinalizingProgress");
const ProgressBarTexts_1 = require("../../../common/components/clusterDetail/ProgressBarTexts");
const OcmOperatorProgressItem_1 = tslib_1.__importDefault(require("./OcmOperatorProgressItem"));
const OcmClusterProgressItems = ({ cluster, minimizedView = false, onFetchEvents, fallbackEventsURL, }) => {
    const enabledHosts = (0, common_1.getEnabledHosts)(cluster.hosts);
    const olmOperators = (0, common_1.selectOlmOperators)(cluster);
    const masterHosts = enabledHosts.filter((host) => host.role && 'master' === host.role);
    const workerHosts = enabledHosts.filter((host) => host.role && 'worker' === host.role);
    return (react_1.default.createElement(react_1.default.Fragment, null,
        react_1.default.createElement(common_1.RenderIf, { condition: !minimizedView },
            react_1.default.createElement(react_core_1.Grid, { hasGutter: true },
                react_1.default.createElement(react_core_1.GridItem, { span: 3 },
                    react_1.default.createElement(ProgressBarTexts_1.ProgressBarTexts, { hosts: masterHosts, hostRole: "master" })),
                react_1.default.createElement(common_1.RenderIf, { condition: workerHosts.length > 0 },
                    react_1.default.createElement(react_core_1.GridItem, { span: 3 },
                        react_1.default.createElement(ProgressBarTexts_1.ProgressBarTexts, { hosts: workerHosts, hostRole: "worker" }))),
                react_1.default.createElement(react_core_1.GridItem, { span: 3 },
                    react_1.default.createElement(FinalizingProgress_1.FinalizingProgress, { cluster: cluster, onFetchEvents: onFetchEvents, fallbackEventsURL: fallbackEventsURL })),
                react_1.default.createElement(common_1.RenderIf, { condition: olmOperators.length > 0 },
                    react_1.default.createElement(react_core_1.GridItem, { span: 3 },
                        react_1.default.createElement(OcmOperatorProgressItem_1.default, { operators: olmOperators })))))));
};
exports.default = OcmClusterProgressItems;
//# sourceMappingURL=OcmClusterProgressItems.js.map