import { JSONOutput } from 'typedoc'; function getModifierClassName(tag: string) { switch (tag) { case '@beta': case '@experimental': return 'warning'; case '@alpha': return 'danger'; default: return 'info'; } } export type CommentWithModifiers = Pick & Required>; export function isCommentWithModifiers( comment?: JSONOutput.Comment, ): comment is CommentWithModifiers { return !!comment && !!comment.modifierTags && comment.modifierTags.length > 0; } interface CommentBadgesProps { comment: CommentWithModifiers; } export function CommentBadges({ comment }: CommentBadgesProps) { const { modifierTags } = comment; return (
{modifierTags.map((tag) => ( {tag.slice(1)} ))}
); }