"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports["default"] = hasRowAction;
var _filterActionColumnByDevice = _interopRequireDefault(require("./filterActionColumnByDevice"));
function hasRowAction(props, withoutEdit) {
  var actionHidden = props.actionHidden,
    actionColumn = props.actionColumn,
    device = props.device;
  if (actionHidden) {
    return false;
  }
  if (actionColumn && actionColumn.length) {
    var actionColumnFilter = (0, _filterActionColumnByDevice["default"])(actionColumn, device);
    if (withoutEdit) {
      actionColumnFilter = actionColumnFilter.filter(function (action) {
        return action.mode !== "EDIT";
      });
    }
    return !!(actionColumnFilter && actionColumnFilter.length);
  } else {
    return false;
  }
}