1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Move search suggestions to react component

This commit is contained in:
Bill Thornton 2021-06-02 10:00:24 -04:00
parent 1c0c25d655
commit 6058a512c4
3 changed files with 76 additions and 39 deletions

View file

@ -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}