[yagin]add condition render for viewer component

This commit is contained in:
yagin 2024-12-04 10:57:02 +07:00
parent 8b3cde536b
commit a6f6eb5a34

View File

@ -416,18 +416,18 @@ const ReviewPage = () => {
style={
fullscreen
? {
position: 'fixed',
top: 0,
left: 0,
width: '100%',
height: '100%',
backgroundColor: '#fff',
zIndex: 1000,
}
position: 'fixed',
top: 0,
left: 0,
width: '100%',
height: '100%',
backgroundColor: '#fff',
zIndex: 1000,
}
: {
height: '100%',
position: 'relative',
}
height: '100%',
position: 'relative',
}
}
>
<div
@ -578,11 +578,11 @@ const ReviewPage = () => {
overflow: 'auto',
}}
>
<Viewer
{selectedFileData && <Viewer
plugins={[defaultLayoutPluginInstance]}
fileUrl={selectedFileData}
onDocumentLoad={() => setImageLoading(false)}
/>
/>}
</div>
) : (
<div
@ -756,11 +756,10 @@ const ReviewPage = () => {
>
<Input
size='middle'
value={`Sub: ${filterSubsidiaries}, Date:${
filterDateRange[0]
? filterDateRange[0] + ' to ' + filterDateRange[1]
: 'All'
}, Reviewed: ${filterReviewState}, Tests: ${filterIncludeTests}`}
value={`Sub: ${filterSubsidiaries}, Date:${filterDateRange[0]
? filterDateRange[0] + ' to ' + filterDateRange[1]
: 'All'
}, Reviewed: ${filterReviewState}, Tests: ${filterIncludeTests}`}
readOnly
/>
<Button
@ -781,12 +780,12 @@ const ReviewPage = () => {
let shouldRevised = false;
try {
if (
selectedFileDataSource[data]?.[FEEDBACK_ACCURACY].length > 0
selectedFileDataSource[data]?.[FEEDBACK_ACCURACY]?.length > 0
) {
shouldRevised =
selectedFileDataSource[data][FEEDBACK_ACCURACY][0] < 1;
}
} catch (error) {}
} catch (error) { }
return (
<div style={{ margin: '0 0 8px' }} className='file-input-group' key={data}>
<div
@ -875,7 +874,7 @@ const ReviewPage = () => {
options={SOLUTION_BAD_QUALITY}
onChange={setSolution}
value={solution}
// defaultValue={solution}
// defaultValue={solution}
/>
{solution === 'other' && (
<Input
@ -1103,7 +1102,7 @@ const ReviewPage = () => {
name='reviewed_result'
label={t`Review inculdes`}
>
<Input
<Input
defaultValue={filterReviewedResult}
onChange={(e) => setFilterReviewedResult(e.target.value)}
/>