docIntegrationAvatar.tsx 667 B

123456789101112131415161718192021222324
  1. import BaseAvatar from 'sentry/components/avatar/baseAvatar';
  2. import PluginIcon from 'sentry/plugins/components/pluginIcon';
  3. import {DocIntegration} from 'sentry/types';
  4. type Props = {
  5. docIntegration?: DocIntegration;
  6. } & BaseAvatar['props'];
  7. const DocIntegrationAvatar = ({docIntegration, ...props}: Props) => {
  8. if (!docIntegration?.avatar) {
  9. return <PluginIcon {...props} pluginId={docIntegration?.slug} />;
  10. }
  11. return (
  12. <BaseAvatar
  13. {...props}
  14. type="upload"
  15. uploadPath="doc-integration-avatar"
  16. uploadId={docIntegration.avatar.avatarUuid}
  17. title={docIntegration.name}
  18. />
  19. );
  20. };
  21. export default DocIntegrationAvatar;