diff --git a/src/features/content/media/ContentMediaGallery.tsx b/src/features/content/media/ContentMediaGallery.tsx
index ce0939b..328e729 100644
--- a/src/features/content/media/ContentMediaGallery.tsx
+++ b/src/features/content/media/ContentMediaGallery.tsx
@@ -133,7 +133,7 @@ const GalleryImage = memo(function GalleryImage({
previous.item.caption === next.item.caption
);
-export function ContentMediaGallery({ media, title = "Visual reference" }: ContentMediaGalleryProps) {
+export function ContentMediaGallery({ media, title = "Visual Reference" }: ContentMediaGalleryProps) {
const items = useMemo(() => sortMedia(media ?? []), [media]);
const { width: windowWidth } = useWindowDimensions();
const carouselWidth = Math.max(windowWidth - Spacing.md * 2, 280);
diff --git a/src/features/content/renderers/details/EovDetailRenderer.tsx b/src/features/content/renderers/details/EovDetailRenderer.tsx
index aab1f6b..a8fbb1f 100644
--- a/src/features/content/renderers/details/EovDetailRenderer.tsx
+++ b/src/features/content/renderers/details/EovDetailRenderer.tsx
@@ -148,6 +148,43 @@ export function EovDetailRenderer({
});
}
+ const clinicalManifestations = data.clinical_manifestation ?? data.clinical_manifestations;
+ if (!isEmptyValue(clinicalManifestations)) {
+ items.push({
+ key: "clinical_manifestation",
+ order: orderFor("clinical_manifestation", orderFor("clinical_manifestations", 125)),
+ render: () => (
+
+
+
+ ),
+ });
+ }
+
+ if (!isEmptyValue(data.connecting_channel)) {
+ items.push({
+ key: "connecting_channel",
+ order: orderFor("connecting_channel", 130),
+ render: () => (
+
+ {asString(data.connecting_channel)}
+
+ ),
+ });
+ }
+
+ if (!isEmptyValue(data.treatment)) {
+ items.push({
+ key: "treatment",
+ order: orderFor("treatment", 140),
+ render: () => (
+
+ {asString(data.treatment)}
+
+ ),
+ });
+ }
+
return items.sort((a, b) => a.order - b.order || a.key.localeCompare(b.key));
}, [data, orderFor, relationshipRows]);
diff --git a/src/features/content/renderers/details/FourLevelsDetailRenderer.tsx b/src/features/content/renderers/details/FourLevelsDetailRenderer.tsx
index e092583..a236901 100644
--- a/src/features/content/renderers/details/FourLevelsDetailRenderer.tsx
+++ b/src/features/content/renderers/details/FourLevelsDetailRenderer.tsx
@@ -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({
) : null}
- {clinicalManifestations ? (
+ {clinicalManifestationItems.length > 0 ? (
-
+
) : null}
diff --git a/src/features/content/renderers/details/PathogenicFactorsDetailRenderer.tsx b/src/features/content/renderers/details/PathogenicFactorsDetailRenderer.tsx
index ecc25c8..90e941b 100644
--- a/src/features/content/renderers/details/PathogenicFactorsDetailRenderer.tsx
+++ b/src/features/content/renderers/details/PathogenicFactorsDetailRenderer.tsx
@@ -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({
) : null}
- {clinicalManifestations ? (
+ {clinicalManifestationItems.length > 0 ? (
-
+
) : null}
diff --git a/src/features/content/renderers/details/QiBloodDetailRenderer.tsx b/src/features/content/renderers/details/QiBloodDetailRenderer.tsx
index e40759a..f7e4677 100644
--- a/src/features/content/renderers/details/QiBloodDetailRenderer.tsx
+++ b/src/features/content/renderers/details/QiBloodDetailRenderer.tsx
@@ -9,8 +9,9 @@ import { BackActionContext } from "../../context/BackActionContext";
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, humanizeKey } from "../helpers/value";
+import { asString, asStringArray, humanizeKey } from "../helpers/value";
const RESERVED_METADATA_KEYS = new Set([
"name",
@@ -36,12 +37,46 @@ interface PatternItem {
interface ParsedNode {
overview?: string;
- clinical?: string;
+ clinicalItems: string[];
analysis?: string;
subItems: PatternItem[];
otherTextEntries: Array<{ key: string; text: string }>;
}
+function parseClinicalManifestations(raw: unknown): string[] {
+ if (Array.isArray(raw)) {
+ return asStringArray(raw);
+ }
+ const text = asString(raw).trim();
+ if (!text) return [];
+
+ // Check if string is semicolon or newline separated
+ if (text.includes("\n")) {
+ return text
+ .split("\n")
+ .map((s) => s.replace(/^[•\-\*\d+\.]\s*/, "").trim())
+ .filter((s) => s.length > 0);
+ }
+
+ // If semicolon separated
+ if (text.includes(";")) {
+ return text
+ .split(";")
+ .map((s) => s.trim().replace(/^and\s+/i, ""))
+ .filter((s) => s.length > 0);
+ }
+
+ // Split by comma outside parentheses
+ const parts = text.split(/,\s*(?![^()]*\))/);
+ if (parts.length > 1) {
+ return parts
+ .map((s) => s.trim().replace(/\.$/, "").replace(/^and\s+/i, ""))
+ .filter((s) => s.length > 0);
+ }
+
+ return [text];
+}
+
function extractCategoryOverview(data: Record, categoryCode: string): string {
const normalizedCode = categoryCode.toLowerCase().replace(/[^a-z0-9_]/g, "_");
@@ -121,12 +156,13 @@ function parseNode(raw: Record): ParsedNode {
(typeof raw.content === "string" ? raw.content.trim() : undefined) ||
(typeof raw.overview === "string" ? raw.overview.trim() : undefined);
- const clinical =
- asString(contentTarget["Clinical manifestations"]) ||
- asString(contentTarget.clinical_manifestations) ||
- asString(contentTarget.clinical_manifestation) ||
- asString(raw["Clinical manifestations"]) ||
- asString(raw.clinical_manifestations);
+ const clinicalRaw =
+ contentTarget["Clinical manifestations"] ??
+ contentTarget.clinical_manifestations ??
+ contentTarget.clinical_manifestation ??
+ raw["Clinical manifestations"] ??
+ raw.clinical_manifestations;
+ const clinicalItems = parseClinicalManifestations(clinicalRaw);
const analysis =
asString(contentTarget.Analysis) ||
@@ -161,7 +197,7 @@ function parseNode(raw: Record): ParsedNode {
return {
overview: overview || undefined,
- clinical: clinical || undefined,
+ clinicalItems,
analysis: analysis || undefined,
subItems,
otherTextEntries,
@@ -227,9 +263,9 @@ export function QiBloodDetailRenderer({
) : null}
{/* 2. Clinical Manifestations Card */}
- {parsed.clinical ? (
+ {parsed.clinicalItems.length > 0 ? (
-
+
) : null}
diff --git a/src/features/content/renderers/details/ThreeBurnersDetailRenderer.tsx b/src/features/content/renderers/details/ThreeBurnersDetailRenderer.tsx
index ccb3248..0f7c8b5 100644
--- a/src/features/content/renderers/details/ThreeBurnersDetailRenderer.tsx
+++ b/src/features/content/renderers/details/ThreeBurnersDetailRenderer.tsx
@@ -9,17 +9,49 @@ import { BackActionContext } from "../../context/BackActionContext";
import { Hero } from "../shared/Hero";
import { SectionCard } from "../shared/SectionCard";
import { Paragraphs } from "../shared/Paragraphs";
-import { asString } from "../helpers/value";
+import { BulletList } from "../shared/BulletList";
+import { asString, asStringArray } from "../helpers/value";
import { useContentSearchInfiniteQuery } from "../../hooks/use-content-search-infinite-query";
interface PatternData {
name: string;
code?: string;
- clinicalManifestation?: string;
+ clinicalManifestation?: string | string[];
pathology?: string;
treatment?: string;
}
+function parseBullets(raw: unknown): string[] {
+ if (Array.isArray(raw)) {
+ return asStringArray(raw);
+ }
+ const text = asString(raw).trim();
+ if (!text) return [];
+
+ if (text.includes("\n")) {
+ return text
+ .split("\n")
+ .map((s) => s.replace(/^[•\-\*\d+\.]\s*/, "").trim())
+ .filter((s) => s.length > 0);
+ }
+
+ if (text.includes(";")) {
+ return text
+ .split(";")
+ .map((s) => s.trim().replace(/^and\s+/i, ""))
+ .filter((s) => s.length > 0);
+ }
+
+ const parts = text.split(/,\s*(?![^()]*\))/);
+ if (parts.length > 1) {
+ return parts
+ .map((s) => s.trim().replace(/\.$/, "").replace(/^and\s+/i, ""))
+ .filter((s) => s.length > 0);
+ }
+
+ return [text];
+}
+
interface BurnerCategory {
key: string;
title: string;
@@ -183,7 +215,10 @@ export function ThreeBurnersDetailRenderer({
// 1. Seed fallback patterns
for (const p of Object.values(FALLBACK_PATTERNS)) {
- map.set(normalizeKey(p.name), p);
+ map.set(normalizeKey(p.name), {
+ ...p,
+ clinicalManifestation: parseBullets(p.clinicalManifestation),
+ });
}
// 2. Hydrate from live search query
@@ -193,19 +228,20 @@ export function ThreeBurnersDetailRenderer({
const name = asString(a.name) || it.title;
if (!name) continue;
- const clinical =
- asString(a["clinical menifestation"]) ||
- asString(a["clinical manifestation"]) ||
- asString(a.clinical_manifestations) ||
- asString(a.clinical_manifestation);
+ const clinicalRaw =
+ a["clinical menifestation"] ??
+ a["clinical manifestation"] ??
+ a.clinical_manifestations ??
+ a.clinical_manifestation;
+ const clinical = parseBullets(clinicalRaw);
const pathology = asString(a.pathology);
const treatment = asString(a.treatment);
map.set(normalizeKey(name), {
name,
code: asString(a.code) || undefined,
- clinicalManifestation: clinical || undefined,
+ clinicalManifestation: clinical.length > 0 ? clinical : undefined,
pathology: pathology || undefined,
treatment: treatment || undefined,
});
@@ -241,13 +277,18 @@ export function ThreeBurnersDetailRenderer({
const activePatternData: PatternData | null = useMemo(() => {
if (isDirectLeafPattern) {
const name = asString(data.name) || content.title || "Three Burners Pattern";
+ const clinicalRaw =
+ data["clinical menifestation"] ??
+ data["clinical manifestation"] ??
+ data.clinical_manifestations ??
+ data.clinical_manifestation;
+
+ const clinical = parseBullets(clinicalRaw);
+
return {
name,
code: asString(data.code) || undefined,
- clinicalManifestation:
- asString(data["clinical menifestation"]) ||
- asString(data["clinical manifestation"]) ||
- asString(data.clinical_manifestations),
+ clinicalManifestation: clinical.length > 0 ? clinical : undefined,
pathology: asString(data.pathology) || undefined,
treatment: asString(data.treatment) || undefined,
};
@@ -296,7 +337,13 @@ export function ThreeBurnersDetailRenderer({
{/* 1. Clinical Manifestations Card */}
{activePatternData.clinicalManifestation ? (
-
+
) : null}
diff --git a/src/features/content/renderers/details/TwelveChannelsDetailRenderer.tsx b/src/features/content/renderers/details/TwelveChannelsDetailRenderer.tsx
index 06024b8..9f503ff 100644
--- a/src/features/content/renderers/details/TwelveChannelsDetailRenderer.tsx
+++ b/src/features/content/renderers/details/TwelveChannelsDetailRenderer.tsx
@@ -9,24 +9,40 @@ import { BackActionContext } from "../../context/BackActionContext";
import { Hero } from "../shared/Hero";
import { SectionCard } from "../shared/SectionCard";
import { Paragraphs } from "../shared/Paragraphs";
-import { asString } from "../helpers/value";
+import { BulletList } from "../shared/BulletList";
+import { asString, asStringArray } from "../helpers/value";
import { useContentSearchInfiniteQuery } from "../../hooks/use-content-search-infinite-query";
interface ConnectingChannelDetails {
- empty?: string;
- full?: string;
+ empty?: string[];
+ full?: string[];
}
interface ChannelData {
name: string;
code?: string;
- mainChannel?: string;
- connectingChannel?: ConnectingChannelDetails | string;
- muscleChannel?: string;
- greatConnectingChannelOfSpleen?: string;
+ mainChannel?: string[];
+ connectingChannel?: ConnectingChannelDetails | string[];
+ muscleChannel?: string[];
+ greatConnectingChannelOfSpleen?: string[];
}
-const FALLBACK_CHANNELS: ChannelData[] = [
+interface RawChannelData {
+ name: string;
+ code?: string;
+ mainChannel?: string | string[];
+ connectingChannel?:
+ | {
+ empty?: string | string[];
+ full?: string | string[];
+ }
+ | string
+ | string[];
+ muscleChannel?: string | string[];
+ greatConnectingChannelOfSpleen?: string | string[];
+}
+
+const FALLBACK_CHANNELS: RawChannelData[] = [
{
name: "Lungs",
code: "lungs",
@@ -217,23 +233,74 @@ function normalizeKey(str: string): string {
return str.toLowerCase().replace(/[^a-z0-9]/g, "");
}
-function parseConnectingChannel(val: unknown): ConnectingChannelDetails | string | undefined {
+function parseBullets(raw: unknown): string[] {
+ if (Array.isArray(raw)) {
+ return asStringArray(raw);
+ }
+ const text = asString(raw).trim();
+ if (!text) return [];
+
+ if (text.includes("\n")) {
+ return text
+ .split("\n")
+ .map((s) => s.replace(/^[•\-\*\d+\.]\s*/, "").trim())
+ .filter((s) => s.length > 0);
+ }
+
+ if (text.includes(";")) {
+ return text
+ .split(";")
+ .map((s) => s.trim().replace(/^and\s+/i, ""))
+ .filter((s) => s.length > 0);
+ }
+
+ const parts = text.split(/,\s*(?![^()]*\))/);
+ if (parts.length > 1) {
+ return parts
+ .map((s) => s.trim().replace(/\.$/, "").replace(/^and\s+/i, ""))
+ .filter((s) => s.length > 0);
+ }
+
+ return [text];
+}
+
+function parseConnectingChannel(val: unknown): ConnectingChannelDetails | string[] | undefined {
if (!val) return undefined;
- if (typeof val === "string") return val;
+ if (Array.isArray(val)) {
+ const arr = parseBullets(val);
+ return arr.length > 0 ? arr : undefined;
+ }
+ if (typeof val === "string") {
+ const bullets = parseBullets(val);
+ return bullets.length > 0 ? bullets : undefined;
+ }
if (typeof val === "object") {
const obj = val as Record;
- const empty = asString(obj.empty);
- const full = asString(obj.full);
- if (empty || full) {
+ const empty = parseBullets(obj.empty);
+ const full = parseBullets(obj.full);
+ if (empty.length > 0 || full.length > 0) {
return {
- empty: empty || undefined,
- full: full || undefined,
+ empty: empty.length > 0 ? empty : undefined,
+ full: full.length > 0 ? full : undefined,
};
}
}
return undefined;
}
+function toChannelData(raw: RawChannelData): ChannelData {
+ return {
+ name: raw.name,
+ code: raw.code,
+ mainChannel: raw.mainChannel ? parseBullets(raw.mainChannel) : undefined,
+ connectingChannel: parseConnectingChannel(raw.connectingChannel),
+ muscleChannel: raw.muscleChannel ? parseBullets(raw.muscleChannel) : undefined,
+ greatConnectingChannelOfSpleen: raw.greatConnectingChannelOfSpleen
+ ? parseBullets(raw.greatConnectingChannelOfSpleen)
+ : undefined,
+ };
+}
+
export function TwelveChannelsDetailRenderer({
content,
data,
@@ -259,9 +326,10 @@ export function TwelveChannelsDetailRenderer({
// 1. Seed fallback channels
for (const ch of FALLBACK_CHANNELS) {
- map.set(normalizeKey(ch.name), ch);
- if (ch.code) map.set(normalizeKey(ch.code), ch);
- list.push(ch);
+ const parsed = toChannelData(ch);
+ map.set(normalizeKey(parsed.name), parsed);
+ if (parsed.code) map.set(normalizeKey(parsed.code), parsed);
+ list.push(parsed);
}
// 2. Overlay live queried items if available
@@ -272,27 +340,29 @@ export function TwelveChannelsDetailRenderer({
const name = asString(a.name) || item.title;
if (!name) continue;
- const mainChannel = asString(a.main_channel);
+ const mainChannel = parseBullets(a.main_channel);
const connectingChannel = parseConnectingChannel(a.connecting_channel);
- const muscleChannel = asString(a.muscle_channel);
+ const muscleChannel = parseBullets(a.muscle_channel);
const greatConnecting = a.great_connecting_channel_of_the_spleen;
- let greatConnectingStr: string | undefined;
+ let greatConnectingBullets: string[] | undefined;
if (typeof greatConnecting === "object" && greatConnecting !== null) {
- greatConnectingStr = asString(
+ const g = parseBullets(
(greatConnecting as Record).clinical_manifestations,
);
- } else if (typeof greatConnecting === "string") {
- greatConnectingStr = greatConnecting;
+ if (g.length > 0) greatConnectingBullets = g;
+ } else if (greatConnecting) {
+ const g = parseBullets(greatConnecting);
+ if (g.length > 0) greatConnectingBullets = g;
}
const channelData: ChannelData = {
name,
code: asString(a.code) || item.slug,
- mainChannel: mainChannel || undefined,
+ mainChannel: mainChannel.length > 0 ? mainChannel : undefined,
connectingChannel,
- muscleChannel: muscleChannel || undefined,
- greatConnectingChannelOfSpleen: greatConnectingStr || undefined,
+ muscleChannel: muscleChannel.length > 0 ? muscleChannel : undefined,
+ greatConnectingChannelOfSpleen: greatConnectingBullets,
};
const key = normalizeKey(name);
@@ -324,23 +394,29 @@ export function TwelveChannelsDetailRenderer({
const activeChannelData: ChannelData | null = useMemo(() => {
if (isDirectLeafChannel) {
const name = asString(data.name) || content.title || "Twelve Channels";
+ const mainChannel = parseBullets(data.main_channel);
+ const connectingChannel = parseConnectingChannel(data.connecting_channel);
+ const muscleChannel = parseBullets(data.muscle_channel);
+
const greatConnecting = data.great_connecting_channel_of_the_spleen;
- let greatConnectingStr: string | undefined;
+ let greatConnectingBullets: string[] | undefined;
if (typeof greatConnecting === "object" && greatConnecting !== null) {
- greatConnectingStr = asString(
+ const g = parseBullets(
(greatConnecting as Record).clinical_manifestations,
);
- } else if (typeof greatConnecting === "string") {
- greatConnectingStr = greatConnecting;
+ if (g.length > 0) greatConnectingBullets = g;
+ } else if (greatConnecting) {
+ const g = parseBullets(greatConnecting);
+ if (g.length > 0) greatConnectingBullets = g;
}
return {
name,
code: asString(data.code) || undefined,
- mainChannel: asString(data.main_channel) || undefined,
- connectingChannel: parseConnectingChannel(data.connecting_channel),
- muscleChannel: asString(data.muscle_channel) || undefined,
- greatConnectingChannelOfSpleen: greatConnectingStr,
+ mainChannel: mainChannel.length > 0 ? mainChannel : undefined,
+ connectingChannel,
+ muscleChannel: muscleChannel.length > 0 ? muscleChannel : undefined,
+ greatConnectingChannelOfSpleen: greatConnectingBullets,
};
}
@@ -388,9 +464,9 @@ export function TwelveChannelsDetailRenderer({
{/* 1. Main Channel Card */}
- {activeChannelData.mainChannel ? (
+ {activeChannelData.mainChannel && activeChannelData.mainChannel.length > 0 ? (
-
+
) : null}
@@ -399,47 +475,46 @@ export function TwelveChannelsDetailRenderer({
{isConnectingObj ? (
- {(connecting as ConnectingChannelDetails).full ? (
+ {(connecting as ConnectingChannelDetails).full &&
+ (connecting as ConnectingChannelDetails).full!.length > 0 ? (
Full Condition
-
- {(connecting as ConnectingChannelDetails).full}
-
+
) : null}
- {(connecting as ConnectingChannelDetails).empty ? (
+ {(connecting as ConnectingChannelDetails).empty &&
+ (connecting as ConnectingChannelDetails).empty!.length > 0 ? (
Empty Condition
-
- {(connecting as ConnectingChannelDetails).empty}
-
+
) : null}
- ) : typeof connecting === "string" ? (
-
+ ) : Array.isArray(connecting) ? (
+
) : null}
) : null}
{/* 3. Muscle Channel Card */}
- {activeChannelData.muscleChannel ? (
+ {activeChannelData.muscleChannel && activeChannelData.muscleChannel.length > 0 ? (
-
+
) : null}
{/* 4. Great Connecting Channel of the Spleen (if present) */}
- {activeChannelData.greatConnectingChannelOfSpleen ? (
+ {activeChannelData.greatConnectingChannelOfSpleen &&
+ activeChannelData.greatConnectingChannelOfSpleen.length > 0 ? (
-
+
) : null}
diff --git a/src/features/content/renderers/shared/ContentValue.tsx b/src/features/content/renderers/shared/ContentValue.tsx
index 76cb9cf..dec7f53 100644
--- a/src/features/content/renderers/shared/ContentValue.tsx
+++ b/src/features/content/renderers/shared/ContentValue.tsx
@@ -13,6 +13,7 @@ import { Spacing } from "@/theme/spacing";
import { ContentLink } from "../../components/navigation/ContentLink";
import { parseNavigableContentReference } from "../../utils/content-reference";
import { humanizeKey } from "../helpers/value";
+import { BulletList } from "./BulletList";
export interface ContentValueProps {
value: unknown;
@@ -20,6 +21,28 @@ export interface ContentValueProps {
emptyText?: string | null;
}
+function parseBullets(text: string): string[] {
+ if (text.includes("\n")) {
+ return text
+ .split("\n")
+ .map((s) => s.replace(/^[•\-\*\d+\.]\s*/, "").trim())
+ .filter((s) => s.length > 0);
+ }
+ if (text.includes(";")) {
+ return text
+ .split(";")
+ .map((s) => s.trim().replace(/^and\s+/i, ""))
+ .filter((s) => s.length > 0);
+ }
+ const parts = text.split(/,\s*(?![^()]*\))/);
+ if (parts.length > 1) {
+ return parts
+ .map((s) => s.trim().replace(/\.$/, "").replace(/^and\s+/i, ""))
+ .filter((s) => s.length > 0);
+ }
+ return [text];
+}
+
/**
* Reference-aware fallback renderer for arbitrary nested attribute values.
*
@@ -54,6 +77,10 @@ export function ContentValue({
) : null;
}
+ if (visible.every((item) => typeof item === "string")) {
+ return ;
+ }
+
return (
{visible.map((item, index) => (
@@ -84,12 +111,32 @@ export function ContentValue({
return (
- {entries.map(([key, child]) => (
-
- {humanizeKey(key)}
-
-
- ))}
+ {entries.map(([key, child]) => {
+ const isClinical =
+ key.toLowerCase().includes("clinical") ||
+ key.toLowerCase().includes("manifestation");
+
+ const renderChild = () => {
+ if (
+ isClinical &&
+ typeof child === "string" &&
+ child.trim().length > 0
+ ) {
+ const bullets = parseBullets(child);
+ if (bullets.length > 1) {
+ return ;
+ }
+ }
+ return ;
+ };
+
+ return (
+
+ {humanizeKey(key)}
+ {renderChild()}
+
+ );
+ })}
);
}
diff --git a/src/features/content/renderers/shared/ImageGallery.tsx b/src/features/content/renderers/shared/ImageGallery.tsx
index 0f641de..35c5e33 100644
--- a/src/features/content/renderers/shared/ImageGallery.tsx
+++ b/src/features/content/renderers/shared/ImageGallery.tsx
@@ -11,7 +11,7 @@ export function ImageGallery({ images }: { images: Record[] })
const relationalMedia = useRelationalContentMedia();
if (relationalMedia.length > 0) {
- return ;
+ return ;
}
const visible = images.filter((item) => asString(item.image_path).trim().length > 0);
@@ -37,7 +37,7 @@ export function ImageGallery({ images }: { images: Record[] })
};
});
- return ;
+ return ;
}
const styles = StyleSheet.create({