"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 AgentsSelectionHostCountAlerts_1 = tslib_1.__importDefault(require("../../Agent/AgentsSelectionHostCountAlerts"));
const AgentsSelectionHostCountLabelIcon_1 = tslib_1.__importDefault(require("../../Agent/AgentsSelectionHostCountLabelIcon"));
const AgentsSelectionUtils_1 = require("../../Agent/AgentsSelectionUtils");
const use_translation_wrapper_1 = require("../../../../common/hooks/use-translation-wrapper");
const LocationsSelector_1 = tslib_1.__importDefault(require("../LocationsSelector"));
const ClusterScaleUpAutoHostsSelection = ({ availableAgents, }) => {
    const { matchingAgents, selectedAgents, hostCount } = (0, AgentsSelectionUtils_1.useAgentsAutoSelection)(availableAgents);
    const { t } = (0, use_translation_wrapper_1.useTranslation)();
    return (react_1.default.createElement(react_1.default.Fragment, null,
        react_1.default.createElement(react_core_1.Grid, { hasGutter: true },
            react_1.default.createElement(react_core_1.GridItem, { span: 12, lg: 10, xl: 9, xl2: 7 },
                react_1.default.createElement(common_1.NumberInputField, { label: t('ai:Number of hosts'), labelIcon: react_1.default.createElement(AgentsSelectionHostCountLabelIcon_1.default, null), idPostfix: "hostcount", name: "hostCount", minValue: 1, maxValue: matchingAgents.length, isRequired: true })),
            react_1.default.createElement(react_core_1.GridItem, { span: 12, lg: 10, xl: 9, xl2: 7 },
                react_1.default.createElement(LocationsSelector_1.default, { agents: availableAgents }))),
        react_1.default.createElement(AgentsSelectionHostCountAlerts_1.default, { matchingAgentsCount: matchingAgents.length, selectedAgents: selectedAgents, targetHostCount: hostCount })));
};
exports.default = ClusterScaleUpAutoHostsSelection;
//# sourceMappingURL=ClusterScaleUpAutoHostsSelection.js.map