"use strict";

Object.defineProperty(exports, "__esModule", {
    value: true
});

var _classCallCheck2 = require("babel-runtime/helpers/classCallCheck");

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = require("babel-runtime/helpers/createClass");

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = require("babel-runtime/helpers/possibleConstructorReturn");

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = require("babel-runtime/helpers/inherits");

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = require("react");

var _react2 = _interopRequireDefault(_react);

var _tabs = require("antd/lib/tabs");

var _tabs2 = _interopRequireDefault(_tabs);

var _reactDnd = require("react-dnd");

var _reactDndHtml5Backend = require("react-dnd-html5-backend");

var _draggableTabs = require("./draggableTabs");

var _propTypes = require("prop-types");

var _propTypes2 = _interopRequireDefault(_propTypes);

require("antd/lib/tabs/style");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

var TabPane = _tabs2["default"].TabPane;

var Tabs = function (_Component) {
    (0, _inherits3["default"])(Tabs, _Component);

    function Tabs() {
        (0, _classCallCheck3["default"])(this, Tabs);
        return (0, _possibleConstructorReturn3["default"])(this, (Tabs.__proto__ || Object.getPrototypeOf(Tabs)).apply(this, arguments));
    }

    (0, _createClass3["default"])(Tabs, [{
        key: "render",
        value: function render() {
            var draggable = this.props.draggable;

            return _react2["default"].createElement(
                _reactDnd.DndProvider,
                { backend: _reactDndHtml5Backend.HTML5Backend },
                draggable ? _react2["default"].createElement(_draggableTabs.DraggableTabs, this.props) : _react2["default"].createElement(_tabs2["default"], this.props)
            );
        }
    }]);
    return Tabs;
}(_react.Component);

Tabs.propTypes = {
    draggable: _propTypes2["default"].bool
};
Tabs.defaultProps = {
    draggable: false
};
Tabs.TabPane = TabPane;
exports["default"] = Tabs;
module.exports = exports['default'];