diff --git a/web/src/components/overlay/detail/SearchDetailDialog.tsx b/web/src/components/overlay/detail/SearchDetailDialog.tsx index f5c19ecb6a..6762890d4a 100644 --- a/web/src/components/overlay/detail/SearchDetailDialog.tsx +++ b/web/src/components/overlay/detail/SearchDetailDialog.tsx @@ -76,6 +76,7 @@ import { FaPencilAlt } from "react-icons/fa"; import TextEntryDialog from "@/components/overlay/dialog/TextEntryDialog"; import { useTranslation } from "react-i18next"; import { TbFaceId } from "react-icons/tb"; +import { useIsAdmin } from "@/hooks/use-is-admin"; const SEARCH_TABS = [ "details", @@ -295,6 +296,10 @@ function ObjectDetailsTab({ const mutate = useGlobalMutation(); + // users + + const isAdmin = useIsAdmin(); + // data const [desc, setDesc] = useState(search?.data.description); @@ -687,23 +692,25 @@ function ObjectDetailsTab({ {getIconForLabel(search.label, "size-4 text-primary")} {t(search.label, { ns: "objects" })} {search.sub_label && ` (${search.sub_label})`} - - - - { - setIsSubLabelDialogOpen(true); - }} - /> - - - - - {t("details.editSubLabel.title")} - - - + {isAdmin && ( + + + + { + setIsSubLabelDialogOpen(true); + }} + /> + + + + + {t("details.editSubLabel.title")} + + + + )} {search?.data.recognized_license_plate && ( @@ -716,23 +723,25 @@ function ObjectDetailsTab({ {search.data.recognized_license_plate}{" "} {recognizedLicensePlateScore && ` (${recognizedLicensePlateScore}%)`} - - - - { - setIsLPRDialogOpen(true); - }} - /> - - - - - {t("details.editLPR.title")} - - - + {isAdmin && ( + + + + { + setIsLPRDialogOpen(true); + }} + /> + + + + + {t("details.editLPR.title")} + + + + )}