@monolith-forensics/monolith-ui 1.2.56 → 1.2.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -159,6 +159,8 @@ export const FileViewer = ({ file, open, isPending, onClose }) => {
|
|
|
159
159
|
const [zoomFactor, setZoomFactor] = useState(1);
|
|
160
160
|
if (!open)
|
|
161
161
|
return null;
|
|
162
|
+
if (!file)
|
|
163
|
+
return null;
|
|
162
164
|
const viewerType = resolveViewerType(file);
|
|
163
165
|
const handleBackgroundClick = (e) => {
|
|
164
166
|
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
@@ -43,9 +43,9 @@ export const PdfViewer = ({ file, zoomFactor = 1, isPending }) => {
|
|
|
43
43
|
// viewport width
|
|
44
44
|
const vw = Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0) / 1.15;
|
|
45
45
|
if (isPending) {
|
|
46
|
-
return (_jsxs(StyledLoader, { children: [_jsx(Loader, { size: 50 }), _jsx("div", { children: "Loading
|
|
46
|
+
return (_jsxs(StyledLoader, { children: [_jsx(Loader, { size: 50 }), _jsx("div", { children: "Loading File..." })] }));
|
|
47
47
|
}
|
|
48
|
-
return (_jsxs(StyledContainer, { className: "PdfViewer", children: [loading && (_jsxs(StyledLoader, { children: [_jsx(Loader, { size: 50 }), _jsx("div", { children: "Loading
|
|
48
|
+
return (_jsxs(StyledContainer, { className: "PdfViewer", children: [loading && (_jsxs(StyledLoader, { children: [_jsx(Loader, { size: 50 }), _jsx("div", { children: "Loading File..." })] })), _jsx(StyledDocument, { file: file.url, onLoadStart: () => setLoading(true), onLoadSuccess: onDocumentLoadSuccess, loading: _jsx(_Fragment, {}), onClick: (e) => {
|
|
49
49
|
e.stopPropagation();
|
|
50
50
|
}, children: Array.from(new Array(numPages), (el, index) => (_jsx(StyledPage, { pageNumber: index + 1, scale: zoomFactor, width: vw }, `page_${index + 1}`))) })] }));
|
|
51
51
|
};
|