diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2019-02-13 13:58:11 +0100 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2019-02-13 13:58:11 +0100 |
| commit | 392ea8d0ba2fdc713ae156517b0575e8219b9f1c (patch) | |
| tree | bb29c19f9f0a2d970c39c813130361405fccbe4e /scraper/client/search/search.results.js | |
| parent | dc7d9cbba842472efb33186e97ee55751e4d50ca (diff) | |
adding geocode client
Diffstat (limited to 'scraper/client/search/search.results.js')
| -rw-r--r-- | scraper/client/search/search.results.js | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/scraper/client/search/search.results.js b/scraper/client/search/search.results.js new file mode 100644 index 00000000..8b9e0c5e --- /dev/null +++ b/scraper/client/search/search.results.js @@ -0,0 +1,49 @@ +import React, { Component } from 'react' +import { Link, withRouter } from 'react-router-dom' +import { bindActionCreators } from 'redux' +import { connect } from 'react-redux' +import * as querystring from 'querystring' + +import { Keyframes } from '../common' +import * as searchActions from './search.actions' + +function SearchResults({ query, results, options }) { + if (!query || query.reset || query.loading || !results) { + return <div></div> + } + if (!query.loading && !results.length) { + return <div className='searchResults'><h3>No results</h3></div> + } + return ( + <div className="searchResults"> + <div className='searchResultsHeading row'> + <div className='column'> + <h3>Search Results</h3> + <small className="subtitle"> + {'Searched 10,523,176 frames from 576,234 videos (took '}{query.timing.toFixed(2)}{' ms)'} + </small> + </div> + </div> + <Keyframes + frames={results} + showHash + showTimestamp={options.groupByHash} + showSearchButton + showSaveButton + groupByHash={options.groupByHash} + /> + </div> + ) +} + +const mapStateToProps = state => ({ + query: state.search.query.query, + results: state.search.query.results, + options: state.search.options, +}) + +const mapDispatchToProps = dispatch => ({ + searchActions: bindActionCreators({ ...searchActions }, dispatch), +}) + +export default withRouter(connect(mapStateToProps, mapDispatchToProps)(SearchResults)) |
