Enhancement: add valueOnly option to block highlighting feature (#6051)

This commit is contained in:
shamoon
2025-12-04 08:42:24 -08:00
committed by GitHub
parent c77dfa4c64
commit 6d5f35f07e
3 changed files with 23 additions and 4 deletions

View File

@@ -32,6 +32,8 @@ export default function Block({ value, label, field }) {
return getHighlightClass(highlight.level, highlightConfig);
}, [highlight, highlightConfig]);
const applyToValueOnly = highlight?.valueOnly === true;
return (
<div
className={classNames(
@@ -44,7 +46,11 @@ export default function Block({ value, label, field }) {
data-highlight-source={highlight?.source}
>
<div className="font-thin text-sm">{value === undefined || value === null ? "-" : value}</div>
<div className="font-bold text-xs uppercase">{t(label)}</div>
<div
className={classNames("font-bold text-xs uppercase", applyToValueOnly && "text-theme-700 dark:text-theme-200")}
>
{t(label)}
</div>
</div>
);
}