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

43 lines
1.3 KiB
TypeScript
Raw Normal View History

import React, { FunctionComponent, useState } from 'react';
2021-05-28 13:38:28 -04:00
2021-06-01 15:19:02 -04:00
import SearchFields from '../search/SearchFields';
import SearchResults from '../search/SearchResults';
import SearchSuggestions from '../search/SearchSuggestions';
import LiveTVSearchResults from '../search/LiveTVSearchResults';
2021-05-28 13:38:28 -04:00
type SearchProps = {
serverId?: string,
parentId?: string,
collectionType?: string
};
const SearchPage: FunctionComponent<SearchProps> = ({ serverId, parentId, collectionType }: SearchProps) => {
2021-05-28 15:58:41 -04:00
const [ query, setQuery ] = useState(null);
2021-05-28 13:38:28 -04:00
return (
<>
2021-06-01 15:19:02 -04:00
<SearchFields onSearch={setQuery} />
{!query &&
<SearchSuggestions
serverId={serverId || window.ApiClient.serverId()}
parentId={parentId}
/>
}
2021-06-01 15:19:02 -04:00
<SearchResults
serverId={serverId || window.ApiClient.serverId()}
2021-05-28 15:58:41 -04:00
parentId={parentId}
collectionType={collectionType}
query={query}
2021-05-28 13:38:28 -04:00
/>
<LiveTVSearchResults
serverId={serverId || window.ApiClient.serverId()}
parentId={parentId}
collectionType={collectionType}
query={query}
/>
2021-05-28 13:38:28 -04:00
</>
);
};
export default SearchPage;