import { Ionicons } from "@expo/vector-icons"; import { PropsWithChildren, ReactNode } from "react"; import { TouchableOpacity, TouchableOpacityProps, View, ViewProps, } from "react-native"; import { Text } from "../common/Text"; interface Props extends TouchableOpacityProps, ViewProps { title?: string | null | undefined; value?: string | null | undefined; children?: ReactNode; iconAfter?: ReactNode; icon?: keyof typeof Ionicons.glyphMap; showArrow?: boolean; textColor?: "default" | "blue" | "red"; onPress?: () => void; } export const ListItem: React.FC> = ({ title, value, iconAfter, children, showArrow = false, icon, textColor = "default", onPress, disabled = false, ...props }) => { if (onPress) return ( {children} ); return ( {children} ); }; const ListItemContent = ({ title, textColor, icon, value, showArrow, iconAfter, children, ...props }: Props) => { return ( <> {icon && ( )} {title} {value && ( {value} )} {children && {children}} {showArrow && ( )} {iconAfter} ); };