"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.WizardFooter = void 0;
const tslib_1 = require("tslib");
const React = tslib_1.__importStar(require("react"));
const react_core_1 = require("@patternfly/react-core");
const use_translation_wrapper_1 = require("../../hooks/use-translation-wrapper");
const ViewClusterEventsButton_1 = tslib_1.__importDefault(require("./ViewClusterEventsButton"));
const WizardFooter = ({ alerts, errors, onNext, onBack, onCancel, onReset, isNextDisabled, isBackDisabled, leftExtraActions, isSubmitting, submittingText, nextButtonText, cluster, onFetchEvents, isNextButtonLoading, isWaitingForHosts, }) => {
    const { t } = (0, use_translation_wrapper_1.useTranslation)();
    submittingText = submittingText || t('ai:Saving changes...');
    return (React.createElement(react_core_1.Stack, { hasGutter: true },
        alerts && React.createElement(react_core_1.StackItem, null, alerts),
        errors && React.createElement(react_core_1.StackItem, null, errors),
        React.createElement(react_core_1.StackItem, null,
            React.createElement(react_core_1.ActionList, { "data-testid": "wizard-step-actions" },
                leftExtraActions,
                onNext && (React.createElement(react_core_1.ActionListItem, null,
                    React.createElement(react_core_1.Button, { variant: react_core_1.ButtonVariant.primary, name: "next", onClick: onNext, isDisabled: isNextDisabled, isLoading: isNextButtonLoading }, nextButtonText || t('ai:Next')))),
                onBack && (React.createElement(react_core_1.ActionListItem, null,
                    React.createElement(react_core_1.Button, { variant: react_core_1.ButtonVariant.secondary, name: "back", onClick: onBack, isDisabled: isBackDisabled }, t('ai:Back')))),
                onCancel && (React.createElement(react_core_1.ActionListItem, null,
                    React.createElement(react_core_1.Button, { variant: react_core_1.ButtonVariant.link, name: "cancel", onClick: onCancel, isDisabled: false }, t('ai:Cancel')))),
                onReset && cluster && (React.createElement(react_core_1.ActionListItem, null,
                    React.createElement(react_core_1.Button, { variant: react_core_1.ButtonVariant.link, name: "reset", onClick: onReset, isDisabled: isSubmitting }, t('ai:Reset')))),
                isSubmitting && (React.createElement(react_core_1.ActionListItem, null,
                    React.createElement(react_core_1.Content, { component: react_core_1.ContentVariants.small },
                        React.createElement(react_core_1.Spinner, { size: "sm", "data-testid": "wizard-footer-spinner" }),
                        " ",
                        submittingText))),
                isWaitingForHosts && !isSubmitting && (React.createElement(react_core_1.ActionListItem, null,
                    React.createElement(react_core_1.Content, { component: react_core_1.ContentVariants.small },
                        React.createElement(react_core_1.Spinner, { size: "sm", "data-testid": "wizard-footer-hosts-spinner" }),
                        ' ',
                        t('ai:Waiting for hosts to be ready...')))),
                React.createElement(react_core_1.SplitItem, { isFilled: true }),
                cluster && onFetchEvents && (React.createElement(react_core_1.ActionListItem, null,
                    React.createElement(ViewClusterEventsButton_1.default, { cluster: cluster, onFetchEvents: onFetchEvents })))))));
};
exports.WizardFooter = WizardFooter;
//# sourceMappingURL=WizardFooter.js.map