import React from 'react'; import { View, ViewStyle, StyleSheet, StyleProp, TextStyle, TouchableOpacity, } from 'react-native'; import type { Theme } from '../../types'; import { withTheme } from '../../core/theming'; import { blockSizes } from '../../styles/styles'; import { Text } from '../..'; type Props = React.ComponentPropsWithRef & { left?: React.ReactNode; onPress?: () => void; right?: React.ReactNode; style?: StyleProp; theme: Theme; title?: string; titleStyle?: StyleProp; }; const ListItem = ({ left, onPress, right, style, theme, title, titleStyle, ...rest }: Props) => { return ( {left && {left}} {title && ( {title} )} {right && {right}} ); }; const styles = StyleSheet.create({ content: { display: 'flex', flexDirection: 'row', alignItems: 'center', minHeight: blockSizes.md, paddingVertical: 4, }, title: { fontSize: 16, }, left: { marginRight: 8, }, right: { marginLeft: 8, }, }); export default withTheme(ListItem);