File
Blob: src/sites/icons.tsx
| 1 | import { getEmojiAssetUrl } from "@/shared/emoji"; |
| 2 | |
| 3 | interface SiteIconMarkProps { |
| 4 | icon: string; |
| 5 | imageClassName: string; |
| 6 | glyphClassName: string; |
| 7 | imageSize: number; |
| 8 | } |
| 9 | |
| 10 | export function SiteIconMark({ icon, imageClassName, glyphClassName, imageSize }: SiteIconMarkProps) { |
| 11 | const assetUrl = getEmojiAssetUrl(icon); |
| 12 | if (assetUrl) { |
| 13 | return ( |
| 14 | <img |
| 15 | className={imageClassName} |
| 16 | src={assetUrl} |
| 17 | alt="" |
| 18 | aria-hidden="true" |
| 19 | draggable={false} |
| 20 | loading="lazy" |
| 21 | decoding="async" |
| 22 | fetchPriority="low" |
| 23 | width={imageSize} |
| 24 | height={imageSize} |
| 25 | /> |
| 26 | ); |
| 27 | } |
| 28 | return <span className={glyphClassName}>{icon}</span>; |
| 29 | } |