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:
parent
1c0c25d655
commit
6058a512c4
3 changed files with 76 additions and 39 deletions
|
@ -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}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue