@grafana/ui
Version:
Grafana Components Library
27 lines (20 loc) • 955 B
JavaScript
;
Object.defineProperty(exports, '__esModule', { value: true });
var jsxRuntime = require('react/jsx-runtime');
var css = require('@emotion/css');
var memoize = require('micro-memoize');
var ActionButton = require('../../../Actions/ActionButton.cjs');
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
var memoize__default = /*#__PURE__*/_interopDefaultCompat(memoize);
;
const ActionsCell = ({ field, rowIdx, getActions }) => {
const actions = getActions(field, rowIdx);
if (actions.length === 0) {
return null;
}
return actions.map((action, i) => /* @__PURE__ */ jsxRuntime.jsx(ActionButton.ActionButton, { action, variant: "secondary" }, i));
};
const getStyles = memoize__default.default((theme) => css.css({ gap: theme.spacing(0.75) }));
exports.ActionsCell = ActionsCell;
exports.getStyles = getStyles;
//# sourceMappingURL=ActionsCell.cjs.map