Add message for when no events are found on plus view

This commit is contained in:
Josh Hawkins 2024-07-31 14:38:29 -05:00
parent 28fee26bc0
commit b368ee0ed0

View File

@ -43,6 +43,7 @@ import {
FaSortAmountDown,
FaSortAmountUp,
} from "react-icons/fa";
import { LuFolderX } from "react-icons/lu";
import { PiSlidersHorizontalFill } from "react-icons/pi";
import useSWR from "swr";
import useSWRInfinite from "swr/infinite";
@ -240,6 +241,12 @@ export default function SubmitPlus() {
<PlusSortSelector selectedSort={sort} setSelectedSort={setSort} />
</div>
<div className="no-scrollbar flex size-full flex-1 flex-wrap content-start gap-2 overflow-y-auto md:gap-4">
{events?.length === 0 ? (
<div className="absolute left-1/2 top-1/2 flex -translate-x-1/2 -translate-y-1/2 flex-col items-center justify-center text-center">
<LuFolderX className="size-16" />
No events found
</div>
) : (
<div className="grid w-full gap-2 p-2 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5">
<Dialog
open={upload != undefined}
@ -250,8 +257,8 @@ export default function SubmitPlus() {
<DialogTitle>Submit To Frigate+</DialogTitle>
<DialogDescription>
Objects in locations you want to avoid are not false
positives. Submitting them as false positives will confuse the
model.
positives. Submitting them as false positives will confuse
the model.
</DialogDescription>
</DialogHeader>
<img
@ -328,8 +335,9 @@ export default function SubmitPlus() {
);
})}
{!isValidating && !isDone && <div ref={lastEventRef} />}
{isValidating && <ActivityIndicator />}
</div>
)}
{isValidating && <ActivityIndicator />}
</div>
</div>
);