import React from 'react'
import {connect} from 'react-redux'
import RelativeTime from 'components/relativetime'
class ResultsBox extends React.Component {
render() {
if (this.props.query == '') {
return null;
}
const queryDuration = this.props.queryDuration.toFixed(2);
const cachedAt = this.props.cachedAt;
const cacheTtl = this.props.cacheTtl;
return (
-
Found {this.props.totalImported} received
and {this.props.totalFiltered} filtered routes.
- Query took {queryDuration} ms to complete.
- Routes cache was built
and will be refreshed .
);
}
}
export default connect(
(state) => {
return {
totalImported: state.lookup.totalRoutesImported,
totalFiltered: state.lookup.totalRoutesFiltered,
cachedAt: state.lookup.cachedAt,
cacheTtl: state.lookup.cacheTtl,
queryDuration: state.lookup.queryDurationMs
}
}
)(ResultsBox)