fix(icons): wrong icons in links

This commit is contained in:
Pihkaal
2024-09-10 18:33:05 +02:00
parent 477f6b6c66
commit e332f87384
2 changed files with 4 additions and 2 deletions

View File

@@ -7,6 +7,8 @@ export const getIcon = (file: Child | string | undefined): Icon => {
if (!file) return DEFAULT_ICON; if (!file) return DEFAULT_ICON;
if (typeof file === "string") { if (typeof file === "string") {
if (ICONS[file]) return ICONS[file];
const parts = file.split("."); const parts = file.split(".");
const iconName = parts[parts.length - 1]; const iconName = parts[parts.length - 1];

View File

@@ -55,11 +55,11 @@ export const folder = (name: string, children: Array<Child>): Folder => ({
children, children,
}); });
export const link = (name: string, url: string, icon: Icon): Link => ({ export const link = (name: string, url: string, icon: string): Link => ({
type: "link", type: "link",
name, name,
url, url,
icon, icon: getIcon(icon),
}); });
export const file = ( export const file = (