2021-05-28 13:38:28 -04:00
|
|
|
import PropTypes from 'prop-types';
|
2021-05-28 15:58:41 -04:00
|
|
|
import React, { useState } from 'react';
|
2021-05-28 13:38:28 -04:00
|
|
|
|
2021-05-28 15:58:41 -04:00
|
|
|
import SearchFieldsComponent from '../search/SearchFieldsComponent';
|
|
|
|
import SearchResultsComponent from '../search/SearchResultsComponent';
|
2021-05-28 13:38:28 -04:00
|
|
|
|
|
|
|
const SearchPage = ({ serverId, parentId, collectionType }) => {
|
2021-05-28 15:58:41 -04:00
|
|
|
const [ query, setQuery ] = useState(null);
|
2021-05-28 13:38:28 -04:00
|
|
|
|
|
|
|
return (
|
|
|
|
<>
|
2021-05-28 15:58:41 -04:00
|
|
|
<SearchFieldsComponent
|
|
|
|
onSearch={setQuery}
|
2021-05-28 13:38:28 -04:00
|
|
|
/>
|
2021-05-28 15:58:41 -04:00
|
|
|
<SearchResultsComponent
|
|
|
|
serverId={serverId || ApiClient.serverId()}
|
|
|
|
parentId={parentId}
|
|
|
|
collectionType={collectionType}
|
|
|
|
query={query}
|
2021-05-28 13:38:28 -04:00
|
|
|
/>
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
SearchPage.propTypes = {
|
|
|
|
serverId: PropTypes.string,
|
|
|
|
parentId: PropTypes.string,
|
|
|
|
collectionType: PropTypes.string
|
|
|
|
};
|
|
|
|
|
|
|
|
export default SearchPage;
|