import React from "react";
import lbry from "lbry";
import lbryio from "lbryio";
import lbryuri from "lbryuri";
import lighthouse from "lighthouse";
import FileTile from "component/fileTile";
import Link from "component/link";
import { ToolTip } from "component/tooltip.js";
import { BusyMessage } from "component/common.js";
const SearchNoResults = props => {
const { navigate, query } = props;
return (
{(__("No one has checked anything in for %s yet."), query)} {" "}
navigate("/publish")} />
);
};
const FileListSearchResults = props => {
const { results } = props;
const rows = [],
seenNames = {}; //fix this when the search API returns claim IDs
for (let {
name,
claim,
claim_id,
channel_name,
channel_id,
txid,
nout,
} of results) {
const uri = lbryuri.build({
channelName: channel_name,
contentName: name,
claimId: channel_id || claim_id,
});
rows.push();
}
return
{rows}
;
};
class FileListSearch extends React.PureComponent {
componentWillMount() {
this.doSearch(this.props);
}
componentWillReceiveProps(props) {
if (props.query != this.props.query) {
this.doSearch(props);
}
}
doSearch(props) {
this.props.search(props.query);
}
render() {
const { isSearching, results } = this.props;
return (
{isSearching &&
!results &&
}
{isSearching &&
results &&
}
{results && !!results.length
?
: !isSearching && }
);
}
}
export default FileListSearch;