diff --git a/web/src/components/card/TimelineItemCard.tsx b/web/src/components/card/TimelineItemCard.tsx index ea278921b..000a29054 100644 --- a/web/src/components/card/TimelineItemCard.tsx +++ b/web/src/components/card/TimelineItemCard.tsx @@ -7,6 +7,19 @@ import { FrigateConfig } from "@/types/frigateConfig"; import VideoPlayer from "../player/VideoPlayer"; import { Card } from "../ui/card"; import { useApiHost } from "@/api"; +import { + AlertDialog, + AlertDialogAction, + AlertDialogCancel, + AlertDialogContent, + AlertDialogDescription, + AlertDialogFooter, + AlertDialogHeader, + AlertDialogTitle, + AlertDialogTrigger, +} from "../ui/alert-dialog"; +import { useCallback } from "react"; +import axios from "axios"; type TimelineItemCardProps = { timeline: Timeline; @@ -21,12 +34,23 @@ export default function TimelineItemCard({ const { data: config } = useSWR("config"); const apiHost = useApiHost(); + const onSubmitToPlus = useCallback( + async (falsePositive: boolean) => { + falsePositive + ? await axios.put(`events/${timeline.source_id}/false_positive`) + : await axios.post(`events/${timeline.source_id}/plus`, { + include_annotation: 1, + }); + }, + [timeline] + ); + return ( -
+
- + {timeline.source == "tracked_object" && ( + + + + + + + Submit To Frigate+ + + Objects in locations you want to avoid are not false + positives. Submitting them as false positives will confuse the + model. + + + {`${timeline.data.label}`} + + Cancel + onSubmitToPlus(false)} + > + This is a {timeline.data.label} + + onSubmitToPlus(true)} + > + This is not a {timeline.data.label} + + + + + )}
);