Move search suggestions to react component
This commit is contained in:
@@ -3,6 +3,7 @@ import React, { useState } from 'react';
|
||||
|
||||
import SearchFields from '../search/SearchFields';
|
||||
import SearchResults from '../search/SearchResultsComponent';
|
||||
import SearchSuggestions from '../search/SearchSuggestions';
|
||||
|
||||
const SearchPage = ({ serverId, parentId, collectionType }) => {
|
||||
const [ query, setQuery ] = useState(null);
|
||||
@@ -10,6 +11,12 @@ const SearchPage = ({ serverId, parentId, collectionType }) => {
|
||||
return (
|
||||
<>
|
||||
<SearchFields onSearch={setQuery} />
|
||||
{!query &&
|
||||
<SearchSuggestions
|
||||
serverId={serverId || ApiClient.serverId()}
|
||||
parentId={parentId}
|
||||
/>
|
||||
}
|
||||
<SearchResults
|
||||
serverId={serverId || ApiClient.serverId()}
|
||||
parentId={parentId}
|
||||
|
||||
Reference in New Issue
Block a user