"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const React = tslib_1.__importStar(require("react"));
const EditHostModal_1 = tslib_1.__importDefault(require("../../../common/components/hosts/EditHostModal"));
const toAssisted_1 = require("../helpers/toAssisted");
const EditAgentModal = (_a) => {
    var _b;
    var { agent, onSave } = _a, rest = tslib_1.__rest(_a, ["agent", "onSave"]);
    const [host] = agent ? (0, toAssisted_1.getAIHosts)([agent]) : [];
    return (React.createElement(EditHostModal_1.default, Object.assign({ isOpen: true, host: host, inventory: (_b = agent === null || agent === void 0 ? void 0 : agent.status) === null || _b === void 0 ? void 0 : _b.inventory }, rest, { onSave: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ hostname }) {
            agent && (yield onSave(host, hostname));
            rest.onClose();
        }) })));
};
exports.default = EditAgentModal;
//# sourceMappingURL=EditAgentModal.js.map