UNPKG

@backstage/plugin-techdocs

Version:

The Backstage plugin that renders technical documentation for your components

31 lines (28 loc) 1.05 kB
import { jsx } from 'react/jsx-runtime'; import ShareIcon from '@material-ui/icons/Share'; import { FavoriteToggleIcon } from '@backstage/core-components'; const actionFactories = { createCopyDocsUrlAction(copyToClipboard) { return (row) => { return { icon: () => /* @__PURE__ */ jsx(ShareIcon, { fontSize: "small" }), tooltip: "Click to copy documentation link to clipboard", onClick: () => copyToClipboard(`${window.location.origin}${row.resolved.docsUrl}`) }; }; }, createStarEntityAction(isStarredEntity, toggleStarredEntity) { return (row) => { const entity = row.entity; const isStarred = isStarredEntity(entity); return { cellStyle: { paddingLeft: "1em" }, icon: () => /* @__PURE__ */ jsx(FavoriteToggleIcon, { isFavorite: isStarred }), tooltip: isStarred ? "Remove from favorites" : "Add to favorites", onClick: () => toggleStarredEntity(entity) }; }; } }; export { actionFactories }; //# sourceMappingURL=actions.esm.js.map