import React from "react"; import { StyleSheet, Text } from "react-native"; import { asRecord, asRecordArray, asString, asStringArray } from "../helpers/value"; import { BulletList } from "../shared/BulletList"; import { ChipList } from "../shared/ChipList"; import { ImageGallery } from "../shared/ImageGallery"; import { ObjectSections } from "../shared/ObjectSections"; import { RecordCards } from "../shared/RecordCards"; import { RecordTable } from "../shared/RecordTable"; import { SectionCard } from "../shared/SectionCard"; export const PointCodes = ({ data }: { data: Record }) => ( ); export const DescriptionList = ({ data }: { data: Record }) => { const arr = asStringArray(data.description); const text = asString(data.description); return ( {arr.length ? : {text}} ); }; export const Images = ({ data }: { data: Record }) => ( ); export const ObjectCard = ({ title, value }: { title: string; value: unknown }) => { const obj = asRecord(value); return Object.keys(obj).length ? ( ) : null; }; export const ObjectArrayCards = ({ title, value }: { title: string; value: unknown }) => { const rows = asRecordArray(value); return rows.length ? ( ) : null; }; export const ObjectArrayTable = ({ title, value, columns, }: { title: string; value: unknown; columns?: string[]; }) => { const rows = asRecordArray(value); return rows.length ? ( ) : null; }; export const Strings = ({ title, value }: { title: string; value: unknown }) => { const arr = asStringArray(value); const txt = asString(value); if (!arr.length && !txt) return null; return ( {arr.length ? : {txt}} ); }; const styles = StyleSheet.create({ readingText: { fontSize: 16, lineHeight: 26, color: "#334155" }, });