This commit is contained in:
2025-11-22 14:43:05 +01:00
parent 5498cf4342
commit 530218a4b8
9 changed files with 38 additions and 40 deletions
+3 -3
View File
@@ -6,7 +6,7 @@ import PdfViewer from '../preview/PdfViewer';
type DocumentLike = {
id?: string | number;
title?: string;
content_type?: string | null;
mime_type?: string | null;
[key: string]: unknown;
};
@@ -23,13 +23,13 @@ type DisplayKind = 'image' | 'pdf';
type DocumentLink = {
url: string;
alt?: string;
contentType?: string | null;
mimeType?: string | null;
};
type DocumentLikeWithPreview = DocumentLike & { documentLink?: DocumentLink };
const determineDisplayKind = (entry?: DocumentLink | null): DisplayKind => {
const type = entry?.contentType?.toLowerCase?.() || '';
const type = entry?.mimeType?.toLowerCase?.() || '';
if (type.includes('pdf')) {
return 'pdf';
}