import React, { FC } from 'react'; import { useTranslation } from 'react-i18next'; import SearchPageForm from './SearchPageForm'; import AppContainer from '../../client/services/AppContainer'; import DeleteSelectedPageGroup from './DeleteSelectedPageGroup'; import { CheckboxType } from '../../interfaces/search'; type Props = { searchingKeyword: string, appContainer: AppContainer, onSearchInvoked: (data : any[]) => boolean, onExcludeUsersHome?: () => void, onExcludeTrash?: () => void, } const SearchControl: FC = (props: Props) => { // Temporaly workaround for lint error // later needs to be fixed: SearchControl to typescript componet const SearchPageFormTypeAny : any = SearchPageForm; const { t } = useTranslation(''); const onExcludeUsersHome = () => { if (props.onExcludeUsersHome != null) { props.onExcludeUsersHome(); } }; const onExcludeTrash = () => { if (props.onExcludeTrash != null) { props.onExcludeTrash(); } }; const onDeleteSelectedPageHandler = () => { console.log('onDeleteSelectedPageHandler is called'); // TODO: implement this function to delete selected pages. // https://estoc.weseek.co.jp/redmine/issues/77525 }; const onCheckAllPagesInvoked = (nextCheckboxState:CheckboxType) => { console.log(`onCheckAllPagesInvoked is called with arg ${nextCheckboxState}`); // Todo: set the checkboxState, isChecked, and indeterminate value of checkbox element according to the passed argument // https://estoc.weseek.co.jp/redmine/issues/77525 // setting checkbox to indeterminate is required to use of useRef to access checkbox element. // ref: https://getbootstrap.com/docs/4.5/components/forms/#checkboxes }; return ( <>
{/* TODO: replace the following button */}
{/* TODO: replace the following elements deleteAll button , relevance button and include specificPath button component */}
{/* Todo: design will be fixed in #80324. Function will be implemented in #77525 */}
); }; export default SearchControl;