"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ClusterDeploymentWizardContextProvider = exports.ClusterDeploymentWizardContext = void 0;
const tslib_1 = require("tslib");
const react_1 = tslib_1.__importDefault(require("react"));
exports.ClusterDeploymentWizardContext = react_1.default.createContext({
    syncError: undefined,
});
const ClusterDeploymentWizardContextProvider = ({ children, agentClusterInstall, }) => {
    var _a;
    const syncError = react_1.default.useMemo(() => {
        var _a, _b, _c;
        return (_c = (_b = (_a = agentClusterInstall === null || agentClusterInstall === void 0 ? void 0 : agentClusterInstall.status) === null || _a === void 0 ? void 0 : _a.conditions) === null || _b === void 0 ? void 0 : _b.find((c) => c.type === 'SpecSynced' && c.status === 'False')) === null || _c === void 0 ? void 0 : _c.message;
    }, [(_a = agentClusterInstall === null || agentClusterInstall === void 0 ? void 0 : agentClusterInstall.status) === null || _a === void 0 ? void 0 : _a.conditions]);
    return (react_1.default.createElement(exports.ClusterDeploymentWizardContext.Provider, { value: { syncError } }, children));
};
exports.ClusterDeploymentWizardContextProvider = ClusterDeploymentWizardContextProvider;
//# sourceMappingURL=ClusterDeploymentWizardContext.js.map