fix: double declaration of iconName

This commit is contained in:
Bjorn Lammers 2025-01-05 22:30:42 +01:00 committed by GitHub
parent 3be4e63d71
commit d2fa72c13e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -116,23 +116,7 @@ export default function ResolvedIcon({ icon, width = 32, height = 32, alt = "log
);
}
const iconName = icon.replace(".png", "");
return (
<Image
src={`https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/${iconName}.png`}
width={width}
height={height}
style={{
width,
height,
objectFit: "contain",
maxHeight: "100%",
maxWidth: "100%",
}}
alt={alt}
/>
);
if (icon.endsWith(".webp")) {
const iconName = icon.replace(".webp", "");
return (
<Image
@ -149,4 +133,22 @@ export default function ResolvedIcon({ icon, width = 32, height = 32, alt = "log
alt={alt}
/>
);
}
const iconName = icon.replace(".png", "");
return (
<Image
src={`https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/${iconName}.png`}
width={width}
height={height}
style={{
width,
height,
objectFit: "contain",
maxHeight: "100%",
maxWidth: "100%",
}}
alt={alt}
/>
);
}