cleanup
This commit is contained in:
@@ -39,6 +39,11 @@ interface DocumentLike {
|
||||
version_number?: number;
|
||||
version?: { content_type?: string | null } | null;
|
||||
} | null;
|
||||
previewEntry?: {
|
||||
url: string;
|
||||
alt?: string;
|
||||
contentType?: string | null;
|
||||
} | null;
|
||||
[key: string]: unknown;
|
||||
}
|
||||
|
||||
@@ -53,10 +58,8 @@ interface DocumentViewerPanelProps extends DocumentSummarySectionProps {
|
||||
document: DocumentLike | null;
|
||||
previewEntry?: {
|
||||
url?: string;
|
||||
canGoPrev?: boolean;
|
||||
canGoNext?: boolean;
|
||||
goPrev?: () => void;
|
||||
goNext?: () => void;
|
||||
contentType?: string | null;
|
||||
filename?: string | null;
|
||||
} | null;
|
||||
hydrateDocument?: (doc: DocumentLike | null) => DocumentLike | null;
|
||||
ensureAssetUrl?: (docId: string | number, asset: AssetLike, options?: { start?: number; limit?: number }) => Promise<unknown>;
|
||||
@@ -490,10 +493,16 @@ const DocumentViewerPanel: React.FC<DocumentViewerPanelProps> = ({
|
||||
document?.title || 'Document preview'
|
||||
);
|
||||
|
||||
const overlayDocument = useMemo(() => (
|
||||
document && zoomDisplay?.url
|
||||
? { ...document, previewEntry: zoomDisplay }
|
||||
: document
|
||||
), [document, zoomDisplay]);
|
||||
|
||||
const overlay = (
|
||||
<PreviewZoomOverlay
|
||||
open={Boolean(zoomOverlayOpen && zoomDisplay)}
|
||||
display={zoomDisplay}
|
||||
document={overlayDocument}
|
||||
onClose={handleZoomClose}
|
||||
/>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user