render clinical manifestations as BulletList in PathogenicFactorsDetailRenderer
This commit is contained in:
parent
bfb3c361dc
commit
d4bd2d43aa
|
|
@ -5,10 +5,11 @@ 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 { BulletList } from "../shared/BulletList";
|
||||||
import { SectionCard } from "../shared/SectionCard";
|
import { SectionCard } from "../shared/SectionCard";
|
||||||
import { Paragraphs } from "../shared/Paragraphs";
|
import { Paragraphs } from "../shared/Paragraphs";
|
||||||
import { ImageGallery } from "../shared/ImageGallery";
|
import { ImageGallery } from "../shared/ImageGallery";
|
||||||
import { asString } from "../helpers/value";
|
import { asString, asStringArray } from "../helpers/value";
|
||||||
|
|
||||||
export function PathogenicFactorsDetailRenderer({
|
export function PathogenicFactorsDetailRenderer({
|
||||||
content,
|
content,
|
||||||
|
|
@ -22,7 +23,12 @@ export function PathogenicFactorsDetailRenderer({
|
||||||
content.title;
|
content.title;
|
||||||
|
|
||||||
const overview = asString(data.overview);
|
const overview = asString(data.overview);
|
||||||
const clinicalManifestations = asString(data.clinical_manifestations);
|
const clinicalManifestationsRaw =
|
||||||
|
data.clinical_manifestations ??
|
||||||
|
data.clinical_manifestation;
|
||||||
|
const clinicalManifestationItems = asStringArray(clinicalManifestationsRaw).filter(
|
||||||
|
(item) => item.trim().length > 0,
|
||||||
|
);
|
||||||
const analysis = asString(data.analysis);
|
const analysis = asString(data.analysis);
|
||||||
const contentText = asString(data.content);
|
const contentText = asString(data.content);
|
||||||
const defaultImage = asString(data["default image"]);
|
const defaultImage = asString(data["default image"]);
|
||||||
|
|
@ -56,9 +62,9 @@ export function PathogenicFactorsDetailRenderer({
|
||||||
</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