Re-worked icons
All checks were successful
Docker Deploy / build-and-push (push) Successful in 3m48s

This commit is contained in:
2026-02-12 14:22:59 -07:00
parent 33dfea1802
commit 89c1c739c1
23 changed files with 10138 additions and 925 deletions

View File

@@ -1,35 +0,0 @@
import { mdiEmail, mdiPhone, mdiDownload, mdiLink } from "@mdi/js";
import * as simpleIcons from "simple-icons";
export function getSimpleIconPath(network: string): string {
try {
const slug = network.toLowerCase().normalize("NFKD").replace(/[^\w]/g, "");
const iconKey = `si${slug.charAt(0).toUpperCase()}${slug.slice(1)}`;
const icon = (simpleIcons as any)[iconKey];
return icon ? icon.path : "";
} catch (error) {
console.warn(`Error finding icon for network: ${network}`, error);
return "";
}
}
export function getMdiIconPath(iconName: string): string {
const iconMap: { [key: string]: string } = {
"mdi:email": mdiEmail,
"mdi:phone": mdiPhone,
"mdi:download": mdiDownload,
"mdi:link": mdiLink,
};
return iconMap[iconName] || "";
}
export const fetchProfileIcons = (profiles: any[]) => {
const profileIcons: { [key: string]: string } = {};
if (profiles) {
for (const profile of profiles) {
profileIcons[profile.network] = getSimpleIconPath(profile.network);
}
}
return profileIcons;
};