render clinical manifestations as BulletList in FourLevelsDetailRenderer
This commit is contained in:
parent
7d17bdb3de
commit
bfb3c361dc
|
|
@ -5,9 +5,10 @@ import type { DetailRendererProps } from "../../types/renderer.types";
|
||||||
|
|
||||||
import { ContentLinkAttributeSections } from "../shared/ContentLinkAttributeSections";
|
import { ContentLinkAttributeSections } from "../shared/ContentLinkAttributeSections";
|
||||||
import { Hero } from "../shared/Hero";
|
import { Hero } from "../shared/Hero";
|
||||||
import { SectionCard } from "../shared/SectionCard";
|
import { BulletList } from "../shared/BulletList";
|
||||||
import { Paragraphs } from "../shared/Paragraphs";
|
import { Paragraphs } from "../shared/Paragraphs";
|
||||||
import { asString } from "../helpers/value";
|
import { SectionCard } from "../shared/SectionCard";
|
||||||
|
import { asString, asStringArray } from "../helpers/value";
|
||||||
|
|
||||||
export function FourLevelsDetailRenderer({
|
export function FourLevelsDetailRenderer({
|
||||||
content,
|
content,
|
||||||
|
|
@ -21,10 +22,13 @@ export function FourLevelsDetailRenderer({
|
||||||
content.title;
|
content.title;
|
||||||
|
|
||||||
const overview = asString(data.overview);
|
const overview = asString(data.overview);
|
||||||
const clinicalManifestations =
|
const clinicalManifestationsRaw =
|
||||||
asString(data.clinical_manifestation) ||
|
data.clinical_manifestation ??
|
||||||
asString(data.clinical_manifestations) ||
|
data.clinical_manifestations ??
|
||||||
asString(data.clinical_menifestation);
|
data.clinical_menifestation;
|
||||||
|
const clinicalManifestationItems = asStringArray(clinicalManifestationsRaw).filter(
|
||||||
|
(item) => item.trim().length > 0,
|
||||||
|
);
|
||||||
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);
|
||||||
|
|
@ -48,9 +52,9 @@ export function FourLevelsDetailRenderer({
|
||||||
</SectionCard>
|
</SectionCard>
|
||||||
) : null}
|
) : null}
|
||||||
|
|
||||||
{clinicalManifestations ? (
|
{clinicalManifestationItems.length > 0 ? (
|
||||||
<SectionCard title="Clinical Manifestations">
|
<SectionCard title="Clinical Manifestations">
|
||||||
<Paragraphs items={[clinicalManifestations]} />
|
<BulletList items={clinicalManifestationItems} />
|
||||||
</SectionCard>
|
</SectionCard>
|
||||||
) : null}
|
) : null}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue