import { baseUrl } from "@/api/baseUrl"; import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, } from "@/components/ui/alert-dialog"; import { Event } from "@/types/event"; import axios from "axios"; import { useCallback, useState } from "react"; import useSWR from "swr"; export default function SubmitPlus() { const { data: events, mutate: refresh } = useSWR([ "events", { limit: 100, in_progress: 0, is_submitted: 0 }, ]); const [upload, setUpload] = useState(); const onSubmitToPlus = useCallback( async (falsePositive: boolean) => { if (!upload) { return; } const resp = (await falsePositive) ? await axios.put(`events/${upload.id}/false_positive`) : await axios.post(`events/${upload.id}/plus`, { include_annotation: 1, }); if (resp.status == 200) { refresh(); } }, [refresh, upload], ); return (
(!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}`} Cancel onSubmitToPlus(false)} > This is a {upload?.label} onSubmitToPlus(true)} > This is not a {upload?.label} {events?.map((event) => { return (
setUpload(event)} >
); })}
); }