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 { Hero } from "../shared/Hero";
|
||||
import { SectionCard } from "../shared/SectionCard";
|
||||
import { BulletList } from "../shared/BulletList";
|
||||
import { Paragraphs } from "../shared/Paragraphs";
|
||||
import { asString } from "../helpers/value";
|
||||
import { SectionCard } from "../shared/SectionCard";
|
||||
import { asString, asStringArray } from "../helpers/value";
|
||||
|
||||
export function FourLevelsDetailRenderer({
|
||||
content,
|
||||
|
|
@ -21,10 +22,13 @@ export function FourLevelsDetailRenderer({
|
|||
content.title;
|
||||
|
||||
const overview = asString(data.overview);
|
||||
const clinicalManifestations =
|
||||
asString(data.clinical_manifestation) ||
|
||||
asString(data.clinical_manifestations) ||
|
||||
asString(data.clinical_menifestation);
|
||||
const clinicalManifestationsRaw =
|
||||
data.clinical_manifestation ??
|
||||
data.clinical_manifestations ??
|
||||
data.clinical_menifestation;
|
||||
const clinicalManifestationItems = asStringArray(clinicalManifestationsRaw).filter(
|
||||
(item) => item.trim().length > 0,
|
||||
);
|
||||
const tongue = asString(data.tongue);
|
||||
const pulse = asString(data.pulse);
|
||||
const pathology = asString(data.pathology);
|
||||
|
|
@ -48,9 +52,9 @@ export function FourLevelsDetailRenderer({
|
|||
</SectionCard>
|
||||
) : null}
|
||||
|
||||
{clinicalManifestations ? (
|
||||
{clinicalManifestationItems.length > 0 ? (
|
||||
<SectionCard title="Clinical Manifestations">
|
||||
<Paragraphs items={[clinicalManifestations]} />
|
||||
<BulletList items={clinicalManifestationItems} />
|
||||
</SectionCard>
|
||||
) : null}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue