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