chore: add InputWithTags zone friendly name support

This commit is contained in:
ZhaiSoul 2025-10-23 13:57:00 +00:00
parent 6a72a041d6
commit 450623e927

View File

@ -53,7 +53,7 @@ import { FrigateConfig } from "@/types/frigateConfig";
import { MdImageSearch } from "react-icons/md"; import { MdImageSearch } from "react-icons/md";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { getTranslatedLabel } from "@/utils/i18n"; import { getTranslatedLabel } from "@/utils/i18n";
import { CameraNameLabel } from "../camera/FriendlyNameLabel"; import { CameraNameLabel, ZoneNameLabel } from "../camera/FriendlyNameLabel";
type InputWithTagsProps = { type InputWithTagsProps = {
inputFocused: boolean; inputFocused: boolean;
@ -831,6 +831,8 @@ export default function InputWithTags({
getTranslatedLabel(value) getTranslatedLabel(value)
) : filterType === "cameras" ? ( ) : filterType === "cameras" ? (
<CameraNameLabel camera={value} /> <CameraNameLabel camera={value} />
) : filterType === "zones" ? (
<ZoneNameLabel zone={value} />
) : ( ) : (
value.replaceAll("_", " ") value.replaceAll("_", " ")
)} )}
@ -934,6 +936,11 @@ export default function InputWithTags({
<CameraNameLabel camera={suggestion} /> <CameraNameLabel camera={suggestion} />
{")"} {")"}
</> </>
) : currentFilterType === "zones" ? (
<>
{suggestion} {" ("} <ZoneNameLabel zone={suggestion} />
{")"}
</>
) : ( ) : (
suggestion suggestion
) )
@ -943,6 +950,8 @@ export default function InputWithTags({
{currentFilterType ? ( {currentFilterType ? (
currentFilterType === "cameras" ? ( currentFilterType === "cameras" ? (
<CameraNameLabel camera={suggestion} /> <CameraNameLabel camera={suggestion} />
) : currentFilterType === "zones" ? (
<ZoneNameLabel zone={suggestion} />
) : ( ) : (
formatFilterValues(currentFilterType, suggestion) formatFilterValues(currentFilterType, suggestion)
) )