mimetype
This commit is contained in:
@@ -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';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user