Add inline PDF file preview

This commit is contained in:
Bohdan Triapitsyn
2026-06-12 20:08:19 +03:00
parent 33522a0d58
commit 1a623f9b1c
3 changed files with 127 additions and 55 deletions
+5
View File
@@ -693,6 +693,11 @@ export function isImageFile(filePath: string): boolean {
return IMAGE_EXTENSIONS.includes(ext || '');
}
export function isPdfFile(filePath: string): boolean {
const ext = filePath.split('.').pop()?.toLowerCase();
return ext === 'pdf';
}
export function getImageMimeType(filePath: string): string {
const ext = filePath.split('.').pop()?.toLowerCase();
const mimeMap: Record<string, string> = {