"use strict";

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

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

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

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

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

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

var _icon = _interopRequireDefault(require("../icon"));

var ExpandIcon = function ExpandIcon(props) {
  var _classNames;

  var prefixCls = props.prefixCls,
      expanded = props.expanded,
      expandable = props.expandable,
      onChange = props.onChange;
  var iconPrefixCls = "".concat(prefixCls, "-expand-icon");
  var classString = (0, _classnames["default"])(iconPrefixCls, (_classNames = {}, (0, _defineProperty2["default"])(_classNames, "".concat(iconPrefixCls, "-expanded"), expanded), (0, _defineProperty2["default"])(_classNames, "".concat(iconPrefixCls, "-spaced"), !expandable), _classNames));
  var handleClick = (0, _react.useCallback)(function (e) {
    e.stopPropagation();
    onChange(e);
  }, [onChange]);
  return /*#__PURE__*/_react["default"].createElement(_icon["default"], {
    type: "baseline-arrow_right",
    className: classString,
    onClick: expandable ? handleClick : undefined,
    tabIndex: expandable ? 0 : -1
  });
};

ExpandIcon.displayName = 'ExpandIcon';

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

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