import _Tabs from "antd/es/tabs";
import _extends from "@babel/runtime/helpers/extends";
import _inheritsLoose from "@babel/runtime/helpers/inheritsLoose";
import React, { Component } from 'react';
var Tabs = /*#__PURE__*/function (_Component) {
  _inheritsLoose(Tabs, _Component);
  function Tabs() {
    var _this$props$activeKey;
    var _this;
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _Component.call.apply(_Component, [this].concat(args)) || this;
    _this.state = {
      activeKey: (_this$props$activeKey = _this.props.activeKey) !== null && _this$props$activeKey !== void 0 ? _this$props$activeKey : _this.props.defaultActiveKey
    };
    _this._handleChange = function (key) {
      _this.setActiveKey(key);
    };
    _this.setActiveKey = function (key) {
      var _this$props$onChange = _this.props.onChange,
        onChange = _this$props$onChange === void 0 ? function () {} : _this$props$onChange;
      _this.setState({
        activeKey: key
      });
      onChange(key);
    };
    _this.getActiveKey = function () {
      return _this.state.activeKey;
    };
    return _this;
  }
  var _proto = Tabs.prototype;
  _proto.render = function render() {
    var props = this.props;
    var activeKey = this.state.activeKey;
    return /*#__PURE__*/React.createElement(_Tabs, _extends({}, props, {
      activeKey: activeKey,
      onChange: this._handleChange
    }));
  };
  return Tabs;
}(Component);
Tabs.TabPane = _Tabs.TabPane;
export default Tabs;