projectAvatar.tsx 853 B

1234567891011121314151617181920212223
  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. } & BaseAvatar['props'];
  8. const ProjectAvatar = ({project, hasTooltip, tooltip, ...props}: Props) => (
  9. <Tooltip disabled={!hasTooltip} title={tooltip}>
  10. <PlatformList
  11. // `platform` is a user selectable option that is performed during the onboarding process. The reason why this
  12. // is not the default is because there currently is no way to update it. Fallback to this if project does not
  13. // have recent events with a platform.
  14. platforms={project?.platform ? [project.platform] : []}
  15. {...props}
  16. max={1}
  17. />
  18. </Tooltip>
  19. );
  20. export default ProjectAvatar;