-
+ const loadingSection = (
+
+ );
+
+ const viewerSection = document ? (
+
+
+
+ ) : loadingSection;
const headerTitle = breadcrumbTrailEntries.length ? (
) : (
document?.title || 'Document preview'
);
+ const overlay = (
+
+ );
+
+ if (isSidebarVariant) {
+ return (
+ <>
+
+ {overlay}
+ >
+ );
+ }
+
return (
<>
@@ -393,24 +482,9 @@ const DocumentViewerPanel = ({
titleTag="h3"
actions={headerActions}
/>
-
-
-
+ {viewerSection}
-
+ {overlay}
>
);
};
@@ -442,10 +516,6 @@ export const createDocumentViewerSurface = ({
return null;
}
- const hasOcr = typeof getDocumentAsset === 'function'
- ? Boolean(getDocumentAsset(document, 'ocr-text'))
- : false;
-
const sidebarToggle = typeof renderSidebarToggle === 'function'
? renderSidebarToggle()
: null;
@@ -468,7 +538,6 @@ export const createDocumentViewerSurface = ({
onCorrespondentRemove={onCorrespondentRemove}
onUpdateTitle={onUpdateTitle}
onUpdateIssued={onUpdateIssued}
- hasOcr={hasOcr}
ensureAssetUrl={ensureAssetUrl}
getDocumentAsset={getDocumentAsset}
ensurePreviewData={ensurePreviewData}
diff --git a/frontend/src/styles/documents/viewer.css b/frontend/src/styles/documents/viewer.css
index 5cfccab..8623424 100644
--- a/frontend/src/styles/documents/viewer.css
+++ b/frontend/src/styles/documents/viewer.css
@@ -347,8 +347,8 @@
display: flex;
position: relative;
overflow: hidden;
- align-items: stretch;
- justify-content: center;
+ align-items: flex-start;
+ justify-content: flex-start;
max-height: 100%;
grid-area: viewport;
}