import React, { memo } from 'react';
import isString from 'lodash/isString';
import isFunction from 'lodash/isFunction';
import Button from '../button/Button';
import { FuncType } from '../button/enum';
import { stopPropagation } from '../_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.createElement("div", {
    className: "".concat(prefixCls, "-toolbar")
  }, /*#__PURE__*/React.createElement(Button, {
    icon: "zoom_in",
    funcType: FuncType.link,
    className: "".concat(prefixCls, "-btn ").concat(prefixCls, "-btn-tool"),
    onClick: onZoomIn,
    onMouseDown: stopPropagation,
    disabled: zoomInDisabled
  }), /*#__PURE__*/React.createElement(Button, {
    icon: "zoom_out",
    funcType: FuncType.link,
    className: "".concat(prefixCls, "-btn ").concat(prefixCls, "-btn-tool"),
    onClick: onZoomOut,
    onMouseDown: stopPropagation,
    disabled: zoomOutDisabled
  }), /*#__PURE__*/React.createElement(Button, {
    icon: "replay_90",
    funcType: FuncType.link,
    className: "".concat(prefixCls, "-btn ").concat(prefixCls, "-btn-tool"),
    onClick: onRotateLeft,
    onMouseDown: stopPropagation
  }), /*#__PURE__*/React.createElement(Button, {
    icon: "play_90",
    funcType: FuncType.link,
    className: "".concat(prefixCls, "-btn ").concat(prefixCls, "-btn-tool"),
    onClick: onRotateRight,
    onMouseDown: stopPropagation
  }), downloadUrl && /*#__PURE__*/React.createElement(Button, {
    icon: "get_app",
    funcType: FuncType.link,
    className: "".concat(prefixCls, "-btn ").concat(prefixCls, "-btn-tool"),
    href: isString(downloadUrl) ? downloadUrl : undefined,
    onClick: isFunction(downloadUrl) ? downloadUrl : undefined,
    target: "_blank"
  }));
};

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