"use strict";

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

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

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("../_util/enum");

var SortButton = function SortButton(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;
  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"], {
    type: "primary",
    size: _enum.Size.small,
    disabled: !upActive,
    onClick: moveToUp,
    icon: "keyboard_arrow_up"
  }, upArrowText) : /*#__PURE__*/_react["default"].createElement("div", {
    className: customUpClass,
    onClick: upActive ? moveToUp : undefined
  }, upArrowText), typeof downArrowText === 'string' ? /*#__PURE__*/_react["default"].createElement(_button["default"], {
    type: "primary",
    size: _enum.Size.small,
    disabled: !downActive,
    onClick: moveToDown,
    icon: "keyboard_arrow_down"
  }, downArrowText) : /*#__PURE__*/_react["default"].createElement("div", {
    className: customDownClass,
    onClick: downActive ? moveToDown : undefined
  }, downArrowText));
};

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