From 61ddf09ef0d6c9a981a2b251e402b69719530d49 Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Mon, 13 Oct 2025 13:08:30 -0700 Subject: [PATCH] Fix field thing --- src/components/services/widget/block.jsx | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/components/services/widget/block.jsx b/src/components/services/widget/block.jsx index 2393d9452..8dc0e8883 100644 --- a/src/components/services/widget/block.jsx +++ b/src/components/services/widget/block.jsx @@ -6,16 +6,22 @@ import { evaluateHighlight, getHighlightClass } from "utils/highlights"; import { BlockHighlightContext } from "./highlight-context"; -export default function Block({ value, label, field }) { +export default function Block({ value, label }) { const { t } = useTranslation(); const highlightConfig = useContext(BlockHighlightContext); const highlight = useMemo(() => { if (!highlightConfig) return null; - const fieldKey = field || label; - if (!fieldKey) return null; - return evaluateHighlight(fieldKey, value, highlightConfig); - }, [field, label, value, highlightConfig]); + const labels = Array.isArray(label) ? label : [label]; + + for (const candidate of labels) { + if (typeof candidate !== "string") continue; + const result = evaluateHighlight(candidate, value, highlightConfig); + if (result) return result; + } + + return null; + }, [label, value, highlightConfig]); const highlightClass = useMemo(() => { if (!highlight?.level) return undefined;