This commit is contained in:
2025-11-01 04:29:08 +01:00
parent 6eb3f8a3d9
commit 816910ca40
4 changed files with 26 additions and 5 deletions
+17 -3
View File
@@ -16,6 +16,7 @@ const formatDateTime = (value) => {
const PreviewWorkspace = ({
document,
documentId,
previewEntry,
tagLookupById,
tagOptions,
@@ -73,7 +74,18 @@ const PreviewWorkspace = ({
}, [document]);
if (!document) {
return null;
return (
<section className="preview-workspace preview-workspace--loading">
<div className="preview-workspace__details">
<div className="preview-workspace__message">
Loading document{documentId ? ` ${documentId}` : ''}
</div>
</div>
<div className="preview-workspace__viewer">
<div className="preview-workspace__message">Preparing preview</div>
</div>
</section>
);
}
return (
@@ -193,6 +205,7 @@ export const createPreviewWorkspaceHeaderActions = ({
};
export const createPreviewSurface = ({
documentId,
document,
previewEntry,
ensureAssetUrl,
@@ -215,11 +228,11 @@ export const createPreviewSurface = ({
resolveFolderPath,
onFolderNavigate,
}) => {
if (!document) {
if (!documentId && !document) {
return null;
}
const title = document.title;
const title = document?.title || 'Document preview';
const closeButton = onClose
? (
<button
@@ -264,6 +277,7 @@ export const createPreviewSurface = ({
content: (
<PreviewWorkspace
document={document}
documentId={documentId}
previewEntry={previewEntry}
tagLookupById={tagLookupById}
tagOptions={tagOptions}