Simplify comparisons

This commit is contained in:
Nicolas Mowen 2024-03-11 06:49:25 -06:00
parent 8aecef5eab
commit 50d55a0c11

View File

@ -452,13 +452,13 @@ function DetectionReview({
/> />
)} )}
{currentItems == null && ( {!currentItems && (
<div className="absolute left-1/2 -translate-x-1/2 top-1/2 -translate-y-1/2"> <div className="absolute left-1/2 -translate-x-1/2 top-1/2 -translate-y-1/2">
<ActivityIndicator /> <ActivityIndicator />
</div> </div>
)} )}
{currentItems != null && currentItems.length == 0 && ( {currentItems?.length === 0 && (
<div className="absolute left-1/2 -translate-x-1/2 top-1/2 -translate-y-1/2 flex flex-col justify-center items-center text-center"> <div className="absolute left-1/2 -translate-x-1/2 top-1/2 -translate-y-1/2 flex flex-col justify-center items-center text-center">
<LuFolderCheck className="size-16" /> <LuFolderCheck className="size-16" />
There are no {severity.replace(/_/g, " ")}s to review There are no {severity.replace(/_/g, " ")}s to review
@ -496,19 +496,17 @@ function DetectionReview({
</div> </div>
); );
})} })}
{currentItems != null && {(currentItems?.length ?? 0) > 0 && (itemsToReview ?? 0) > 0 && (
currentItems.length > 0 && <div className="col-span-full flex justify-center items-center">
(itemsToReview ?? 0) > 0 && ( <Button
<div className="col-span-full flex justify-center items-center"> className="text-white"
<Button variant="select"
className="text-white" onClick={markAllReviewed}
variant="select" >
onClick={markAllReviewed} Mark these items as reviewed
> </Button>
Mark these items as reviewed </div>
</Button> )}
</div>
)}
</div> </div>
</div> </div>
<div className="w-[55px] md:w-[100px] mt-2 overflow-y-auto no-scrollbar"> <div className="w-[55px] md:w-[100px] mt-2 overflow-y-auto no-scrollbar">