import type { ReactNode } from 'react' import { Fragment } from 'react' import type { StyleProp, TextStyle } from 'react-native' import { ThemedText } from '../visualization-and-display/ThemedText' export type ListItemContentOrder = 'titleFirst' | 'subtitleFirst' export type ListItemTextContentProps = { title?: string, subtitle?: string, content?: ReactNode, contentOrder?: ListItemContentOrder, } export const ListItemTextContent = ({ title, subtitle, content, contentOrder = 'titleFirst', titleStyle, subtitleStyle, }: ListItemTextContentProps & { titleStyle?: StyleProp, subtitleStyle?: StyleProp, }) => { if (content != null) { return <>{content} } const titleNode = title != null ? {title} : null const subtitleNode = subtitle != null ? {subtitle} : null if (contentOrder === 'subtitleFirst') { return ( {subtitleNode} {titleNode} ) } return ( {titleNode} {subtitleNode} ) }