"use strict";
var __extends = (this && this.__extends) || (function () {
    var 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 function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
Object.defineProperty(exports, "__esModule", { value: true });
//React
var React = require("react");
var Tabs = /** @class */ (function (_super) {
    __extends(Tabs, _super);
    function Tabs(props) {
        var _this = _super.call(this, props) || this;
        _this.state = {
            selected: 3
        };
        return _this;
    }
    Tabs.prototype.handleClick = function (index, event) {
        event.preventDefault();
        this.setState({
            selected: index
        });
    };
    Tabs.prototype._renderTitles = function () {
        function labels(child, index) {
            var activeClass = (this.state.selected === index ? 'active' : '');
            return (React.createElement("li", { key: index },
                React.createElement("a", { href: "#", className: activeClass, onClick: this.handleClick.bind(this, index) }, child.props.label)));
        }
        return (React.createElement("ul", { className: "nav nav-tabs" }, this.props.children.map(labels.bind(this))));
    };
    Tabs.prototype._renderContent = function () {
        return (React.createElement("div", { className: "tab-content" }, this.props.children[this.state.selected]));
    };
    Tabs.prototype.render = function () {
        return (React.createElement("div", { className: "tabs" },
            this._renderTitles(),
            this._renderContent()));
    };
    return Tabs;
}(React.Component));
exports.Tabs = Tabs;
var TabPane = /** @class */ (function (_super) {
    __extends(TabPane, _super);
    function TabPane(props) {
        return _super.call(this, props) || this;
    }
    TabPane.prototype.render = function () {
        return (React.createElement("div", null, this.props.children));
    };
    return TabPane;
}(React.Component));
exports.TabPane = TabPane;
//# sourceMappingURL=Tabs.js.map