feat(renderers): render FourLevels treatment_principle as bullet list
This commit is contained in:
parent
27e62f99db
commit
525fe5b7e3
|
|
@ -94,9 +94,12 @@ export function FourLevelsDetailRenderer({
|
||||||
const tongue = asString(data.tongue);
|
const tongue = asString(data.tongue);
|
||||||
const pulse = asString(data.pulse);
|
const pulse = asString(data.pulse);
|
||||||
const pathology = asString(data.pathology);
|
const pathology = asString(data.pathology);
|
||||||
const treatmentPrinciple =
|
const treatmentPrincipleRaw =
|
||||||
asString(data.treatment_principle) ||
|
data.treatment_principle ?? data["treatment principle"];
|
||||||
asString(data["treatment principle"]);
|
const treatmentPrincipleItems = asStringArray(treatmentPrincipleRaw).filter(
|
||||||
|
(item) => item.trim().length > 0,
|
||||||
|
);
|
||||||
|
const treatmentPrinciple = asString(treatmentPrincipleRaw);
|
||||||
const treatment = asString(data.treatment);
|
const treatment = asString(data.treatment);
|
||||||
const treatmentBullets = parseTreatmentBullets(treatment);
|
const treatmentBullets = parseTreatmentBullets(treatment);
|
||||||
const explanation = asString(data.explanation);
|
const explanation = asString(data.explanation);
|
||||||
|
|
@ -231,7 +234,11 @@ export function FourLevelsDetailRenderer({
|
||||||
</SectionCard>
|
</SectionCard>
|
||||||
) : null}
|
) : null}
|
||||||
|
|
||||||
{treatmentPrinciple ? (
|
{treatmentPrincipleItems.length > 0 ? (
|
||||||
|
<SectionCard title="Treatment Principle">
|
||||||
|
<BulletList items={treatmentPrincipleItems} />
|
||||||
|
</SectionCard>
|
||||||
|
) : treatmentPrinciple ? (
|
||||||
<SectionCard title="Treatment Principle">
|
<SectionCard title="Treatment Principle">
|
||||||
<Paragraphs items={[treatmentPrinciple]} />
|
<Paragraphs items={[treatmentPrinciple]} />
|
||||||
</SectionCard>
|
</SectionCard>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue