projectAvatar.tsx 919 B

1234567891011121314151617181920212223242526
  1. import BaseAvatar from 'sentry/components/avatar/baseAvatar';
  2. import PlatformList from 'sentry/components/platformList';
  3. import {Tooltip} from 'sentry/components/tooltip';
  4. import {AvatarProject} from 'sentry/types';
  5. type Props = {
  6. project: AvatarProject;
  7. direction?: 'left' | 'right';
  8. } & BaseAvatar['props'];
  9. function ProjectAvatar({project, hasTooltip, tooltip, ...props}: Props) {
  10. return (
  11. <Tooltip disabled={!hasTooltip} title={tooltip}>
  12. <PlatformList
  13. // `platform` is a user selectable option that is performed during the onboarding process. The reason why this
  14. // is not the default is because there currently is no way to update it. Fallback to this if project does not
  15. // have recent events with a platform.
  16. platforms={project?.platform ? [project.platform] : []}
  17. {...props}
  18. max={1}
  19. />
  20. </Tooltip>
  21. );
  22. }
  23. export default ProjectAvatar;