diff --git a/src/features/content/renderers/details/FourLevelsDetailRenderer.tsx b/src/features/content/renderers/details/FourLevelsDetailRenderer.tsx new file mode 100644 index 0000000..8addc40 --- /dev/null +++ b/src/features/content/renderers/details/FourLevelsDetailRenderer.tsx @@ -0,0 +1,114 @@ +import React from "react"; +import { ScrollView, StyleSheet } from "react-native"; + +import type { DetailRendererProps } from "../../types/renderer.types"; + +import { ContentLinkAttributeSections } from "../shared/ContentLinkAttributeSections"; +import { Hero } from "../shared/Hero"; +import { SectionCard } from "../shared/SectionCard"; +import { Paragraphs } from "../shared/Paragraphs"; +import { asString } from "../helpers/value"; + +export function FourLevelsDetailRenderer({ + content, + data, + definitions, + presentationAttributes, +}: DetailRendererProps) { + const title = + asString(data.name) || + asString(data.title) || + content.title; + + const overview = asString(data.overview); + const clinicalManifestations = + asString(data.clinical_menifestation) || + asString(data.clinical_manifestations); + const tongue = asString(data.tongue); + const pulse = asString(data.pulse); + const pathology = asString(data.pathology); + const treatmentPrinciple = + asString(data.treatment_principle) || + asString(data["treatment principle"]); + const treatment = asString(data.treatment); + const explanation = asString(data.explanation); + const contentText = asString(data.content); + + return ( + + + + {overview ? ( + + + + ) : null} + + {clinicalManifestations ? ( + + + + ) : null} + + {tongue ? ( + + + + ) : null} + + {pulse ? ( + + + + ) : null} + + {pathology ? ( + + + + ) : null} + + {treatmentPrinciple ? ( + + + + ) : null} + + {treatment ? ( + + + + ) : null} + + {explanation ? ( + + + + ) : null} + + {contentText ? ( + + + + ) : null} + + + + ); +} + +const styles = StyleSheet.create({ + content: { + paddingHorizontal: 18, + paddingTop: 16, + paddingBottom: 40, + gap: 14, + }, +});