import React from 'react'; import { normalizeURI, parseURI } from 'lbry-redux'; import { ActivityIndicator, Text, TouchableOpacity, View } from 'react-native'; import Colors from '../../styles/colors'; import FileItemMedia from '../fileItemMedia'; import NsfwOverlay from '../../component/nsfwOverlay'; import searchStyle from '../../styles/search'; class SearchResultItem extends React.PureComponent { render() { const { claim, metadata, isResolvingUri, showUri, isDownloaded, style, onPress, navigation } = this.props; const uri = normalizeURI(this.props.uri); const obscureNsfw = this.props.obscureNsfw && metadata && metadata.nsfw; const title = metadata && metadata.title ? metadata.title : parseURI(uri).contentName; let name; let channel; if (claim) { name = claim.name; channel = claim.channel_name; } return ( {isResolvingUri && ( {uri} )} {!isResolvingUri && {title || name}} {!isResolvingUri && channel && {channel}} {obscureNsfw && navigation.navigate({ routeName: 'Settings', key: 'settingsPage' })} />} ); } } export default SearchResultItem;