var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
import React from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import { TabPanel } from './TabPanel';
import { TabItem } from './TabItem';
import { Icon } from './Icon';
import { Block } from './Block';
var WizardNavbar = /** @class */ (function (_super) {
    __extends(WizardNavbar, _super);
    function WizardNavbar() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    WizardNavbar.prototype.render = function () {
        var _this = this;
        var currentStepIndex = this.context.wizard.getCurrentStepIndex();
        var maxVisitedStepIndex = this.context.wizard.getMaxVisitedStepIndex();
        return (React.createElement(Block, { cancelBottomOffset: true },
            React.createElement(TabPanel, { centered: true, noBorder: true }, this.context.wizard
                .getSteps()
                .filter(function (step) {
                return !step.props.skipNavbarItem;
            })
                .map(function (step, index) {
                var isPassed = index < currentStepIndex;
                var isCurrent = index === currentStepIndex;
                var isBlocked = step.props.disabled || index > maxVisitedStepIndex;
                return (React.createElement(TabItem, { key: 'wizardStep-' + step.props.id, testAutomationId: step.props.id, active: isCurrent, disabled: isBlocked, className: classnames({ success: isPassed }), onSelect: function () { return _this.context.wizard.goToStep(step.props.id); } },
                    isPassed ? (React.createElement(Icon, { name: "checkbox-selected-readonly" })) : (React.createElement("strong", null, index + 1)),
                    step.props.tabText || step.props.title));
            }))));
    };
    WizardNavbar.contextTypes = {
        wizard: PropTypes.object.isRequired
    };
    return WizardNavbar;
}(React.Component));
export { WizardNavbar };
//# sourceMappingURL=WizardNavbar.js.map