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 { ButtonColor } from '../button/enum';
export default function TransferOperation(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,
      multiple = props.multiple,
      oneWay = props.oneWay;
  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));

  if (multiple) {
    var leftArrowBtn;
    var rightArrowBtn;

    if (typeof leftArrowText === 'string') {
      leftArrowBtn = /*#__PURE__*/React.createElement(Button, {
        color: leftActive ? ButtonColor.primary : ButtonColor["default"],
        disabled: !leftActive,
        onClick: moveToLeft,
        icon: 'navigate_before'
      }, leftArrowText);
    } else {
      leftArrowBtn = /*#__PURE__*/React.createElement("div", {
        className: customLeftClass,
        onClick: leftActive ? moveToLeft : undefined
      }, leftArrowText);
    }

    if (typeof rightArrowText === 'string') {
      rightArrowBtn = /*#__PURE__*/React.createElement(Button, {
        color: rightActive ? ButtonColor.primary : ButtonColor["default"],
        disabled: !rightActive,
        onClick: moveToRight,
        icon: 'navigate_next'
      }, rightArrowText);
    } else {
      rightArrowBtn = /*#__PURE__*/React.createElement("div", {
        className: customRightClass,
        onClick: rightActive ? moveToRight : undefined
      }, rightArrowText);
    }

    return /*#__PURE__*/React.createElement("div", {
      className: className
    }, oneWay ? null : leftArrowBtn, rightArrowBtn);
  }

  return null;
}
//# sourceMappingURL=TransferOperation.js.map
