import React from 'react'; import { RectButton } from 'react-native-gesture-handler'; import FastImage from 'react-native-fast-image'; import { IAutocompleteItemProps } from '../../interfaces'; import { CustomIcon } from '../../../CustomIcon'; import { AutocompleteItemLoading } from './AutocompleteItemLoading'; import { useStyle } from './styles'; export const AutocompletePreview = ({ item, onPress }: IAutocompleteItemProps) => { const [styles, colors] = useStyle(); let content; if (item.type === 'loading') { content = ; } if (item.type === '/preview') { content = item.preview.type === 'image' ? ( ) : ( ); } return ( onPress(item)} underlayColor={colors.buttonBackgroundPrimaryPress} style={styles.previewItem} rippleColor={colors.buttonBackgroundPrimaryPress} > {content} ); };