(props: ImageProps)
| 79 | }; |
| 80 | |
| 81 | const Image = (props: ImageProps) => { |
| 82 | const { userType, name, permalink, image, className } = props; |
| 83 | |
| 84 | if (userType === UserType.Source) { |
| 85 | return ( |
| 86 | <LinkWithTooltip |
| 87 | href={permalink} |
| 88 | passHref |
| 89 | prefetch={false} |
| 90 | tooltip={{ |
| 91 | placement: 'bottom', |
| 92 | content: name, |
| 93 | }} |
| 94 | > |
| 95 | <StyledImage |
| 96 | className={classNames('cursor-pointer rounded-full', className)} |
| 97 | imgSrc={image} |
| 98 | fallbackSrc={fallbackImages.avatar} |
| 99 | imgAlt={name} |
| 100 | background="var(--theme-background-subtle)" |
| 101 | /> |
| 102 | </LinkWithTooltip> |
| 103 | ); |
| 104 | } |
| 105 | |
| 106 | const user = props as CommentAuthor; |
| 107 | |
| 108 | return ( |
| 109 | <ProfileLink href={user.permalink} data-testid="authorLink"> |
| 110 | <StyledImage |
| 111 | className="rounded-12" |
| 112 | imgSrc={image} |
| 113 | fallbackSrc={fallbackImages.avatar} |
| 114 | imgAlt={name} |
| 115 | background="var(--theme-background-subtle)" |
| 116 | /> |
| 117 | </ProfileLink> |
| 118 | ); |
| 119 | }; |
| 120 | |
| 121 | const userTypes = [UserType.Author, UserType.Scout]; |
| 122 |
nothing calls this directly
no outgoing calls
no test coverage detected