|
|
@ -1,9 +1,9 @@
|
|
|
|
import Image from "next/future/image";
|
|
|
|
import Image from "next/future/image";
|
|
|
|
|
|
|
|
|
|
|
|
export default function ResolvedIcon({ icon, width = 32, height = 32 }) {
|
|
|
|
export default function ResolvedIcon({ icon, width = 32, height = 32, alt = "logo" }) {
|
|
|
|
// direct or relative URLs
|
|
|
|
// direct or relative URLs
|
|
|
|
if (icon.startsWith("http") || icon.startsWith("/")) {
|
|
|
|
if (icon.startsWith("http") || icon.startsWith("/")) {
|
|
|
|
return <Image src={`${icon}`} width={width} height={height} alt="logo" />;
|
|
|
|
return <Image src={`${icon}`} width={width} height={height} alt={alt} />;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// mdi- prefixed, material design icons
|
|
|
|
// mdi- prefixed, material design icons
|
|
|
@ -31,7 +31,7 @@ export default function ResolvedIcon({ icon, width = 32, height = 32 }) {
|
|
|
|
src={`https://cdn.jsdelivr.net/gh/walkxcode/dashboard-icons/png/${iconName}.png`}
|
|
|
|
src={`https://cdn.jsdelivr.net/gh/walkxcode/dashboard-icons/png/${iconName}.png`}
|
|
|
|
width={width}
|
|
|
|
width={width}
|
|
|
|
height={height}
|
|
|
|
height={height}
|
|
|
|
alt="logo"
|
|
|
|
alt={alt}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|