import _extends from "@babel/runtime/helpers/extends";
import _defineProperty from "@babel/runtime/helpers/defineProperty";
import React from 'react';
import noop from 'lodash/noop';
import classNames from 'classnames';
import Button from '../button';
import { Size } from '../_util/enum';

var Operation = function Operation(props) {
  var _props$moveToLeft = props.moveToLeft,
      moveToLeft = _props$moveToLeft === void 0 ? noop : _props$moveToLeft,
      _props$moveToRight = props.moveToRight,
      moveToRight = _props$moveToRight === void 0 ? noop : _props$moveToRight,
      _props$leftArrowText = props.leftArrowText,
      leftArrowText = _props$leftArrowText === void 0 ? '' : _props$leftArrowText,
      _props$rightArrowText = props.rightArrowText,
      rightArrowText = _props$rightArrowText === void 0 ? '' : _props$rightArrowText,
      leftActive = props.leftActive,
      rightActive = props.rightActive,
      className = props.className,
      style = props.style,
      buttonProps = props.buttonProps;
  var customLeftClass = classNames("".concat(className, "-custom-left-active"), _defineProperty({}, "".concat(className, "-custom-left-disable"), !leftActive));
  var customRightClass = classNames("".concat(className, "-custom-left-active"), _defineProperty({}, "".concat(className, "-custom-left-disable"), !rightActive));
  return /*#__PURE__*/React.createElement("div", {
    className: className,
    style: style
  }, typeof leftArrowText === 'string' ? /*#__PURE__*/React.createElement(Button, _extends({}, buttonProps, {
    type: "primary",
    size: Size.small,
    disabled: !leftActive,
    onClick: moveToLeft,
    icon: "keyboard_arrow_left"
  }), leftArrowText) : /*#__PURE__*/React.createElement("div", {
    className: customLeftClass,
    onClick: leftActive ? moveToLeft : undefined
  }, leftArrowText), typeof rightArrowText === 'string' ? /*#__PURE__*/React.createElement(Button, _extends({}, buttonProps, {
    type: "primary",
    size: Size.small,
    disabled: !rightActive,
    onClick: moveToRight,
    icon: "keyboard_arrow_right"
  }), rightArrowText) : /*#__PURE__*/React.createElement("div", {
    className: customRightClass,
    onClick: rightActive ? moveToRight : undefined
  }, rightArrowText));
};

Operation.displayName = 'TransferOperation';
export default Operation;
//# sourceMappingURL=operation.js.map
