"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const react_1 = tslib_1.__importDefault(require("react"));
const classnames_1 = tslib_1.__importDefault(require("classnames"));
const common_1 = require("../../../common");
const NetworkConfigurationForm_1 = tslib_1.__importDefault(require("../clusterConfiguration/networkConfiguration/NetworkConfigurationForm"));
const ReviewStep_1 = tslib_1.__importDefault(require("../clusterConfiguration/review/ReviewStep"));
const ClusterWizardContext_1 = require("./ClusterWizardContext");
const ClusterDetails_1 = tslib_1.__importDefault(require("./ClusterDetails"));
const HostDiscovery_1 = tslib_1.__importDefault(require("./HostDiscovery"));
const Storage_1 = tslib_1.__importDefault(require("./Storage"));
const StaticIp_1 = tslib_1.__importDefault(require("./StaticIp"));
const Operators_1 = tslib_1.__importDefault(require("./Operators"));
const WithErrorBoundary_1 = require("../../../common/components/ErrorHandling/WithErrorBoundary");
const CustomManifestStep_1 = tslib_1.__importDefault(require("./CustomManifestStep"));
const CredentialsDownload_1 = tslib_1.__importDefault(require("./CredentialsDownload"));
const ClusterWizard = ({ cluster, infraEnv, updateInfraEnv }) => {
    const { currentStepId } = (0, ClusterWizardContext_1.useClusterWizardContext)();
    const renderCurrentStep = react_1.default.useCallback(() => {
        switch (currentStepId) {
            case 'custom-manifests':
                return react_1.default.createElement(CustomManifestStep_1.default, { cluster: cluster });
            case 'host-discovery':
                return react_1.default.createElement(HostDiscovery_1.default, { cluster: cluster });
            case 'networking':
                return react_1.default.createElement(NetworkConfigurationForm_1.default, { cluster: cluster });
            case 'review':
                return react_1.default.createElement(ReviewStep_1.default, { cluster: cluster });
            case 'operators':
                return react_1.default.createElement(Operators_1.default, { cluster: cluster });
            case 'storage':
                return react_1.default.createElement(Storage_1.default, { cluster: cluster });
            case 'static-ip-host-configurations':
            case 'static-ip-network-wide-configurations':
            case 'static-ip-yaml-view':
                return react_1.default.createElement(StaticIp_1.default, { cluster: cluster, infraEnv: infraEnv, updateInfraEnv: updateInfraEnv });
            case 'credentials-download':
                return react_1.default.createElement(CredentialsDownload_1.default, { cluster: cluster });
            case 'cluster-details':
            default:
                return react_1.default.createElement(ClusterDetails_1.default, { cluster: cluster, infraEnv: infraEnv });
        }
    }, [currentStepId, cluster, infraEnv, updateInfraEnv]);
    if (!currentStepId) {
        return react_1.default.createElement(common_1.LoadingState, null);
    }
    return (react_1.default.createElement(WithErrorBoundary_1.WithErrorBoundary, null,
        react_1.default.createElement("div", { className: (0, classnames_1.default)('pf-v6-c-wizard', 'cluster-wizard') }, renderCurrentStep())));
};
exports.default = ClusterWizard;
//# sourceMappingURL=ClusterWizard.js.map