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 { Hero } from "../shared/Hero";
|
||||
import { BulletList } from "../shared/BulletList";
|
||||
import { SectionCard } from "../shared/SectionCard";
|
||||
import { Paragraphs } from "../shared/Paragraphs";
|
||||
import { ImageGallery } from "../shared/ImageGallery";
|
||||
import { asString } from "../helpers/value";
|
||||
import { asString, asStringArray } from "../helpers/value";
|
||||
|
||||
export function PathogenicFactorsDetailRenderer({
|
||||
content,
|
||||
|
|
@ -22,7 +23,12 @@ export function PathogenicFactorsDetailRenderer({
|
|||
content.title;
|
||||
|
||||
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 contentText = asString(data.content);
|
||||
const defaultImage = asString(data["default image"]);
|
||||
|
|
@ -56,9 +62,9 @@ export function PathogenicFactorsDetailRenderer({
|
|||
</SectionCard>
|
||||
) : null}
|
||||
|
||||
{clinicalManifestations ? (
|
||||
{clinicalManifestationItems.length > 0 ? (
|
||||
<SectionCard title="Clinical Manifestations">
|
||||
<Paragraphs items={[clinicalManifestations]} />
|
||||
<BulletList items={clinicalManifestationItems} />
|
||||
</SectionCard>
|
||||
) : null}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue