"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];

var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")["default"];

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;

var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));

var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));

var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));

var _react = _interopRequireWildcard(require("react"));

var _classnames = _interopRequireDefault(require("classnames"));

var _ConfigContext = _interopRequireDefault(require("../config-provider/ConfigContext"));

var _excluded = ["prefixCls", "type", "orientation", "className", "children", "dashed"];

var Divider = function Divider(_ref) {
  var _classNames;

  var customizePrefixCls = _ref.prefixCls,
      _ref$type = _ref.type,
      type = _ref$type === void 0 ? 'horizontal' : _ref$type,
      _ref$orientation = _ref.orientation,
      orientation = _ref$orientation === void 0 ? '' : _ref$orientation,
      className = _ref.className,
      children = _ref.children,
      dashed = _ref.dashed,
      restProps = (0, _objectWithoutProperties2["default"])(_ref, _excluded);

  var _useContext = (0, _react.useContext)(_ConfigContext["default"]),
      getPrefixCls = _useContext.getPrefixCls;

  var prefixCls = getPrefixCls('divider', customizePrefixCls);
  var orientationPrefix = orientation.length > 0 ? "-".concat(orientation) : orientation;
  var classString = (0, _classnames["default"])(className, prefixCls, "".concat(prefixCls, "-").concat(type), (_classNames = {}, (0, _defineProperty2["default"])(_classNames, "".concat(prefixCls, "-with-text").concat(orientationPrefix), children), (0, _defineProperty2["default"])(_classNames, "".concat(prefixCls, "-dashed"), !!dashed), _classNames));
  return /*#__PURE__*/_react["default"].createElement("div", (0, _extends2["default"])({
    className: classString
  }, restProps), children && /*#__PURE__*/_react["default"].createElement("span", {
    className: "".concat(prefixCls, "-inner-text")
  }, children));
};

Divider.displayName = 'Divider';

var _default = /*#__PURE__*/(0, _react.memo)(Divider);

exports["default"] = _default;
//# sourceMappingURL=index.js.map
