mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-09 14:58:47 +00:00
use abbr as icon fallback
This commit is contained in:
parent
16c419f816
commit
93dda99aaa
2 changed files with 5 additions and 5 deletions
|
@ -1,9 +1,9 @@
|
|||
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
|
||||
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
|
||||
|
@ -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`}
|
||||
width={width}
|
||||
height={height}
|
||||
alt="logo"
|
||||
alt={alt}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue