import filterActionColumnByDevice from "./filterActionColumnByDevice";
export default 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 filterActionColumnByDevice(filterByEditable, device);
}