UNPKG

@netdata/netdata-ui

Version:

netdata UI kit

59 lines (58 loc) 1.74 kB
"use strict"; exports.__esModule = true; exports.supportedBulkActions = exports["default"] = void 0; var _react = require("react"); function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } var supportedBulkActions = exports.supportedBulkActions = { "delete": { icon: "trashcan", confirmation: true, tooltipText: "Delete", confirmationTitle: "Delete Row", confirmationMessage: "You are about to delete a row, are you sure you want to continue?", confirmLabel: "Yes", declineLabel: "No", actionButtonDirection: "reverse" }, download: { icon: "download", confirmation: false, tooltipText: "Download" }, toggleAlarm: { icon: "alarm_off", confirmation: false, tooltipText: "Turn of Alarms" }, userSettings: { icon: "user", confirmation: false, tooltipText: "User Settings" }, addEntry: { icon: "plus", alwaysEnabled: true, flavour: "default", iconColor: "white" }, remove: { icon: "removeNode", confirmation: true, confirmLabel: "Yes", declineLabel: "No" }, columnVisibility: { icon: "gear", alwaysEnabled: true } }; var _default = exports["default"] = function _default(actions) { return (0, _react.useMemo)(function () { if (!actions) return []; return Object.keys(actions).map(function (actionKey) { return _extends({}, supportedBulkActions[actionKey] || supportedBulkActions["delete"], actions[actionKey], { id: actionKey }); }); }, [actions]); };