From b921b2137db05ad1e3a1a3e9552957cb947e05bf Mon Sep 17 00:00:00 2001 From: ShivaniKhaire Date: Fri, 30 Oct 2026 17:43:40 +0530 Subject: [PATCH] Render treatment principle as bulleted list matching clinical manifestations --- .../collections/ModuleCatalogRenderers.tsx | 23 ++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/src/features/content/renderers/collections/ModuleCatalogRenderers.tsx b/src/features/content/renderers/collections/ModuleCatalogRenderers.tsx index 8b70505..ae71088 100644 --- a/src/features/content/renderers/collections/ModuleCatalogRenderers.tsx +++ b/src/features/content/renderers/collections/ModuleCatalogRenderers.tsx @@ -169,7 +169,15 @@ export function PatternAccordionCardRenderer({ const tongue = asString(detailData.tongue); const pulse = asString(detailData.pulse); - const treatmentPrinciple = asString(detailData.treatment_principle); + const rawPrinciples = detailData.treatment_principle; + const treatmentPrinciples: string[] = Array.isArray(rawPrinciples) + ? (rawPrinciples as string[]).map(String).map((s) => s.trim()).filter(Boolean) + : typeof rawPrinciples === "string" && rawPrinciples.trim() + ? rawPrinciples + .split(/[,;\n]/) + .map((s) => s.trim().replace(/^[-*•]\s*/, "")) + .filter(Boolean) + : []; const rawAcupuncture = detailData.acupuncture; let acuPoints = ""; @@ -267,15 +275,18 @@ export function PatternAccordionCardRenderer({ ) : null} {/* 3. Treatment Principle */} - {treatmentPrinciple ? ( + {treatmentPrinciples.length > 0 ? ( Treatment Principle - - - {treatmentPrinciple} - + + {treatmentPrinciples.map((itemText, idx) => ( + + + {itemText} + + ))} ) : null}