revert(m0041): rely on backend template definitions for attribute labels
This commit is contained in:
parent
a3af361419
commit
2925ae4e28
|
|
@ -11,11 +11,6 @@ import { SectionCard } from "./shared/SectionCard";
|
||||||
|
|
||||||
const RESERVED_KEYS = new Set(["code", "id", "slug", "sort_order", "link"]);
|
const RESERVED_KEYS = new Set(["code", "id", "slug", "sort_order", "link"]);
|
||||||
|
|
||||||
const ATTRIBUTE_LABEL_OVERRIDES: Record<string, string> = {
|
|
||||||
m_p: "Main Points",
|
|
||||||
s_p: "Supplementary Points",
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generic detail renderer for modules and catalog items.
|
* Generic detail renderer for modules and catalog items.
|
||||||
*
|
*
|
||||||
|
|
@ -65,10 +60,7 @@ export function GenericDetailRenderer({
|
||||||
!(isTherapeutic && key.toLowerCase() === "name"),
|
!(isTherapeutic && key.toLowerCase() === "name"),
|
||||||
)
|
)
|
||||||
.map(([key, value]) => {
|
.map(([key, value]) => {
|
||||||
const rawLabel =
|
const rawLabel = definitionMap.get(key) || key;
|
||||||
ATTRIBUTE_LABEL_OVERRIDES[key.toLowerCase()] ||
|
|
||||||
definitionMap.get(key) ||
|
|
||||||
key;
|
|
||||||
const label = humanizeKey(rawLabel);
|
const label = humanizeKey(rawLabel);
|
||||||
return (
|
return (
|
||||||
<SectionCard key={key} title={label}>
|
<SectionCard key={key} title={label}>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue