mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-27 11:58:49 +01:00
71 lines
2 KiB
TypeScript
71 lines
2 KiB
TypeScript
export const getIconByType = (type: string, sub?: string) => {
|
|
let iconName = "";
|
|
switch (type) {
|
|
case "NodeDocument":
|
|
iconName = "iconFile";
|
|
break;
|
|
case "NodeThematicBreak":
|
|
iconName = "iconLine";
|
|
break;
|
|
case "NodeParagraph":
|
|
iconName = "iconParagraph";
|
|
break;
|
|
case "NodeHeading":
|
|
if (sub) {
|
|
iconName = "icon" + sub.toUpperCase();
|
|
} else {
|
|
iconName = "iconHeadings";
|
|
}
|
|
break;
|
|
case "NodeBlockquote":
|
|
iconName = "iconQuote";
|
|
break;
|
|
case "NodeList":
|
|
if (sub === "t") {
|
|
iconName = "iconCheck";
|
|
} else if (sub === "o") {
|
|
iconName = "iconOrderedList";
|
|
} else {
|
|
iconName = "iconList";
|
|
}
|
|
break;
|
|
case "NodeListItem":
|
|
iconName = "iconListItem";
|
|
break;
|
|
case "NodeCodeBlock":
|
|
case "NodeYamlFrontMatter":
|
|
iconName = "iconCode";
|
|
break;
|
|
case "NodeTable":
|
|
iconName = "iconTable";
|
|
break;
|
|
case "NodeBlockQueryEmbed":
|
|
iconName = "iconSQL";
|
|
break;
|
|
case "NodeSuperBlock":
|
|
iconName = "iconSuper";
|
|
break;
|
|
case "NodeMathBlock":
|
|
iconName = "iconMath";
|
|
break;
|
|
case "NodeHTMLBlock":
|
|
iconName = "iconHTML5";
|
|
break;
|
|
case "NodeWidget":
|
|
iconName = "iconBoth";
|
|
break;
|
|
case "NodeIFrame":
|
|
iconName = "iconLanguage";
|
|
break;
|
|
case "NodeVideo":
|
|
iconName = "iconVideo";
|
|
break;
|
|
case "NodeAudio":
|
|
iconName = "iconRecord";
|
|
break;
|
|
case "NodeAttributeView":
|
|
iconName = "iconDatabase";
|
|
break;
|
|
}
|
|
return iconName;
|
|
};
|