"use strict";

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

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

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

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

var _noop = _interopRequireDefault(require("lodash/noop"));

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

var _button = _interopRequireDefault(require("../button"));

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

function TransferSort(props) {
  var _props$moveToUp = props.moveToUp,
      moveToUp = _props$moveToUp === void 0 ? _noop["default"] : _props$moveToUp,
      _props$moveToDown = props.moveToDown,
      moveToDown = _props$moveToDown === void 0 ? _noop["default"] : _props$moveToDown,
      _props$upArrowText = props.upArrowText,
      upArrowText = _props$upArrowText === void 0 ? '' : _props$upArrowText,
      _props$downArrowText = props.downArrowText,
      downArrowText = _props$downArrowText === void 0 ? '' : _props$downArrowText,
      upActive = props.upActive,
      downActive = props.downActive,
      className = props.className,
      multiple = props.multiple;

  if (multiple) {
    var customUpClass = (0, _classnames["default"])("".concat(className, "-custom-up-active"), (0, _defineProperty2["default"])({}, "".concat(className, "-custom-up-disable"), !upActive));
    var customDownClass = (0, _classnames["default"])("".concat(className, "-custom-down-active"), (0, _defineProperty2["default"])({}, "".concat(className, "-custom-down-disable"), !downActive));
    return /*#__PURE__*/_react["default"].createElement("div", {
      className: className
    }, typeof upArrowText === 'string' ? /*#__PURE__*/_react["default"].createElement(_button["default"], {
      color: upActive ? _enum.ButtonColor.primary : _enum.ButtonColor["default"],
      disabled: !upActive,
      onClick: moveToUp,
      icon: 'expand_less'
    }, upArrowText) : /*#__PURE__*/_react["default"].createElement("div", {
      className: customUpClass,
      onClick: upActive ? moveToUp : undefined
    }, upArrowText), typeof downArrowText === 'string' ? /*#__PURE__*/_react["default"].createElement(_button["default"], {
      color: downActive ? _enum.ButtonColor.primary : _enum.ButtonColor["default"],
      disabled: !downActive,
      onClick: moveToDown,
      icon: 'expand_more'
    }, downArrowText) : /*#__PURE__*/_react["default"].createElement("div", {
      className: customDownClass,
      onClick: downActive ? moveToDown : undefined
    }, downArrowText));
  }

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