diff --git a/web/src/components/overlay/detail/ObjectLifecycle.tsx b/web/src/components/overlay/detail/ObjectLifecycle.tsx index 954f9cd6d..1ff4ade8d 100644 --- a/web/src/components/overlay/detail/ObjectLifecycle.tsx +++ b/web/src/components/overlay/detail/ObjectLifecycle.tsx @@ -41,6 +41,13 @@ import { ContextMenuItem, ContextMenuTrigger, } from "@/components/ui/context-menu"; +import { + DropdownMenu, + DropdownMenuTrigger, + DropdownMenuContent, + DropdownMenuItem, + DropdownMenuPortal, +} from "@/components/ui/dropdown-menu"; import { Link, useNavigate } from "react-router-dom"; import { ObjectPath } from "./ObjectPath"; import { getLifecycleItemDescription } from "@/utils/lifecycleUtil"; @@ -48,6 +55,10 @@ import { IoPlayCircleOutline } from "react-icons/io5"; import { useTranslation } from "react-i18next"; import { getTranslatedLabel } from "@/utils/i18n"; import { Badge } from "@/components/ui/badge"; +import FrigatePlusIcon from "@/components/icons/FrigatePlusIcon"; +import { HiDotsHorizontal } from "react-icons/hi"; +import axios from "axios"; +import { toast } from "sonner"; type ObjectLifecycleProps = { className?: string; @@ -816,7 +827,9 @@ function LifecycleIconRow({ setSelectedZone, getZoneColor, }: LifecycleIconRowProps) { - const { t } = useTranslation(["views/explore"]); + const { t } = useTranslation(["views/explore", "components/player"]); + const [isOpen, setIsOpen] = useState(false); + const { data: config } = useSWR("config"); return (
-
{formattedEventTimestamp}
+
+
{formattedEventTimestamp}
+ {config?.plus?.enabled && ( + + +
+ +
+
+ + + {config?.plus?.enabled && ( + { + const resp = await axios.post( + `/${item.camera}/plus/${item.timestamp}`, + ); + + if (resp && resp.status == 200) { + toast.success( + t("toast.success.submittedFrigatePlus", { + ns: "components/player", + }), + { + position: "top-center", + }, + ); + } else { + toast.success( + t("toast.error.submitFrigatePlusFailed", { + ns: "components/player", + }), + { + position: "top-center", + }, + ); + } + }} + > + + {t("itemMenu.submitToPlus.label")} + + )} + + +
+ )} +