MCPcopy Create free account
hub / github.com/WardAnalytics/WardGraph / EntityLogo

Function EntityLogo

src/components/common/EntityLogo.tsx:12–37  ·  view source on GitHub ↗
({ entity, className })

Source from the content-addressed store, hash-verified

10}
11
12const EntityLogo: FC<EntityLogoProps> = ({ entity, className }) => {
13 const logoURL = getEntityLogoURL(entity);
14 const [imageError, setImageError] = useState<boolean>(false);
15
16 const handleImageError = () => {
17 setImageError(true);
18 };
19
20 const handleImageLoad = () => {
21 setImageError(false);
22 };
23
24 return (
25 <>
26 {imageError ? null : (
27 <img
28 src={logoURL}
29 alt={entity}
30 className={className}
31 onError={handleImageError}
32 onLoad={handleImageLoad}
33 />
34 )}
35 </>
36 );
37};
38
39export default EntityLogo;

Callers

nothing calls this directly

Calls 1

getEntityLogoURLFunction · 0.85

Tested by

no test coverage detected