"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports["default"] = filterActionColumn;
var _filterActionColumnByDevice = _interopRequireDefault(require("./filterActionColumnByDevice"));
function filterActionColumn(actionColumn, rowData, device) {
  var filterByEditable = actionColumn.filter(function (action) {
    if (action.render && typeof action.render === 'function' && !action.render(action.title, rowData)) {
      return false;
    }
    if (rowData.__mode__ === "EDIT") {
      return action.mode === "EDIT";
    } else {
      return action.mode !== "EDIT";
    }
  });
  return (0, _filterActionColumnByDevice["default"])(filterByEditable, device);
}