import { __assign, __extends } from "tslib";
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { Component } from 'react';
var BaseTabs = (function (_super) {
    __extends(BaseTabs, _super);
    function BaseTabs() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    BaseTabs.prototype.renderWithPanel = function () {
        var children = this.props.children;
        var tabDataList = this.getTabDataListFromChildren(children);
        return (_jsxs("div", __assign({ className: this.tabsCls, "data-zv": 'v10.0.12' }, { children: [this.renderNav(tabDataList), _jsx("div", __assign({ className: "zent-tabs-panel-wrapper", "data-zv": 'v10.0.12' }, { children: tabDataList.map(this.renderTabPanel.bind(this)) }), void 0)] }), void 0));
    };
    BaseTabs.prototype.renderWithoutPanel = function () {
        var tabs = this.props.tabs;
        return (_jsx("div", __assign({ className: this.tabsCls, "data-zv": 'v10.0.12' }, { children: this.renderNav(this.getTabDataListFromTabs(tabs)) }), void 0));
    };
    BaseTabs.prototype.render = function () {
        var _a = this.props, tabs = _a.tabs, children = _a.children;
        if (!tabs && !children) {
            throw new Error("Tabs Componment must receive one prop of 'tabs' and 'children'");
        }
        if (tabs) {
            return this.renderWithoutPanel();
        }
        return this.renderWithPanel();
    };
    return BaseTabs;
}(Component));
export default BaseTabs;
