Fix -1 text

This commit is contained in:
Nicolas Mowen 2024-03-10 13:49:05 -06:00
parent 4818e8e0ae
commit c4e5d7786e

View File

@ -85,7 +85,7 @@ export default function EventView({
} }
if (!summary) { if (!summary) {
return { alert: 0, detection: 0, significant_motion: 0 }; return { alert: -1, detection: -1, significant_motion: -1 };
} }
if (filter?.showReviewed == 1) { if (filter?.showReviewed == 1) {
@ -206,7 +206,9 @@ export default function EventView({
aria-label="Select alerts" aria-label="Select alerts"
> >
<MdCircle className="size-2 md:mr-[10px] text-severity_alert" /> <MdCircle className="size-2 md:mr-[10px] text-severity_alert" />
<div className="hidden md:block">Alerts {reviewCounts.alert}</div> <div className="hidden md:block">
Alerts{`${reviewCounts.alert > -1 ? reviewCounts.alert : ""}`}
</div>
</ToggleGroupItem> </ToggleGroupItem>
<ToggleGroupItem <ToggleGroupItem
className={`${severity == "detection" ? "" : "text-gray-500"}`} className={`${severity == "detection" ? "" : "text-gray-500"}`}
@ -215,7 +217,8 @@ export default function EventView({
> >
<MdCircle className="size-2 md:mr-[10px] text-severity_detection" /> <MdCircle className="size-2 md:mr-[10px] text-severity_detection" />
<div className="hidden md:block"> <div className="hidden md:block">
Detections {reviewCounts.detection} Detections
{`${reviewCounts.detection > -1 ? reviewCounts.detection : ""}`}
</div> </div>
</ToggleGroupItem> </ToggleGroupItem>
<ToggleGroupItem <ToggleGroupItem