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 pulse = asString(data.pulse);
|
||||
const pathology = asString(data.pathology);
|
||||
const treatmentPrinciple =
|
||||
asString(data.treatment_principle) ||
|
||||
asString(data["treatment principle"]);
|
||||
const treatmentPrincipleRaw =
|
||||
data.treatment_principle ?? data["treatment principle"];
|
||||
const treatmentPrincipleItems = asStringArray(treatmentPrincipleRaw).filter(
|
||||
(item) => item.trim().length > 0,
|
||||
);
|
||||
const treatmentPrinciple = asString(treatmentPrincipleRaw);
|
||||
const treatment = asString(data.treatment);
|
||||
const treatmentBullets = parseTreatmentBullets(treatment);
|
||||
const explanation = asString(data.explanation);
|
||||
|
|
@ -231,7 +234,11 @@ export function FourLevelsDetailRenderer({
|
|||
</SectionCard>
|
||||
) : null}
|
||||
|
||||
{treatmentPrinciple ? (
|
||||
{treatmentPrincipleItems.length > 0 ? (
|
||||
<SectionCard title="Treatment Principle">
|
||||
<BulletList items={treatmentPrincipleItems} />
|
||||
</SectionCard>
|
||||
) : treatmentPrinciple ? (
|
||||
<SectionCard title="Treatment Principle">
|
||||
<Paragraphs items={[treatmentPrinciple]} />
|
||||
</SectionCard>
|
||||
|
|
|
|||
Loading…
Reference in New Issue