mirror of
https://github.com/zadam/trilium.git
synced 2026-01-17 20:14:25 +01:00
feat(notes): add default icon for PDFs
This commit is contained in:
parent
d42679315e
commit
df62dc87b2
@ -24,6 +24,10 @@ export const NOTE_TYPE_ICONS = {
|
||||
aiChat: "bx bx-bot"
|
||||
};
|
||||
|
||||
const FILE_MIME_MAPPINGS = {
|
||||
"application/pdf": "bx bxs-file-pdf",
|
||||
};
|
||||
|
||||
export function getNoteIcon({ noteId, type, mime, iconClass, workspaceIconClass, isFolder }: {
|
||||
noteId: string;
|
||||
type: NoteType;
|
||||
@ -49,6 +53,8 @@ export function getNoteIcon({ noteId, type, mime, iconClass, workspaceIconClass,
|
||||
} else if (type === "code") {
|
||||
const correspondingMimeType = MIME_TYPES_DICT.find(m => m.mime === mime);
|
||||
return correspondingMimeType?.icon ?? NOTE_TYPE_ICONS.code;
|
||||
} else if (type === "file") {
|
||||
return FILE_MIME_MAPPINGS[mime] ?? NOTE_TYPE_ICONS.file;
|
||||
}
|
||||
return NOTE_TYPE_ICONS[type];
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user