import _extends from "@babel/runtime/helpers/esm/extends";
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
import _createClass from "@babel/runtime/helpers/esm/createClass";
import _inherits from "@babel/runtime/helpers/esm/inherits";
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
var _excluded = ["prefixCls", "className", "separator", "children"];

function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }

function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }

/**
 * BreadcrumbItem.jsx
 *
 * @Author: zhangce
 * @Date: 18/1/23 下午2:44
 */
import React, { Fragment } from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import Button from '../button';
/**
 * BreadcrumbItem
 * */

var BreadcrumbItem = /*#__PURE__*/function (_React$PureComponent) {
  _inherits(BreadcrumbItem, _React$PureComponent);

  var _super = _createSuper(BreadcrumbItem);

  function BreadcrumbItem() {
    _classCallCheck(this, BreadcrumbItem);

    return _super.apply(this, arguments);
  }

  _createClass(BreadcrumbItem, [{
    key: "render",
    value: function render() {
      var _this$props = this.props,
          prefixCls = _this$props.prefixCls,
          className = _this$props.className,
          separator = _this$props.separator,
          children = _this$props.children,
          other = _objectWithoutProperties(_this$props, _excluded);

      var classes = classNames(prefixCls, className);
      return /*#__PURE__*/React.createElement("span", {
        className: classes
      }, /*#__PURE__*/React.createElement(Button, _extends({
        variant: "text",
        className: "".concat(prefixCls, "-button")
      }, other), children), /*#__PURE__*/React.createElement("span", {
        className: "".concat(prefixCls, "-separator")
      }, separator));
    }
  }]);

  return BreadcrumbItem;
}(React.PureComponent);

_defineProperty(BreadcrumbItem, "propTypes", {
  /**
   * 类前缀
   * */
  prefixCls: PropTypes.string,

  /**
   * 类名
   * */
  className: PropTypes.string,

  /**
   * 分隔符
   * */
  separator: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),

  /**
   * 跳转链接
   * */
  href: PropTypes.string
});

_defineProperty(BreadcrumbItem, "defaultProps", {
  prefixCls: 'ne-breadcrumb-item'
});

export default BreadcrumbItem;