actorBadge.tsx 551 B

12345678910111213141516171819202122
  1. import type {Actor} from 'sentry/types/core';
  2. import BadgeDisplayName from './badgeDisplayName';
  3. import {BaseBadge, type BaseBadgeProps} from './baseBadge';
  4. export interface ActorBadgeProps extends BaseBadgeProps {
  5. actor: Actor;
  6. }
  7. function ActorBadge({actor, ...props}: ActorBadgeProps) {
  8. const title = actor.type === 'team' ? `#${actor.name}` : actor.name || actor.email;
  9. return (
  10. <BaseBadge
  11. displayName={<BadgeDisplayName>{title}</BadgeDisplayName>}
  12. actor={actor}
  13. {...props}
  14. />
  15. );
  16. }
  17. export default ActorBadge;