"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 _react = _interopRequireWildcard(require("react"));

var _isString = _interopRequireDefault(require("lodash/isString"));

var _isFunction = _interopRequireDefault(require("lodash/isFunction"));

var _Button = _interopRequireDefault(require("../button/Button"));

var _enum = require("../button/enum");

var _EventManager = require("../_util/EventManager");

var Toolbar = function Toolbar(props) {
  var prefixCls = props.prefixCls,
      downloadUrl = props.downloadUrl,
      zoomInDisabled = props.zoomInDisabled,
      zoomOutDisabled = props.zoomOutDisabled,
      onZoomIn = props.onZoomIn,
      onZoomOut = props.onZoomOut,
      onRotateLeft = props.onRotateLeft,
      onRotateRight = props.onRotateRight;
  return /*#__PURE__*/_react["default"].createElement("div", {
    className: "".concat(prefixCls, "-toolbar")
  }, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
    icon: "zoom_in",
    funcType: _enum.FuncType.link,
    className: "".concat(prefixCls, "-btn ").concat(prefixCls, "-btn-tool"),
    onClick: onZoomIn,
    onMouseDown: _EventManager.stopPropagation,
    disabled: zoomInDisabled
  }), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
    icon: "zoom_out",
    funcType: _enum.FuncType.link,
    className: "".concat(prefixCls, "-btn ").concat(prefixCls, "-btn-tool"),
    onClick: onZoomOut,
    onMouseDown: _EventManager.stopPropagation,
    disabled: zoomOutDisabled
  }), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
    icon: "replay_90",
    funcType: _enum.FuncType.link,
    className: "".concat(prefixCls, "-btn ").concat(prefixCls, "-btn-tool"),
    onClick: onRotateLeft,
    onMouseDown: _EventManager.stopPropagation
  }), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
    icon: "play_90",
    funcType: _enum.FuncType.link,
    className: "".concat(prefixCls, "-btn ").concat(prefixCls, "-btn-tool"),
    onClick: onRotateRight,
    onMouseDown: _EventManager.stopPropagation
  }), downloadUrl && /*#__PURE__*/_react["default"].createElement(_Button["default"], {
    icon: "get_app",
    funcType: _enum.FuncType.link,
    className: "".concat(prefixCls, "-btn ").concat(prefixCls, "-btn-tool"),
    href: (0, _isString["default"])(downloadUrl) ? downloadUrl : undefined,
    onClick: (0, _isFunction["default"])(downloadUrl) ? downloadUrl : undefined,
    target: "_blank"
  }));
};

Toolbar.displayName = 'Toolbar';

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

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