Fix formatting

Pass prettier tests
This commit is contained in:
n00o 2023-11-16 18:55:43 -05:00
parent b68e622695
commit 52baa69b70
3 changed files with 11 additions and 14 deletions

View File

@ -2,8 +2,8 @@ import CodeEditor from 'components/CodeEditor/index';
import { get } from 'lodash';
import { useDispatch, useSelector } from 'react-redux';
import { sendRequest } from 'providers/ReduxStore/slices/collections/actions';
import { Document, Page } from "react-pdf";
import { useState } from "react";
import { Document, Page } from 'react-pdf';
import { useState } from 'react';
import 'pdfjs-dist/build/pdf.worker';
import 'react-pdf/dist/esm/Page/AnnotationLayer.css';
import 'react-pdf/dist/esm/Page/TextLayer.css';
@ -55,16 +55,13 @@ const QueryResultPreview = ({
return <img src={`data:${contentType.replace(/\;(.*)/, '')};base64,${dataBuffer}`} className="mx-auto" />;
}
case 'preview-pdf': {
return(
<div className="preview-pdf" style={{height: "100%", overflow: "auto", maxHeight:"calc(100vh - 220px)"}}>
<Document
file ={`data:application/pdf;base64,${dataBuffer}`}
onLoadSuccess={onDocumentLoadSuccess}
>
{Array.from(new Array(numPages), (el, index) => (
<Page key={`page_${index + 1}`} pageNumber={index + 1} renderAnnotationLayer={false}/>
))}
</Document>
return (
<div className="preview-pdf" style={{ height: '100%', overflow: 'auto', maxHeight: 'calc(100vh - 220px)' }}>
<Document file={`data:application/pdf;base64,${dataBuffer}`} onLoadSuccess={onDocumentLoadSuccess}>
{Array.from(new Array(numPages), (el, index) => (
<Page key={`page_${index + 1}`} pageNumber={index + 1} renderAnnotationLayer={false} />
))}
</Document>
</div>
);
}

View File

@ -20,7 +20,7 @@ const StyledWrapper = styled.div`
.react-pdf__Page {
margin-top: 10px;
background-color:transparent !important;
background-color: transparent !important;
}
.react-pdf__Page__textContent {
border: 1px solid darkgrey;

View File

@ -49,7 +49,7 @@ const QueryResult = ({ item, collection, data, dataBuffer, width, disableRunEven
allowedPreviewModes.unshift('preview-web');
} else if (mode.includes('image')) {
allowedPreviewModes.unshift('preview-image');
} else if (contentType.includes("pdf")) {
} else if (contentType.includes('pdf')) {
allowedPreviewModes.unshift('preview-pdf');
}