import BaseAvatar from 'sentry/components/avatar/baseAvatar';
import {IconGeneric} from 'sentry/icons';
import {AvatarSentryApp} from 'sentry/types';
type Props = {
isColor?: boolean;
isDefault?: boolean;
sentryApp?: AvatarSentryApp;
} & BaseAvatar['props'];
const SentryAppAvatar = ({isColor = true, sentryApp, isDefault, ...props}: Props) => {
const avatarDetails = sentryApp?.avatars?.find(({color}) => color === isColor);
const defaultSentryAppAvatar = (
);
// Render the default if the prop is provided, there is no existing avatar, or it has been reverted to 'default'
if (isDefault || !avatarDetails || avatarDetails.avatarType === 'default') {
return defaultSentryAppAvatar;
}
return (
);
};
export default SentryAppAvatar;