"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 exclamation_circle_icon_1 = require("@patternfly/react-icons/dist/js/icons/exclamation-circle-icon");
const getNavItemContent = (content, isValid, isDisabled, isCurrent) => {
    if (!isDisabled && !isCurrent && !isValid()) {
        return (react_1.default.createElement(react_1.default.Fragment, null,
            content,
            react_1.default.createElement(react_core_1.Icon, { status: "danger", className: "wizard-nav-item-warning-icon" },
                react_1.default.createElement(exclamation_circle_icon_1.ExclamationCircleIcon, null))));
    }
    return content;
};
const NavItem = (_a) => {
    var { isValid = () => true, children } = _a, props = tslib_1.__rest(_a, ["isValid", "children"]);
    const { content, isDisabled, isCurrent } = props;
    return (react_1.default.createElement(react_core_1.WizardNavItem, Object.assign({}, props, { content: getNavItemContent(content, isValid, isDisabled, isCurrent), "data-testid": "cluster-wizard-navitem" }), children));
};
exports.default = NavItem;
//# sourceMappingURL=WizardNavItem.js.map