diff --git a/assets/styles.css b/assets/styles.css index 00b8e05..95fddc4 100644 --- a/assets/styles.css +++ b/assets/styles.css @@ -31,6 +31,11 @@ color: var(--text-muted); } +.omnisearch-result__extension { + font-size: 0.7rem; + color: var(--text-muted); + } + .omnisearch-result__counter { font-size: 0.7rem; color: var(--text-muted); diff --git a/src/components/ResultItemVault.svelte b/src/components/ResultItemVault.svelte index e30c234..afa5e6e 100644 --- a/src/components/ResultItemVault.svelte +++ b/src/components/ResultItemVault.svelte @@ -2,9 +2,12 @@ import { settings, showExcerpt } from 'src/settings' import type { ResultNote } from '../globals' import { + getExtension, highlighter, + isFileCanvas, isFileImage, isFilePDF, + isFilePlaintext, makeExcerpt, pathWithoutFilename, removeDiacritics, @@ -20,8 +23,8 @@ let imagePath: string | null = null let title = '' let notePath = '' - let folderPathIcon - let filePathIcon + let elFolderPathIcon: HTMLElement + let elFilePathIcon: HTMLElement $: { imagePath = null @@ -45,13 +48,14 @@ } // Icons - if (folderPathIcon) { - setIcon(folderPathIcon, 'folder-open') + if (elFolderPathIcon) { + setIcon(elFolderPathIcon, 'folder-open') } - if (filePathIcon) { - if (isFileImage(note.path)) setIcon(filePathIcon, 'file-image') - else if (isFilePDF(note.path)) setIcon(filePathIcon, 'file-line-chart') - else setIcon(filePathIcon, 'file-text') + if (elFilePathIcon) { + if (isFileImage(note.path)) setIcon(elFilePathIcon, 'image') + else if (isFilePDF(note.path)) setIcon(elFilePathIcon, 'file-text') + else if (isFileCanvas(note.path)) setIcon(elFilePathIcon, 'layout-dashboard') + else setIcon(elFilePathIcon, 'file') } } @@ -65,8 +69,10 @@