From b368ee0ed0fc8113cd0483b65b951aefcbb4c259 Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Wed, 31 Jul 2024 14:38:29 -0500 Subject: [PATCH] Add message for when no events are found on plus view --- web/src/pages/SubmitPlus.tsx | 184 ++++++++++++++++++----------------- 1 file changed, 96 insertions(+), 88 deletions(-) diff --git a/web/src/pages/SubmitPlus.tsx b/web/src/pages/SubmitPlus.tsx index c1a89dc45..918024afe 100644 --- a/web/src/pages/SubmitPlus.tsx +++ b/web/src/pages/SubmitPlus.tsx @@ -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,96 +241,103 @@ export default function SubmitPlus() {
-
- (!open ? setUpload(undefined) : null)} - > - - - Submit To Frigate+ - - Objects in locations you want to avoid are not false - positives. Submitting them as false positives will confuse the - model. - - - {`${upload?.label}`} - - - - - - - - - {events?.map((event) => { - if (event.data.type != "object" || event.plus_id) { - return; - } - - return ( -
setUpload(event)} - > -
- -
- -
- - {[event.label].map((object) => { - return getIconForLabel( - object, - "size-3 text-white", - ); - })} -
- {Math.round(event.data.score * 100)}% -
-
-
-
-
- - {[event.label] - .map((text) => capitalizeFirstLetter(text)) - .sort() - .join(", ") - .replaceAll("-verified", "")} - -
-
+ {events?.length === 0 ? ( +
+ + No events found +
+ ) : ( +
+ (!open ? setUpload(undefined) : null)} + > + + + Submit To Frigate+ + + Objects in locations you want to avoid are not false + positives. Submitting them as false positives will confuse + the model. + + {`${upload?.label}`} -
- ); - })} - {!isValidating && !isDone &&
} - {isValidating && } -
+ + + + + + + + + {events?.map((event) => { + if (event.data.type != "object" || event.plus_id) { + return; + } + + return ( +
setUpload(event)} + > +
+ +
+ +
+ + {[event.label].map((object) => { + return getIconForLabel( + object, + "size-3 text-white", + ); + })} +
+ {Math.round(event.data.score * 100)}% +
+
+
+
+
+ + {[event.label] + .map((text) => capitalizeFirstLetter(text)) + .sort() + .join(", ") + .replaceAll("-verified", "")} + +
+
+ +
+ ); + })} + {!isValidating && !isDone &&
} +
+ )} + {isValidating && }
);