diff --git a/web/src/components/menu/LiveContextMenu.tsx b/web/src/components/menu/LiveContextMenu.tsx index 09e65aa44..300bd2212 100644 --- a/web/src/components/menu/LiveContextMenu.tsx +++ b/web/src/components/menu/LiveContextMenu.tsx @@ -46,6 +46,7 @@ import { } from "@/api/ws"; import { useTranslation } from "react-i18next"; import { useDateLocale } from "@/hooks/use-date-locale"; +import { useIsAdmin } from "@/hooks/use-is-admin"; type LiveContextMenuProps = { className?: string; @@ -90,6 +91,10 @@ export default function LiveContextMenu({ const { t } = useTranslation("views/live"); const [showSettings, setShowSettings] = useState(false); + // roles + + const isAdmin = useIsAdmin(); + // camera enabled const { payload: enabledState, send: sendEnabled } = useEnabledState(camera); @@ -301,17 +306,21 @@ export default function LiveContextMenu({ > )} - - sendEnabled(isEnabled ? "OFF" : "ON")} - > - - {isEnabled ? t("camera.disable") : t("camera.enable")} - - - - + {isAdmin && ( + <> + + sendEnabled(isEnabled ? "OFF" : "ON")} + > + + {isEnabled ? t("camera.disable") : t("camera.enable")} + + + + + > + )}