|
|
@@ -3,9 +3,8 @@ import PropTypes from 'prop-types';
|
|
|
import { useTranslation } from 'react-i18next';
|
|
|
|
|
|
const IncludeSpecificPathButton = (props) => {
|
|
|
- const { pathToInclude } = props;
|
|
|
+ const { pathToInclude, checked } = props;
|
|
|
const { t } = useTranslation();
|
|
|
- const [checked, setChecked] = useState(true);
|
|
|
|
|
|
// TODO : implement this function
|
|
|
// 77526 story https://estoc.weseek.co.jp/redmine/issues/77526
|
|
|
@@ -16,12 +15,14 @@ const IncludeSpecificPathButton = (props) => {
|
|
|
return (
|
|
|
<div className="border px-2 btn btn-outline-secondary">
|
|
|
<label className="mb-0">
|
|
|
- <span className="font-weight-light">{pathToInclude === '/user' ? t('search_result.include_user_path') : t('search_result.include_trash_path')}</span>
|
|
|
+ <span className="font-weight-light">
|
|
|
+ {pathToInclude === '/user'
|
|
|
+ ? t('search_result.include_certain_path', { pathToInclude: '/user' }) : t('search_result.include_certain_path', { pathToInclude: '/trash' })}
|
|
|
+ </span>
|
|
|
<input
|
|
|
type="checkbox"
|
|
|
name="check"
|
|
|
onChange={() => {
|
|
|
- setChecked(prevState => !prevState);
|
|
|
if (checked) {
|
|
|
includeSpecificPathInSearchResult(pathToInclude);
|
|
|
}
|
|
|
@@ -35,6 +36,7 @@ const IncludeSpecificPathButton = (props) => {
|
|
|
|
|
|
IncludeSpecificPathButton.propTypes = {
|
|
|
pathToInclude: PropTypes.string.isRequired,
|
|
|
+ checked: PropTypes.bool.isRequired,
|
|
|
};
|
|
|
|
|
|
export default IncludeSpecificPathButton;
|