Function
Icon
({ icon, size = "1em", color = "currentColor", className = "", style = {}, ...props }: IconProps)
Source from the content-addressed store, hash-verified
| 18 | } |
| 19 | |
| 20 | export default function Icon({ icon, size = "1em", color = "currentColor", className = "", style = {}, ...props }: IconProps) { |
| 21 | // Handle URL SVG |
| 22 | if (icon.startsWith("url:")) { |
| 23 | const url = icon.replace("url:", ""); |
| 24 | return ( |
| 25 | <img |
| 26 | src={url} |
| 27 | alt="icon" |
| 28 | className={cn("inline-block", className)} |
| 29 | style={{ |
| 30 | width: size, |
| 31 | height: size, |
| 32 | color, |
| 33 | ...style, |
| 34 | }} |
| 35 | /> |
| 36 | ); |
| 37 | } |
| 38 | |
| 39 | // Handle local and third-party icon libraries |
| 40 | return ( |
| 41 | <IconifyIcon |
| 42 | icon={icon} |
| 43 | width={size} |
| 44 | height={size} |
| 45 | className={cn("inline-block", className)} |
| 46 | style={{ |
| 47 | color, |
| 48 | height: size, |
| 49 | width: size, |
| 50 | ...style, |
| 51 | }} |
| 52 | {...props} |
| 53 | /> |
| 54 | ); |
| 55 | } |
Callers
nothing calls this directly
Tested by
no test coverage detected