UNPKG

@grafana/ui

Version:
22 lines (17 loc) 1.09 kB
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var jsxRuntime = require('react/jsx-runtime'); var table = require('../../../utils/table.cjs'); "use strict"; const DataLinksCell = (props) => { const { field, row, cellProps, tableStyles } = props; const links = table.getCellLinks(field, row); return /* @__PURE__ */ jsxRuntime.jsx("div", { ...cellProps, className: tableStyles.cellContainerText, children: links == null ? void 0 : links.map((link, idx) => { return !link.href && link.onClick == null ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: tableStyles.cellLinkEmpty, children: link.title }, idx) : ( // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions /* @__PURE__ */ jsxRuntime.jsx("span", { className: tableStyles.cellLink, onClick: link.onClick, children: /* @__PURE__ */ jsxRuntime.jsx("a", { href: link.href, target: link.target, children: link.title }) }, idx) ); }) }); }; exports.DataLinksCell = DataLinksCell; //# sourceMappingURL=DataLinksCell.cjs.map