docusaurus-plugin-typedoc-api
Version:
Docusaurus plugin that provides source code API documentation powered by TypeDoc.
33 lines (31 loc) • 881 B
JavaScript
;
const jsxRuntime = require('react/jsx-runtime');
function getModifierClassName(tag) {
switch (tag) {
case '@beta':
case '@experimental':
return 'warning';
case '@alpha':
return 'danger';
default:
return 'info';
}
}
function isCommentWithModifiers(comment) {
return !!comment && !!comment.modifierTags && comment.modifierTags.length > 0;
}
function CommentBadges({
comment
}) {
const modifierTags = comment.modifierTags;
return /*#__PURE__*/jsxRuntime.jsx("div", {
className: "badge-group",
children: modifierTags.map(tag => /*#__PURE__*/jsxRuntime.jsx("span", {
className: `badge badge--${getModifierClassName(tag)}`,
children: tag.slice(1)
}, tag))
});
}
exports.CommentBadges = CommentBadges;
exports.isCommentWithModifiers = isCommentWithModifiers;
//# sourceMappingURL=CommentBadges.js.map