import React, { Component } from 'react'; import TorrentLine from './torrent' import {List, ListItem} from 'material-ui/List'; import Subheader from 'material-ui/Subheader'; import Divider from 'material-ui/Divider'; import LinearProgress from 'material-ui/LinearProgress'; export default class SearchResults extends Component { render() { return ( { (this.props.torrentsSearchResults && this.props.torrentsSearchResults.length > 0) || (this.props.filesSearchResults && this.props.filesSearchResults.length > 0) ?
Search results
{this.props.resultSelector}
: null } { this.props.torrentsSearchResults && this.props.torrentsSearchResults.length > 0 ? this.props.torrentsSearchResults.map((torrent, index) =>{ return( ); }) : null } { this.props.moreTorrentsEnabled && !this.props.moreTorrentsIndicator ?
More Torrents} onClick={() => { if(this.props.onMoreTorrents) this.props.onMoreTorrents(); }} />
: null } { this.props.moreTorrentsIndicator ?
: null } { this.props.filesSearchResults && this.props.filesSearchResults.length > 0 ? this.props.filesSearchResults.map((torrent, index) =>{ return( ); }) : null } { this.props.moreFilesEnabled && !this.props.moreFilesIndicator ?
{ if(this.props.onMoreFiles) this.props.onMoreFiles(); }} />
: null } { this.props.moreFilesIndicator ?
: null } { this.props.torrentsSearchResults && this.props.torrentsSearchResults.length == 0 && this.props.filesSearchResults && this.props.filesSearchResults.length == 0 && !this.props.currentSearching ?
no torrents for this search request were found
: null }
); } }