apiclient

This commit is contained in:
2025-11-22 04:22:18 +01:00
parent 41005390e8
commit 5498cf4342
13 changed files with 224 additions and 46 deletions
+3 -5
View File
@@ -268,7 +268,7 @@ const DocumentViewerPanel: React.FC<DocumentViewerPanelProps> = ({
if (!href) {
return null;
}
const contentType = document.current_version?.version?.content_type || document.content_type || null;
const contentType = document.content_type || null;
const filename = document.current_version?.filename || document.filename || document.title || null;
return {
url: href,
@@ -363,15 +363,13 @@ const DocumentViewerPanel: React.FC<DocumentViewerPanelProps> = ({
if (!resolvedDocumentLink?.url || !document) {
return null;
}
const docContentType = document.content_type;
const versionContentType = document.current_version?.version?.content_type;
const normalizedContentType = resolvedDocumentLink.contentType || docContentType || versionContentType || null;
const normalizedContentType = document.content_type || null;
return {
url: resolvedDocumentLink.url,
alt: document.title,
contentType: normalizedContentType || undefined,
};
}, [resolvedDocumentLink?.url, resolvedDocumentLink?.contentType, document]);
}, [document, resolvedDocumentLink?.url]);
const headerActions = createDocumentViewerHeaderActions({
document,