SearchControl.tsx 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. import React, { FC } from 'react';
  2. import PropTypes from 'prop-types';
  3. import SearchPageForm from './SearchPageForm';
  4. import AppContainer from '../../client/services/AppContainer';
  5. type Props = {
  6. searchingKeyword: string,
  7. appContainer: AppContainer,
  8. onSearchInvoked: (data : any[]) => boolean,
  9. }
  10. const SearchControl: FC <Props> = (props: Props) => {
  11. // Temporaly workaround for lint error
  12. // later needs to be fixed: SearchControl to typescript componet
  13. const SearchPageFormTypeAny : any = SearchPageForm;
  14. return (
  15. <div className="">
  16. <div className="search-page-input sps sps--abv">
  17. <SearchPageFormTypeAny
  18. keyword={props.searchingKeyword}
  19. appContainer={props.appContainer}
  20. onSearchFormChanged={props.onSearchInvoked}
  21. />
  22. </div>
  23. {/* TODO: place deleteAll button , relevance button , include specificPath button */}
  24. </div>
  25. );
  26. };
  27. SearchControl.propTypes = {
  28. searchingKeyword: PropTypes.string.isRequired,
  29. appContainer: PropTypes.instanceOf(AppContainer).isRequired,
  30. onSearchInvoked: PropTypes.func,
  31. };
  32. export default SearchControl;