import _defineProperty from "@babel/runtime/helpers/defineProperty";
import React, { memo, useCallback, useContext } from 'react';
import classnames from 'classnames';
import Icon from '../icon';
import ConfigContext from '../config-provider/ConfigContext';

var TabsAddBtn = function TabsAddBtn(props) {
  var _classnames;

  var _useContext = useContext(ConfigContext),
      getPrefixCls = _useContext.getPrefixCls;

  var onEdit = props.onEdit,
      customizePrefixCls = props.prefixCls,
      extraPrefixCls = props.extraPrefixCls,
      _props$vertical = props.vertical,
      vertical = _props$vertical === void 0 ? false : _props$vertical,
      isFixed = props.isFixed;
  var prefixCls = getPrefixCls('tabs', customizePrefixCls);
  var createNewTab = useCallback(function (e) {
    if (onEdit) {
      onEdit(e, 'add');
    }
  }, [onEdit]);
  var classes = classnames("".concat(prefixCls, "-nav-add"), (_classnames = {}, _defineProperty(_classnames, "".concat(prefixCls, "-nav-add-fixed"), isFixed), _defineProperty(_classnames, "".concat(prefixCls, "-nav-vertical-add"), vertical), _classnames));
  return /*#__PURE__*/React.createElement("div", {
    className: classes,
    style: {
      display: extraPrefixCls || 'block'
    },
    onClick: createNewTab
  }, /*#__PURE__*/React.createElement(Icon, {
    type: "add"
  }));
};

TabsAddBtn.displayName = 'TabsAddBtn';
export default /*#__PURE__*/memo(TabsAddBtn);
//# sourceMappingURL=TabsAddBtn.js.map
