From f8308c98ec777e76323127eda11c8af29a2608cd Mon Sep 17 00:00:00 2001 From: ShivaniKhaire Date: Fri, 4 Dec 2026 14:05:26 +0530 Subject: [PATCH 01/10] feat(m0001): reuse expandable category UI for xi-cleft with yin_yang badge and full point headings --- .../details/XiCleftDetailRenderer.tsx | 12 ++--- .../details/YuanSourceDetailRenderer.tsx | 54 +++++++++++++------ 2 files changed, 44 insertions(+), 22 deletions(-) diff --git a/src/features/content/renderers/details/XiCleftDetailRenderer.tsx b/src/features/content/renderers/details/XiCleftDetailRenderer.tsx index 9d7da6b..5e4fbd3 100644 --- a/src/features/content/renderers/details/XiCleftDetailRenderer.tsx +++ b/src/features/content/renderers/details/XiCleftDetailRenderer.tsx @@ -1,8 +1,8 @@ import React from "react"; -import { ScrollView } from "react-native"; import type { DetailRendererProps } from "../../types/renderer.types"; -import { ContentLinkAttributeSections } from "../shared/ContentLinkAttributeSections"; -import { asString } from "../helpers/value"; -import { Hero } from "../shared/Hero"; -import { DescriptionList, Images, ObjectArrayCards, ObjectArrayTable, ObjectCard, PointCodes, Strings } from "./categoryParts"; -export function XiCleftDetailRenderer({content,data,definitions,presentationAttributes}:DetailRendererProps){ return ; } +import { YuanSourceDetailRenderer } from "./YuanSourceDetailRenderer"; + +/** Renders Xi-Cleft category details using the shared Overview and expandable Points accordion layout. */ +export function XiCleftDetailRenderer(props: DetailRendererProps) { + return ; +} diff --git a/src/features/content/renderers/details/YuanSourceDetailRenderer.tsx b/src/features/content/renderers/details/YuanSourceDetailRenderer.tsx index 9201986..ee3f846 100644 --- a/src/features/content/renderers/details/YuanSourceDetailRenderer.tsx +++ b/src/features/content/renderers/details/YuanSourceDetailRenderer.tsx @@ -45,8 +45,13 @@ interface PointItemProps { pointsCatalogMap?: Map; } -function sanitizeMeridianHeading(meridian: string, chineseName: string): string { +function formatPointHeading( + meridian: string, + chineseName: string, + pointCode?: string, +): string { const cleanChinese = chineseName.replace(/^\((.*)\)$/, "$1").trim(); + const cleanCode = (pointCode || "").trim(); // Strip meridian abbreviation codes or point codes in parentheses, // e.g. (ST), (LU-9), (LI), (LV), (LR), (PC), (GB), (HT), etc. @@ -55,14 +60,24 @@ function sanitizeMeridianHeading(meridian: string, chineseName: string): string .replace(/\s+/g, " ") .trim(); - if (cleanedMeridian && cleanChinese) { - if (cleanedMeridian.toLowerCase().includes(cleanChinese.toLowerCase())) { - return cleanedMeridian; - } - return `${cleanedMeridian} (${cleanChinese})`; + const parts: string[] = []; + if (cleanedMeridian) { + parts.push(cleanedMeridian); + } + if ( + cleanCode && + !cleanedMeridian.toLowerCase().includes(cleanCode.toLowerCase()) + ) { + parts.push(cleanCode); + } + if ( + cleanChinese && + !cleanedMeridian.toLowerCase().includes(cleanChinese.toLowerCase()) + ) { + parts.push(`(${cleanChinese})`); } - return cleanedMeridian || cleanChinese || "Point"; + return parts.join(" ") || "Point"; } function PointAccordionCard({ @@ -77,18 +92,14 @@ function PointAccordionCard({ const meridian = asString(item.meridian).trim(); const chineseName = asString(item.chinese_name).trim(); const element = asString(item.element).trim(); + const yinYang = asString(item.yin_yang).trim(); const caution = asString(item.caution).trim(); const cautionList = asStringArray(item.caution); const actions = asStringArray(item.actions); const indications = asStringArray(item.indications); - // Format header title: e.g. "Stomach (Chongyang)", "Lung (Taiyuan)" - const title = useMemo(() => { - return sanitizeMeridianHeading(meridian, chineseName); - }, [meridian, chineseName]); - - // Resolve point reference for linkable button + // Resolve point reference for linkable button and heading label const rawPoint = asRecord(item.point); const directRef = parseNavigableContentReference(item.point); @@ -101,6 +112,11 @@ function PointAccordionCard({ : "") || ""; + // Format header title: e.g. "Lung LU 9 (Taiyuan)" + const title = useMemo(() => { + return formatPointHeading(meridian, chineseName, pointLabel); + }, [meridian, chineseName, pointLabel]); + // Construct button display label: e.g. "LU-9 (Taiyuan)" or "LU 9 (Taiyuan)" const pointButtonLabel = useMemo(() => { const baseCode = pointLabel || "Point Details"; @@ -190,6 +206,11 @@ function PointAccordionCard({ {element} ) : null} + {yinYang ? ( + + {yinYang} + + ) : null} state.accordionDefaultExpanded, ); @@ -298,7 +320,7 @@ export function YuanSourceDetailRenderer({ }, [pointsCatalog]); const rawTitle = - asString(data.title) || asString(data.name) || content.title || "Yuan Source"; + asString(data.title) || asString(data.name) || content.title || fallbackTitle; const altNames = asStringArray(data.alt_name); const descriptionParagraphs = asStringArray(data.description); const points = asRecordArray(data.points); @@ -345,7 +367,7 @@ export function YuanSourceDetailRenderer({ data={data} definitions={definitions} presentationAttributes={presentationAttributes} - excludeAttributeKeys={["points", "m0001_ct0009.points"]} + excludeAttributeKeys={["points", "m0001_ct0009.points", "m0001_ct0011.points"]} /> ); -- 2.34.1 From 5c6180b6b04ce67702e2faa6f589620bafa0ccc5 Mon Sep 17 00:00:00 2001 From: ShivaniKhaire Date: Fri, 4 Dec 2026 14:44:19 +0530 Subject: [PATCH 02/10] feat(m0001): add bulleted Overview variant with bold prefixes for point category renderers --- .../details/YuanSourceDetailRenderer.tsx | 1 + .../content/renderers/shared/BulletList.tsx | 55 ++++++++++++++++-- .../content/renderers/shared/OverviewCard.tsx | 57 +++++++++++++------ 3 files changed, 92 insertions(+), 21 deletions(-) diff --git a/src/features/content/renderers/details/YuanSourceDetailRenderer.tsx b/src/features/content/renderers/details/YuanSourceDetailRenderer.tsx index ee3f846..cde6065 100644 --- a/src/features/content/renderers/details/YuanSourceDetailRenderer.tsx +++ b/src/features/content/renderers/details/YuanSourceDetailRenderer.tsx @@ -343,6 +343,7 @@ export function YuanSourceDetailRenderer({ {descriptionParagraphs.length > 0 ? ( ) : null} diff --git a/src/features/content/renderers/shared/BulletList.tsx b/src/features/content/renderers/shared/BulletList.tsx index f8b35a9..4233d75 100644 --- a/src/features/content/renderers/shared/BulletList.tsx +++ b/src/features/content/renderers/shared/BulletList.tsx @@ -1,16 +1,60 @@ import React from "react"; -import { StyleSheet, Text, View } from "react-native"; +import { + StyleProp, + StyleSheet, + Text, + TextStyle, + View, + ViewStyle, +} from "react-native"; import { Colors } from "@/theme"; -export function BulletList({ items }: { items: string[] }) { +export interface BulletListProps { + items: string[]; + listStyle?: StyleProp; + dotStyle?: StyleProp; + textStyle?: StyleProp; + boldColonPrefix?: boolean; +} + +const COLON_PREFIX_RE = /^([A-Za-z][A-Za-z0-9 &/().-]{1,32}:)([\s\S]*)$/; + +function renderBulletText( + item: string, + textStyle?: StyleProp, + boldColonPrefix?: boolean, +) { + if (!boldColonPrefix) { + return {item}; + } + const match = COLON_PREFIX_RE.exec(item); + if (!match) { + return {item}; + } + return ( + + {match[1]} + {match[2]} + + ); +} + +/** Renders a bulleted list with optional custom typography and bold label prefixes. */ +export function BulletList({ + items, + listStyle, + dotStyle, + textStyle, + boldColonPrefix = false, +}: BulletListProps) { if (!items.length) return null; return ( - + {items.map((item, index) => ( - - {item} + + {renderBulletText(item, textStyle, boldColonPrefix)} ))} @@ -28,4 +72,5 @@ const styles = StyleSheet.create({ backgroundColor: Colors.primary, }, text: { flex: 1, fontSize: 16, lineHeight: 25, color: "#334155" }, + prefix: { fontWeight: "700", color: Colors.textPrimary }, }); diff --git a/src/features/content/renderers/shared/OverviewCard.tsx b/src/features/content/renderers/shared/OverviewCard.tsx index 8b89cfb..2fcc474 100644 --- a/src/features/content/renderers/shared/OverviewCard.tsx +++ b/src/features/content/renderers/shared/OverviewCard.tsx @@ -11,6 +11,7 @@ import { Ionicons } from "@expo/vector-icons"; import { moderateScale, verticalScale } from "react-native-size-matters"; import { Colors } from "@/theme"; +import { BulletList } from "./BulletList"; export interface OverviewCardProps { title?: string; @@ -19,6 +20,8 @@ export interface OverviewCardProps { iconSize?: number; text?: string | null; paragraphs?: Array; + variant?: "paragraphs" | "bullets"; + boldBulletPrefix?: boolean; children?: React.ReactNode; style?: StyleProp; titleStyle?: StyleProp; @@ -32,14 +35,16 @@ export function OverviewCard({ iconSize = moderateScale(20), text, paragraphs, + variant = "paragraphs", + boldBulletPrefix = true, children, style, titleStyle, textStyle, }: OverviewCardProps) { - const filteredParagraphs = paragraphs?.filter( - (p): p is string => typeof p === "string" && p.trim().length > 0, - ); + const filteredParagraphs = paragraphs + ?.filter((p): p is string => typeof p === "string" && p.trim().length > 0) + .map((p) => p.replace(/\n[ \t]+/g, "\n").trim()); const hasText = typeof text === "string" && text.trim().length > 0; const hasParagraphs = @@ -62,19 +67,27 @@ export function OverviewCard({ {text} ) : null} - {hasParagraphs - ? filteredParagraphs.map((para, index) => ( - - {para} - - )) - : null} + {hasParagraphs && variant === "bullets" ? ( + + ) : hasParagraphs ? ( + filteredParagraphs.map((para, index) => ( + + {para} + + )) + ) : null} {children} @@ -111,5 +124,17 @@ const styles = StyleSheet.create({ color: Colors.textSecondary, marginTop: verticalScale(8), }, + paragraphSpacing: { + marginTop: verticalScale(8), + }, + bulletList: { + gap: verticalScale(7), + }, + bulletDot: { + width: moderateScale(5), + height: moderateScale(5), + borderRadius: moderateScale(2.5), + marginTop: moderateScale(7.5), + }, }); -- 2.34.1 From 40d9feb869bc93467fd7ed19f5f17b4956d7ce64 Mon Sep 17 00:00:00 2001 From: ShivaniKhaire Date: Sat, 5 Dec 2026 11:34:20 +0530 Subject: [PATCH 03/10] refactor(m0001): extract shared point category accordion and overview helpers --- .../renderers/details/pointCategoryShared.tsx | 422 ++++++++++++++++++ 1 file changed, 422 insertions(+) create mode 100644 src/features/content/renderers/details/pointCategoryShared.tsx diff --git a/src/features/content/renderers/details/pointCategoryShared.tsx b/src/features/content/renderers/details/pointCategoryShared.tsx new file mode 100644 index 0000000..60e6e41 --- /dev/null +++ b/src/features/content/renderers/details/pointCategoryShared.tsx @@ -0,0 +1,422 @@ +import React, { useMemo, useState } from "react"; +import { + LayoutAnimation, + Platform, + Pressable, + StyleSheet, + Text, + UIManager, + View, +} from "react-native"; +import { Ionicons } from "@expo/vector-icons"; +import { useRouter } from "expo-router"; +import { moderateScale, verticalScale } from "react-native-size-matters"; + +import { Colors, Radius } from "@/theme"; +import { useModuleTemplateContentDetailsQuery } from "../../hooks/use-content-queries"; +import { + buildContentReferenceRoute, + parseNavigableContentReference, +} from "../../utils/content-reference"; +import { asRecord, asString, asStringArray } from "../helpers/value"; + +if ( + Platform.OS === "android" && + UIManager.setLayoutAnimationEnabledExperimental +) { + UIManager.setLayoutAnimationEnabledExperimental(true); +} + +export type PointsCatalogMap = Map< + string, + { contentId: string; title: string } +>; + +/** Loads m0001_ct0003 points catalog for fallback navigation by point code or name. */ +export function usePointsCatalogMap(moduleCode = "m0001"): PointsCatalogMap { + const { data: pointsCatalog } = useModuleTemplateContentDetailsQuery({ + module_code: moduleCode || "m0001", + template_code: "m0001_ct0003", + }); + + return useMemo(() => { + const map = new Map(); + if (pointsCatalog?.items) { + for (const item of pointsCatalog.items) { + const id = item.content.id; + const title = item.content.title; + const code = asString(item.data.code).trim().toLowerCase(); + const name = asString(item.data.name).trim().toLowerCase(); + if (code) { + map.set(code, { contentId: id, title }); + map.set(code.replace(/[- ]/g, ""), { contentId: id, title }); + } + if (name) { + map.set(name, { contentId: id, title }); + } + } + } + return map; + }, [pointsCatalog]); +} + +/** Extracts display label from a point content_ref or raw target payload. */ +export function extractPointRefLabel(rawValue: unknown): string { + const directRef = parseNavigableContentReference(rawValue); + if (directRef?.label?.trim()) { + return directRef.label.trim(); + } + const rawPoint = asRecord(rawValue); + const label = asString(rawPoint.label).trim(); + if (label) return label; + if (rawPoint.target && typeof rawPoint.target === "object") { + return asString((rawPoint.target as Record).source_code).trim(); + } + return ""; +} + +/** Navigates to the canonical acupuncture point detail route from a content_ref payload. */ +export function navigateToPointRef( + router: ReturnType, + rawValue: unknown, + moduleCode: string, + pointsCatalogMap?: PointsCatalogMap, +): void { + const directRef = parseNavigableContentReference(rawValue); + if (directRef) { + router.push(buildContentReferenceRoute(directRef) as never); + return; + } + + const rawPoint = asRecord(rawValue); + const pointLabel = extractPointRefLabel(rawValue); + + if (rawPoint.target && typeof rawPoint.target === "object") { + const target = rawPoint.target as Record; + const targetModule = + asString(target.module_code).trim() || moduleCode || "m0001"; + const targetTemplate = + asString(target.template_code).trim() || "m0001_ct0003"; + const contentId = asString(target.content_id).trim(); + const sourceCode = asString(target.source_code).trim(); + + if (contentId) { + router.push( + `/modules/${encodeURIComponent(targetModule)}/${encodeURIComponent(targetTemplate)}/${encodeURIComponent(contentId)}` as never, + ); + return; + } + + if (pointsCatalogMap && sourceCode) { + const found = + pointsCatalogMap.get(sourceCode.toLowerCase()) || + pointsCatalogMap.get(sourceCode.replace(/[- ]/g, "").toLowerCase()); + if (found) { + router.push( + `/modules/${encodeURIComponent(targetModule)}/${encodeURIComponent(targetTemplate)}/${encodeURIComponent(found.contentId)}` as never, + ); + return; + } + } + } + + if (pointsCatalogMap && pointLabel) { + const found = + pointsCatalogMap.get(pointLabel.toLowerCase()) || + pointsCatalogMap.get(pointLabel.replace(/[- ]/g, "").toLowerCase()); + if (found) { + router.push( + `/modules/${encodeURIComponent(moduleCode || "m0001")}/m0001_ct0003/${encodeURIComponent(found.contentId)}` as never, + ); + } + } +} + +function formatGeneralInfoKey(key: string): string { + const trimmed = key.trim(); + if (trimmed === "Yin_vs_Yang") return "Yin vs. Yang"; + if (trimmed === "Yuan_vs_Luo") return "Yuan vs. Luo"; + return trimmed.replace(/_/g, " "); +} + +function formatGeneralInfoSubLines( + value: unknown, + indent = "", + lines: string[] = [], +): string[] { + if (typeof value === "string") { + const text = value.trim(); + if (text) lines.push(text); + return lines; + } + const obj = asRecord(value); + const entries = Object.entries(obj); + entries.forEach(([k, v], idx) => { + const label = formatGeneralInfoKey(k); + if (typeof v === "string") { + const text = v.trim(); + if (text) { + lines.push(`${indent}${idx + 1}. ${label}: ${text}`); + } + } else if (v && typeof v === "object") { + lines.push(`${indent}${label}:`); + formatGeneralInfoSubLines(v, `${indent} `, lines); + } + }); + return lines; +} + +/** Merges description strings and structured general_information into Overview bullet items. */ +export function buildCategoryOverviewParagraphs( + data: Record, +): string[] { + const paragraphs = [...asStringArray(data.description)]; + const generalInfo = asRecord(data.general_information); + + for (const [key, value] of Object.entries(generalInfo)) { + const label = formatGeneralInfoKey(key); + if (typeof value === "string") { + const text = value.trim(); + if (text) { + paragraphs.push(`${label}: ${text}`); + } + } else if (value && typeof value === "object") { + const subLines = formatGeneralInfoSubLines(value); + if (subLines.length > 0) { + paragraphs.push(`${label}:\n${subLines.join("\n")}`); + } + } + } + + return paragraphs; +} + +/** Renders a pill-style navigable chip linking to an acupuncture point detail screen. */ +export function PointLinkChip({ + label, + accessibilityLabel, + onPress, +}: { + label: string; + accessibilityLabel?: string; + onPress: () => void; +}) { + return ( + [ + pointCategoryStyles.pointLinkButton, + pressed && pointCategoryStyles.pressed, + ]} + > + {label} + + + ); +} + +/** Reusable expandable accordion card wrapper matching category detail styling. */ +export function PointCategoryAccordionCard({ + title, + badges = [], + defaultExpanded, + children, +}: { + title: string; + badges?: string[]; + defaultExpanded: boolean; + children: React.ReactNode; +}) { + const [expanded, setExpanded] = useState(defaultExpanded); + + const toggle = () => { + LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut); + setExpanded((prev) => !prev); + }; + + return ( + + [ + pointCategoryStyles.cardHeader, + expanded && pointCategoryStyles.cardHeaderExpanded, + pressed && pointCategoryStyles.pressed, + ]} + > + + + + {title} + + + + + {badges + .filter((b) => b.trim().length > 0) + .map((badge, index) => ( + + {badge} + + ))} + + + + + + + {expanded ? ( + {children} + ) : null} + + ); +} + +export const pointCategoryStyles = StyleSheet.create({ + container: { + paddingHorizontal: moderateScale(16), + paddingTop: verticalScale(14), + paddingBottom: verticalScale(40), + gap: verticalScale(14), + }, + cardsList: { + gap: verticalScale(12), + }, + card: { + backgroundColor: "#FFFFFF", + borderRadius: moderateScale(16), + borderWidth: 1, + borderColor: "#E2E8F0", + overflow: "hidden", + }, + cardHeader: { + minHeight: verticalScale(54), + paddingHorizontal: moderateScale(14), + paddingVertical: verticalScale(12), + flexDirection: "row", + alignItems: "center", + justifyContent: "space-between", + backgroundColor: "#FFFFFF", + gap: moderateScale(10), + }, + cardHeaderExpanded: { + backgroundColor: "#F0F7F3", + borderBottomWidth: 1, + borderBottomColor: "#E2E8F0", + }, + pressed: { + opacity: 0.75, + }, + headerLeft: { + flex: 1, + flexDirection: "row", + alignItems: "center", + gap: moderateScale(10), + }, + headerAccent: { + width: moderateScale(4), + height: verticalScale(22), + borderRadius: moderateScale(2), + backgroundColor: Colors.primary, + }, + headerTitle: { + flex: 1, + fontSize: moderateScale(15), + lineHeight: moderateScale(21), + fontWeight: "700", + color: "#1E293B", + }, + headerRight: { + flexDirection: "row", + alignItems: "center", + gap: moderateScale(8), + }, + badge: { + paddingHorizontal: moderateScale(9), + paddingVertical: verticalScale(3), + borderRadius: moderateScale(10), + backgroundColor: "#E8F5E9", + borderWidth: 1, + borderColor: "#C6E4CE", + }, + badgeText: { + fontSize: 11, + lineHeight: 16, + fontWeight: "600", + color: "#285A44", + }, + chevron: { + width: moderateScale(28), + height: moderateScale(28), + borderRadius: moderateScale(14), + backgroundColor: "#FFFFFFB8", + alignItems: "center", + justifyContent: "center", + borderWidth: 1, + borderColor: "#E2E8F0", + }, + cardBody: { + paddingHorizontal: moderateScale(16), + paddingTop: verticalScale(14), + paddingBottom: verticalScale(16), + gap: verticalScale(12), + backgroundColor: "#FFFFFF", + }, + sectionRow: { + gap: verticalScale(6), + paddingBottom: verticalScale(10), + borderBottomWidth: StyleSheet.hairlineWidth, + borderBottomColor: "#E8ECEF", + }, + sectionLabel: { + fontSize: 12, + lineHeight: 17, + fontWeight: "700", + color: "#597064", + letterSpacing: 0.15, + }, + sectionValue: { + fontSize: 16, + lineHeight: 25, + color: "#334155", + }, + pointLinksRow: { + flexDirection: "row", + flexWrap: "wrap", + gap: moderateScale(8), + marginTop: verticalScale(4), + }, + pointLinkButton: { + alignSelf: "flex-start", + minHeight: verticalScale(34), + paddingHorizontal: moderateScale(12), + paddingVertical: verticalScale(6), + borderRadius: Radius.full, + backgroundColor: "#E8F5E9", + borderWidth: 1, + borderColor: "#CDE5D0", + flexDirection: "row", + alignItems: "center", + gap: moderateScale(6), + }, + pointLinkLabel: { + fontSize: moderateScale(13), + lineHeight: moderateScale(18), + fontWeight: "700", + color: Colors.primaryDark, + }, +}); + -- 2.34.1 From 09f0fae67df121717b2c42a62a51e274547b249b Mon Sep 17 00:00:00 2001 From: ShivaniKhaire Date: Sat, 5 Dec 2026 11:34:20 +0530 Subject: [PATCH 04/10] feat(m0001): support general_information, organ/category headings, and connection badges --- .../details/YuanSourceDetailRenderer.tsx | 485 ++++-------------- 1 file changed, 100 insertions(+), 385 deletions(-) diff --git a/src/features/content/renderers/details/YuanSourceDetailRenderer.tsx b/src/features/content/renderers/details/YuanSourceDetailRenderer.tsx index cde6065..7143549 100644 --- a/src/features/content/renderers/details/YuanSourceDetailRenderer.tsx +++ b/src/features/content/renderers/details/YuanSourceDetailRenderer.tsx @@ -1,80 +1,63 @@ -import React, { useMemo, useState } from "react"; -import { - LayoutAnimation, - Platform, - Pressable, - ScrollView, - StyleSheet, - Text, - UIManager, - View, -} from "react-native"; -import { Ionicons } from "@expo/vector-icons"; +import React, { useMemo } from "react"; +import { ScrollView, Text, View } from "react-native"; import { useRouter } from "expo-router"; -import { moderateScale, verticalScale } from "react-native-size-matters"; -import { Colors, Radius } from "@/theme"; import { useSettingsStore } from "@/store/settings.store"; import type { DetailRendererProps } from "../../types/renderer.types"; -import { useModuleTemplateContentDetailsQuery } from "../../hooks/use-content-queries"; -import { - buildContentReferenceRoute, - parseNavigableContentReference, -} from "../../utils/content-reference"; -import { - asRecord, - asRecordArray, - asString, - asStringArray, -} from "../helpers/value"; +import { asRecordArray, asString, asStringArray } from "../helpers/value"; import { BulletList } from "../shared/BulletList"; import { ContentLinkAttributeSections } from "../shared/ContentLinkAttributeSections"; import { Hero } from "../shared/Hero"; import { OverviewCard } from "../shared/OverviewCard"; import { Images } from "./categoryParts"; - -if (Platform.OS === "android" && UIManager.setLayoutAnimationEnabledExperimental) { - UIManager.setLayoutAnimationEnabledExperimental(true); -} +import { + buildCategoryOverviewParagraphs, + extractPointRefLabel, + navigateToPointRef, + PointCategoryAccordionCard, + pointCategoryStyles, + PointLinkChip, + type PointsCatalogMap, + usePointsCatalogMap, +} from "./pointCategoryShared"; interface PointItemProps { key?: React.Key; item: Record; defaultExpanded: boolean; moduleCode: string; - pointsCatalogMap?: Map; + pointsCatalogMap?: PointsCatalogMap; } function formatPointHeading( - meridian: string, - chineseName: string, + primaryLabel: string, + pointName: string, pointCode?: string, ): string { - const cleanChinese = chineseName.replace(/^\((.*)\)$/, "$1").trim(); + const cleanName = pointName.replace(/^\((.*)\)$/, "$1").trim(); const cleanCode = (pointCode || "").trim(); - // Strip meridian abbreviation codes or point codes in parentheses, - // e.g. (ST), (LU-9), (LI), (LV), (LR), (PC), (GB), (HT), etc. - const cleanedMeridian = meridian + // Strip meridian abbreviation codes or point codes in parentheses. + const cleanedPrimary = primaryLabel .replace(/\s*\(\s*[A-Z]{1,4}(?:[\s\-_]*\d+)?\s*\)\s*/g, " ") .replace(/\s+/g, " ") .trim(); const parts: string[] = []; - if (cleanedMeridian) { - parts.push(cleanedMeridian); + if (cleanedPrimary) { + parts.push(cleanedPrimary); } if ( cleanCode && - !cleanedMeridian.toLowerCase().includes(cleanCode.toLowerCase()) + !cleanedPrimary.toLowerCase().includes(cleanCode.toLowerCase()) ) { parts.push(cleanCode); } if ( - cleanChinese && - !cleanedMeridian.toLowerCase().includes(cleanChinese.toLowerCase()) + cleanName && + !cleanedPrimary.toLowerCase().includes(cleanName.toLowerCase()) ) { - parts.push(`(${cleanChinese})`); + parts.push(`(${cleanName})`); } return parts.join(" ") || "Point"; @@ -87,200 +70,88 @@ function PointAccordionCard({ pointsCatalogMap, }: PointItemProps) { const router = useRouter(); - const [expanded, setExpanded] = useState(defaultExpanded); - const meridian = asString(item.meridian).trim(); - const chineseName = asString(item.chinese_name).trim(); + const primaryLabel = + asString(item.meridian).trim() || + asString(item.organ).trim() || + asString(item.category).trim(); + const pointName = + asString(item.chinese_name).trim() || asString(item.pinyin_name).trim(); const element = asString(item.element).trim(); const yinYang = asString(item.yin_yang).trim(); + const connection = asString(item.connection).trim(); const caution = asString(item.caution).trim(); const cautionList = asStringArray(item.caution); - const actions = asStringArray(item.actions); const indications = asStringArray(item.indications); - // Resolve point reference for linkable button and heading label - const rawPoint = asRecord(item.point); - const directRef = parseNavigableContentReference(item.point); + const pointLabel = extractPointRefLabel(item.point); - // Extract candidate point codes/labels: e.g. "LU 9", "LU-9" - const pointLabel = - directRef?.label?.trim() || - asString(rawPoint.label).trim() || - (rawPoint.target && typeof rawPoint.target === "object" - ? asString((rawPoint.target as Record).source_code).trim() - : "") || - ""; + const title = useMemo( + () => formatPointHeading(primaryLabel, pointName, pointLabel), + [primaryLabel, pointName, pointLabel], + ); - // Format header title: e.g. "Lung LU 9 (Taiyuan)" - const title = useMemo(() => { - return formatPointHeading(meridian, chineseName, pointLabel); - }, [meridian, chineseName, pointLabel]); - - // Construct button display label: e.g. "LU-9 (Taiyuan)" or "LU 9 (Taiyuan)" const pointButtonLabel = useMemo(() => { const baseCode = pointLabel || "Point Details"; - if (chineseName && !baseCode.toLowerCase().includes(chineseName.toLowerCase())) { - return `${baseCode} (${chineseName})`; + if (pointName && !baseCode.toLowerCase().includes(pointName.toLowerCase())) { + return `${baseCode} (${pointName})`; } return baseCode; - }, [pointLabel, chineseName]); + }, [pointLabel, pointName]); - // Resolve navigation destination - const navigateToPoint = () => { - if (directRef) { - router.push(buildContentReferenceRoute(directRef) as never); - return; - } - - if (rawPoint.target && typeof rawPoint.target === "object") { - const target = rawPoint.target as Record; - const targetModule = asString(target.module_code).trim() || moduleCode || "m0001"; - const targetTemplate = asString(target.template_code).trim() || "m0001_ct0003"; - const contentId = asString(target.content_id).trim(); - const sourceCode = asString(target.source_code).trim(); - - if (contentId) { - router.push( - `/modules/${encodeURIComponent(targetModule)}/${encodeURIComponent(targetTemplate)}/${encodeURIComponent(contentId)}` as never, - ); - return; - } - - // Fallback: match by catalog map (from m0001_ct0003) using sourceCode or label - if (pointsCatalogMap && sourceCode) { - const found = - pointsCatalogMap.get(sourceCode.toLowerCase()) || - pointsCatalogMap.get(sourceCode.replace(/[- ]/g, "").toLowerCase()); - if (found) { - router.push( - `/modules/${encodeURIComponent(targetModule)}/${encodeURIComponent(targetTemplate)}/${encodeURIComponent(found.contentId)}` as never, - ); - return; - } - } - } - - // Secondary fallback matching by pointLabel in catalog - if (pointsCatalogMap && pointLabel) { - const found = - pointsCatalogMap.get(pointLabel.toLowerCase()) || - pointsCatalogMap.get(pointLabel.replace(/[- ]/g, "").toLowerCase()); - if (found) { - router.push( - `/modules/${encodeURIComponent(moduleCode || "m0001")}/m0001_ct0003/${encodeURIComponent(found.contentId)}` as never, - ); - } - } - }; - - const toggle = () => { - LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut); - setExpanded((prev) => !prev); - }; + const badges = [element, yinYang, connection].filter(Boolean); return ( - - {/* Accordion Header */} - [ - styles.cardHeader, - expanded && styles.cardHeaderExpanded, - pressed && styles.pressed, - ]} - > - - - - {title} - - - - - {element ? ( - - {element} - - ) : null} - {yinYang ? ( - - {yinYang} - - ) : null} - - - - - - - {/* Accordion Body (Expanded State) */} - {expanded ? ( - - {/* Actions */} - {actions.length > 0 ? ( - - ACTIONS - {actions.length === 1 ? ( - {actions[0]} - ) : ( - - )} - - ) : null} - - {/* Indications */} - {indications.length > 0 ? ( - - INDICATIONS - - - ) : null} - - {/* Caution (same UI as Actions and Indications) */} - {caution ? ( - - CAUTION - {cautionList.length > 1 ? ( - - ) : ( - {caution} - )} - - ) : null} - - {/* Linkable Point Button (matching standard ReferenceChipList styling) */} - {pointLabel ? ( - [ - styles.pointLinkButton, - pressed && styles.pressed, - ]} - > - {pointButtonLabel} - - - ) : null} + + {actions.length > 0 ? ( + + ACTIONS + {actions.length === 1 ? ( + {actions[0]} + ) : ( + + )} ) : null} - + + {indications.length > 0 ? ( + + INDICATIONS + + + ) : null} + + {caution ? ( + + CAUTION + {cautionList.length > 1 ? ( + + ) : ( + {caution} + )} + + ) : null} + + {pointLabel ? ( + + + navigateToPointRef(router, item.point, moduleCode, pointsCatalogMap) + } + /> + + ) : null} + ); } +/** Shared category detail renderer supporting Yuan-Source, Xi-Cleft, Luo, Back-Shu, Front-Mu, and Influential points. */ export function YuanSourceDetailRenderer({ moduleCode = "m0001", content, @@ -292,65 +163,40 @@ export function YuanSourceDetailRenderer({ const accordionDefaultExpanded = useSettingsStore( (state) => state.accordionDefaultExpanded, ); - - // Fetch points from m0001_ct0003 for robust ID navigation fallback - const { data: pointsCatalog } = useModuleTemplateContentDetailsQuery({ - module_code: moduleCode || "m0001", - template_code: "m0001_ct0003", - }); - - const pointsCatalogMap = useMemo(() => { - const map = new Map(); - if (pointsCatalog?.items) { - for (const item of pointsCatalog.items) { - const id = item.content.id; - const title = item.content.title; - const code = asString(item.data.code).trim().toLowerCase(); - const name = asString(item.data.name).trim().toLowerCase(); - if (code) { - map.set(code, { contentId: id, title }); - map.set(code.replace(/[- ]/g, ""), { contentId: id, title }); - } - if (name) { - map.set(name, { contentId: id, title }); - } - } - } - return map; - }, [pointsCatalog]); + const pointsCatalogMap = usePointsCatalogMap(moduleCode); const rawTitle = asString(data.title) || asString(data.name) || content.title || fallbackTitle; const altNames = asStringArray(data.alt_name); - const descriptionParagraphs = asStringArray(data.description); + const alias = asString(data.alias).trim(); + const subtitle = + altNames.length > 0 ? altNames.join(" · ") : alias || undefined; + + const overviewParagraphs = useMemo( + () => buildCategoryOverviewParagraphs(data), + [data], + ); const points = asRecordArray(data.points); return ( - {/* Screen Title & Subtitle */} - 0 ? altNames.join(" · ") : undefined} - /> + - {/* Visual images (if any assigned) */} - {/* Overview Section */} - {descriptionParagraphs.length > 0 ? ( + {overviewParagraphs.length > 0 ? ( ) : null} - {/* Points Accordion List */} {points.length > 0 ? ( - + {points.map((pointItem, index) => ( ) : null} - {/* Generic content link attributes (excluding points already rendered above) */} ); } - -const styles = StyleSheet.create({ - container: { - paddingHorizontal: moderateScale(16), - paddingTop: verticalScale(14), - paddingBottom: verticalScale(40), - gap: verticalScale(14), - }, - pointsList: { - gap: verticalScale(12), - }, - card: { - backgroundColor: "#FFFFFF", - borderRadius: moderateScale(16), - borderWidth: 1, - borderColor: "#E2E8F0", - overflow: "hidden", - }, - cardHeader: { - minHeight: verticalScale(54), - paddingHorizontal: moderateScale(14), - paddingVertical: verticalScale(12), - flexDirection: "row", - alignItems: "center", - justifyContent: "space-between", - backgroundColor: "#FFFFFF", - gap: moderateScale(10), - }, - cardHeaderExpanded: { - backgroundColor: "#F0F7F3", - borderBottomWidth: 1, - borderBottomColor: "#E2E8F0", - }, - pressed: { - opacity: 0.75, - }, - headerLeft: { - flex: 1, - flexDirection: "row", - alignItems: "center", - gap: moderateScale(10), - }, - headerAccent: { - width: moderateScale(4), - height: verticalScale(22), - borderRadius: moderateScale(2), - backgroundColor: Colors.primary, - }, - headerTitle: { - flex: 1, - fontSize: moderateScale(15), - lineHeight: moderateScale(21), - fontWeight: "700", - color: "#1E293B", - }, - headerRight: { - flexDirection: "row", - alignItems: "center", - gap: moderateScale(8), - }, - elementBadge: { - paddingHorizontal: moderateScale(9), - paddingVertical: verticalScale(3), - borderRadius: moderateScale(10), - backgroundColor: "#E8F5E9", - borderWidth: 1, - borderColor: "#C6E4CE", - }, - elementBadgeText: { - fontSize: 11, - lineHeight: 16, - fontWeight: "600", - color: "#285A44", - }, - chevron: { - width: moderateScale(28), - height: moderateScale(28), - borderRadius: moderateScale(14), - backgroundColor: "#FFFFFFB8", - alignItems: "center", - justifyContent: "center", - borderWidth: 1, - borderColor: "#E2E8F0", - }, - cardBody: { - paddingHorizontal: moderateScale(16), - paddingTop: verticalScale(14), - paddingBottom: verticalScale(16), - gap: verticalScale(12), - backgroundColor: "#FFFFFF", - }, - sectionRow: { - gap: verticalScale(6), - paddingBottom: verticalScale(10), - borderBottomWidth: StyleSheet.hairlineWidth, - borderBottomColor: "#E8ECEF", - }, - sectionLabel: { - fontSize: 12, - lineHeight: 17, - fontWeight: "700", - color: "#597064", - letterSpacing: 0.15, - }, - sectionValue: { - fontSize: 16, - lineHeight: 25, - color: "#334155", - }, - pointLinkButton: { - alignSelf: "flex-start", - minHeight: verticalScale(34), - paddingHorizontal: moderateScale(12), - paddingVertical: verticalScale(6), - borderRadius: Radius.full, - backgroundColor: "#E8F5E9", - borderWidth: 1, - borderColor: "#CDE5D0", - flexDirection: "row", - alignItems: "center", - gap: moderateScale(6), - marginTop: verticalScale(6), - }, - pointLinkLabel: { - fontSize: moderateScale(13), - lineHeight: moderateScale(18), - fontWeight: "700", - color: Colors.primaryDark, - }, -}); -- 2.34.1 From db460fecca286e2bc5bed7e0474c4f3b82374a4e Mon Sep 17 00:00:00 2001 From: ShivaniKhaire Date: Sat, 5 Dec 2026 11:34:20 +0530 Subject: [PATCH 05/10] feat(m0001): use shared accordion renderer for luo-connecting points --- .../details/LuoConnectingDetailRenderer.tsx | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/features/content/renderers/details/LuoConnectingDetailRenderer.tsx b/src/features/content/renderers/details/LuoConnectingDetailRenderer.tsx index 131c323..05f26a2 100644 --- a/src/features/content/renderers/details/LuoConnectingDetailRenderer.tsx +++ b/src/features/content/renderers/details/LuoConnectingDetailRenderer.tsx @@ -1,8 +1,13 @@ import React from "react"; -import { ScrollView } from "react-native"; import type { DetailRendererProps } from "../../types/renderer.types"; -import { ContentLinkAttributeSections } from "../shared/ContentLinkAttributeSections"; -import { asString } from "../helpers/value"; -import { Hero } from "../shared/Hero"; -import { DescriptionList, Images, ObjectArrayCards, ObjectArrayTable, ObjectCard, PointCodes, Strings } from "./categoryParts"; -export function LuoConnectingDetailRenderer({content,data,definitions,presentationAttributes}:DetailRendererProps){ return ; } +import { YuanSourceDetailRenderer } from "./YuanSourceDetailRenderer"; + +/** Renders Luo-Connecting category details using the shared Overview and expandable Points accordion layout. */ +export function LuoConnectingDetailRenderer(props: DetailRendererProps) { + return ( + + ); +} -- 2.34.1 From ba7d73011299c991557a34aac2689db7bd339974 Mon Sep 17 00:00:00 2001 From: ShivaniKhaire Date: Sat, 5 Dec 2026 11:34:20 +0530 Subject: [PATCH 06/10] feat(m0001): use shared accordion renderer for back-shu points --- .../renderers/details/BackShuDetailRenderer.tsx | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/features/content/renderers/details/BackShuDetailRenderer.tsx b/src/features/content/renderers/details/BackShuDetailRenderer.tsx index 001c0d3..4242b60 100644 --- a/src/features/content/renderers/details/BackShuDetailRenderer.tsx +++ b/src/features/content/renderers/details/BackShuDetailRenderer.tsx @@ -1,8 +1,13 @@ import React from "react"; -import { ScrollView } from "react-native"; import type { DetailRendererProps } from "../../types/renderer.types"; -import { ContentLinkAttributeSections } from "../shared/ContentLinkAttributeSections"; -import { asString } from "../helpers/value"; -import { Hero } from "../shared/Hero"; -import { DescriptionList, Images, ObjectArrayCards, ObjectArrayTable, ObjectCard, PointCodes, Strings } from "./categoryParts"; -export function BackShuDetailRenderer({content,data,definitions,presentationAttributes}:DetailRendererProps){ return ; } +import { YuanSourceDetailRenderer } from "./YuanSourceDetailRenderer"; + +/** Renders Back-Shu category details using the shared Overview and expandable Points accordion layout. */ +export function BackShuDetailRenderer(props: DetailRendererProps) { + return ( + + ); +} -- 2.34.1 From a1383ce84077d5ef9ef129ac3132901be6fae620 Mon Sep 17 00:00:00 2001 From: ShivaniKhaire Date: Sat, 5 Dec 2026 11:34:20 +0530 Subject: [PATCH 07/10] feat(m0001): use shared accordion renderer for front-mu points --- .../renderers/details/FrontMuDetailRenderer.tsx | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/features/content/renderers/details/FrontMuDetailRenderer.tsx b/src/features/content/renderers/details/FrontMuDetailRenderer.tsx index 9fe7fd0..9d038c5 100644 --- a/src/features/content/renderers/details/FrontMuDetailRenderer.tsx +++ b/src/features/content/renderers/details/FrontMuDetailRenderer.tsx @@ -1,8 +1,13 @@ import React from "react"; -import { ScrollView } from "react-native"; import type { DetailRendererProps } from "../../types/renderer.types"; -import { ContentLinkAttributeSections } from "../shared/ContentLinkAttributeSections"; -import { asString } from "../helpers/value"; -import { Hero } from "../shared/Hero"; -import { DescriptionList, Images, ObjectArrayCards, ObjectArrayTable, ObjectCard, PointCodes, Strings } from "./categoryParts"; -export function FrontMuDetailRenderer({content,data,definitions,presentationAttributes}:DetailRendererProps){ return ; } +import { YuanSourceDetailRenderer } from "./YuanSourceDetailRenderer"; + +/** Renders Front-Mu category details using the shared Overview and expandable Points accordion layout. */ +export function FrontMuDetailRenderer(props: DetailRendererProps) { + return ( + + ); +} -- 2.34.1 From 8f7ab00df238fd165742b495f8fc06b8e9e92ba1 Mon Sep 17 00:00:00 2001 From: ShivaniKhaire Date: Sat, 5 Dec 2026 11:34:20 +0530 Subject: [PATCH 08/10] feat(m0001): add YuanLuoDetailRenderer for host-guest pairings --- .../details/YuanLuoDetailRenderer.tsx | 248 ++++++++++++++++++ 1 file changed, 248 insertions(+) create mode 100644 src/features/content/renderers/details/YuanLuoDetailRenderer.tsx diff --git a/src/features/content/renderers/details/YuanLuoDetailRenderer.tsx b/src/features/content/renderers/details/YuanLuoDetailRenderer.tsx new file mode 100644 index 0000000..4f30416 --- /dev/null +++ b/src/features/content/renderers/details/YuanLuoDetailRenderer.tsx @@ -0,0 +1,248 @@ +import React, { useMemo } from "react"; +import { ScrollView, StyleSheet, Text, View } from "react-native"; +import { useRouter } from "expo-router"; +import { moderateScale, verticalScale } from "react-native-size-matters"; + +import { Colors } from "@/theme"; +import { useSettingsStore } from "@/store/settings.store"; +import type { DetailRendererProps } from "../../types/renderer.types"; +import { + asNumber, + asRecordArray, + asString, + asStringArray, +} from "../helpers/value"; +import { BulletList } from "../shared/BulletList"; +import { ContentLinkAttributeSections } from "../shared/ContentLinkAttributeSections"; +import { Hero } from "../shared/Hero"; +import { OverviewCard } from "../shared/OverviewCard"; +import { Images } from "./categoryParts"; +import { + buildCategoryOverviewParagraphs, + extractPointRefLabel, + navigateToPointRef, + PointCategoryAccordionCard, + pointCategoryStyles, + PointLinkChip, + type PointsCatalogMap, + usePointsCatalogMap, +} from "./pointCategoryShared"; + +interface PairingItemProps { + key?: React.Key; + pairing: Record; + index: number; + defaultExpanded: boolean; + moduleCode: string; + pointsCatalogMap: PointsCatalogMap; +} + +function PairingAccordionCard({ + pairing, + index, + defaultExpanded, + moduleCode, + pointsCatalogMap, +}: PairingItemProps) { + const router = useRouter(); + + const num = asNumber(pairing.number) ?? index + 1; + const meridianPair = asString(pairing.meridian_pair).trim(); + const hostLabel = extractPointRefLabel(pairing.host); + const guestLabel = extractPointRefLabel(pairing.guest); + const patterns = asRecordArray(pairing.patterns); + + const title = meridianPair + ? `${num}. ${meridianPair}` + : `Pairing ${num}`; + const pairBadge = + hostLabel && guestLabel + ? `${hostLabel} + ${guestLabel}` + : hostLabel || guestLabel; + + return ( + + {patterns.map((pattern, patternIdx) => { + const patternCode = asString(pattern.pattern_code).trim(); + const patternName = asString(pattern.pattern_name).trim(); + const needleTechnique = asString(pattern.needle_technique).trim(); + const actions = asStringArray(pattern.actions); + const indications = asStringArray(pattern.indications); + + const heading = patternCode && patternName + ? `${patternCode}. ${patternName}` + : patternName || `Pattern ${patternIdx + 1}`; + + return ( + 0 && styles.patternDivider, + ]} + > + {heading} + + {needleTechnique ? ( + + + NEEDLE TECHNIQUE + + {needleTechnique} + + ) : null} + + {actions.length > 0 ? ( + + ACTIONS + + + ) : null} + + {indications.length > 0 ? ( + + INDICATIONS + + + ) : null} + + ); + })} + + {hostLabel || guestLabel ? ( + + {hostLabel ? ( + + navigateToPointRef( + router, + pairing.host, + moduleCode, + pointsCatalogMap, + ) + } + /> + ) : null} + {guestLabel ? ( + + navigateToPointRef( + router, + pairing.guest, + moduleCode, + pointsCatalogMap, + ) + } + /> + ) : null} + + ) : null} + + ); +} + +/** Renders Yuan–Luo (Host–Guest) category overview and meridian pairing pattern accordions. */ +export function YuanLuoDetailRenderer({ + moduleCode = "m0001", + content, + data, + definitions, + presentationAttributes, +}: DetailRendererProps) { + const accordionDefaultExpanded = useSettingsStore( + (state) => state.accordionDefaultExpanded, + ); + const pointsCatalogMap = usePointsCatalogMap(moduleCode); + + const rawTitle = + asString(data.title) || asString(data.name) || content.title || "Yuan–Luo Points"; + const alias = asString(data.alias).trim() || undefined; + const overviewParagraphs = useMemo( + () => buildCategoryOverviewParagraphs(data), + [data], + ); + const pairings = asRecordArray(data.pairings); + + return ( + + + + + + {overviewParagraphs.length > 0 ? ( + + ) : null} + + {pairings.length > 0 ? ( + + {pairings.map((pairing, index) => ( + + ))} + + ) : null} + + + + ); +} + +const styles = StyleSheet.create({ + patternBlock: { + gap: verticalScale(10), + }, + patternDivider: { + paddingTop: verticalScale(12), + borderTopWidth: 1, + borderTopColor: "#E2E8F0", + }, + patternTitle: { + fontSize: moderateScale(15), + lineHeight: moderateScale(21), + fontWeight: "700", + color: Colors.primaryDark, + }, + techniqueBox: { + backgroundColor: "#F8FAFC", + borderRadius: moderateScale(10), + borderWidth: 1, + borderColor: "#E2E8F0", + paddingHorizontal: moderateScale(12), + paddingVertical: verticalScale(8), + gap: verticalScale(3), + }, + techniqueText: { + fontSize: moderateScale(14), + lineHeight: moderateScale(20), + fontWeight: "600", + color: "#1E293B", + }, + listGroup: { + gap: verticalScale(6), + }, +}); + -- 2.34.1 From 7f457f4a8066fa8bc9dab536b26714ad0abdf481 Mon Sep 17 00:00:00 2001 From: ShivaniKhaire Date: Sat, 5 Dec 2026 11:34:20 +0530 Subject: [PATCH 09/10] feat(m0001): add InfluentialPointsDetailRenderer --- .../details/InfluentialPointsDetailRenderer.tsx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/features/content/renderers/details/InfluentialPointsDetailRenderer.tsx diff --git a/src/features/content/renderers/details/InfluentialPointsDetailRenderer.tsx b/src/features/content/renderers/details/InfluentialPointsDetailRenderer.tsx new file mode 100644 index 0000000..fca10d6 --- /dev/null +++ b/src/features/content/renderers/details/InfluentialPointsDetailRenderer.tsx @@ -0,0 +1,14 @@ +import React from "react"; +import type { DetailRendererProps } from "../../types/renderer.types"; +import { YuanSourceDetailRenderer } from "./YuanSourceDetailRenderer"; + +/** Renders Influential Points (Ba Hui Xue) category details using the shared accordion layout. */ +export function InfluentialPointsDetailRenderer(props: DetailRendererProps) { + return ( + + ); +} + -- 2.34.1 From f4faa58d83655cb22797fe8b4af86949868d27c7 Mon Sep 17 00:00:00 2001 From: ShivaniKhaire Date: Sat, 5 Dec 2026 11:34:20 +0530 Subject: [PATCH 10/10] feat(m0001): register yuan_luo_detail and influential_points_detail renderers --- src/features/content/renderers/registry.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/features/content/renderers/registry.ts b/src/features/content/renderers/registry.ts index 08f74d2..50a6a2e 100644 --- a/src/features/content/renderers/registry.ts +++ b/src/features/content/renderers/registry.ts @@ -32,6 +32,8 @@ import { FourSeasDetailRenderer } from "./details/FourSeasDetailRenderer"; import { GhostPointsDetailRenderer } from "./details/GhostPointsDetailRenderer"; import { EntryExitPointsDetailRenderer } from "./details/EntryExitPointsDetailRenderer"; import { ReturningYangDetailRenderer } from "./details/ReturningYangDetailRenderer"; +import { YuanLuoDetailRenderer } from "./details/YuanLuoDetailRenderer"; +import { InfluentialPointsDetailRenderer } from "./details/InfluentialPointsDetailRenderer"; import { EarAcupunctureCatalogCollectionRenderer, EarAcupunctureCatalogCardRenderer, EarAcupunctureCollectionRenderer, EarAcupunctureCardRenderer } from "./collections/EarAcupunctureRenderers"; import { EarAcupunctureCatalogDetailRenderer } from "./details/EarAcupunctureCatalogDetailRenderer"; import { EarAcupunctureDetailRenderer } from "./details/EarAcupunctureDetailRenderer"; @@ -146,6 +148,8 @@ export const detailRenderers: Readonly> ghost_points_detail: GhostPointsDetailRenderer, entry_exit_points_detail: EntryExitPointsDetailRenderer, returning_yang_detail: ReturningYangDetailRenderer, + yuan_luo_detail: YuanLuoDetailRenderer, + influential_points_detail: InfluentialPointsDetailRenderer, ear_acupuncture_catalog_detail: EarAcupunctureCatalogDetailRenderer, ear_acupuncture_detail: EarAcupunctureDetailRenderer, four_levels_detail: FourLevelsDetailRenderer, -- 2.34.1