2
0

SearchOptionModal.tsx 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. import React, { FC } from 'react';
  2. import { useTranslation } from 'react-i18next';
  3. import {
  4. Modal, ModalHeader, ModalBody, ModalFooter,
  5. } from 'reactstrap';
  6. type Props = {
  7. isOpen: boolean,
  8. onClose?: () => void,
  9. onExcludeUserPagesSwitched?: () => void,
  10. onExcludeTrashPagesSwitched?: () => void,
  11. // todo: implement this method
  12. // refs: https://redmine.weseek.co.jp/issues/81845
  13. onClickFilteringSearchResultButton?: () => void,
  14. }
  15. // todo: implement filtering search result
  16. // refs: https://redmine.weseek.co.jp/issues/81845
  17. const SearchOptionModal: FC<Props> = (props: Props) => {
  18. const { t } = useTranslation('');
  19. const onClose = () => {
  20. if (props.onClose != null) {
  21. props.onClose();
  22. }
  23. };
  24. return (
  25. <Modal size="lg" isOpen={props.isOpen} toggle={onClose} autoFocus={false}>
  26. <ModalHeader tag="h4" toggle={onClose} className="bg-primary text-light">
  27. Search Option
  28. </ModalHeader>
  29. <ModalBody>
  30. <div className="d-flex p-3">
  31. <div className="border border-gray mr-3">
  32. <label className="px-3 py-2 mb-0 d-flex align-items-center">
  33. {/** todo: get checked state from parent component */}
  34. {/** // refs: https://redmine.weseek.co.jp/issues/81845 */}
  35. <input
  36. className="mr-2"
  37. type="checkbox"
  38. onClick={props.onExcludeUserPagesSwitched}
  39. />
  40. {t('Include Subordinated Target Page', { target: '/user' })}
  41. </label>
  42. </div>
  43. <div className="border border-gray">
  44. <label className="px-3 py-2 mb-0 d-flex align-items-center">
  45. {/** todo: get checked state from parent component */}
  46. {/** // refs: https://redmine.weseek.co.jp/issues/81845 */}
  47. <input
  48. className="mr-2"
  49. type="checkbox"
  50. onClick={props.onExcludeTrashPagesSwitched}
  51. />
  52. {t('Include Subordinated Target Page', { target: '/trash' })}
  53. </label>
  54. </div>
  55. </div>
  56. </ModalBody>
  57. <ModalFooter>
  58. <button
  59. type="button"
  60. className="btn btn-secondary"
  61. // todo: implement this method
  62. // refs: https://redmine.weseek.co.jp/issues/81845
  63. onClick={props.onClickFilteringSearchResultButton}
  64. >{t('search_result.search_again')}
  65. </button>
  66. </ModalFooter>
  67. </Modal>
  68. );
  69. };
  70. export default SearchOptionModal;