|
@@ -7,10 +7,8 @@ import { DropdownItem } from 'reactstrap';
|
|
|
|
|
|
|
|
import { IPageWithMeta } from '~/interfaces/page';
|
|
import { IPageWithMeta } from '~/interfaces/page';
|
|
|
import { IPageSearchMeta } from '~/interfaces/search';
|
|
import { IPageSearchMeta } from '~/interfaces/search';
|
|
|
-import { OnDeletedFunction } from '~/interfaces/ui';
|
|
|
|
|
|
|
|
|
|
import { exportAsMarkdown } from '~/client/services/page-operation';
|
|
import { exportAsMarkdown } from '~/client/services/page-operation';
|
|
|
-import { toastSuccess } from '~/client/util/apiNotification';
|
|
|
|
|
|
|
|
|
|
import RevisionLoader from '../Page/RevisionLoader';
|
|
import RevisionLoader from '../Page/RevisionLoader';
|
|
|
import AppContainer from '../../client/services/AppContainer';
|
|
import AppContainer from '../../client/services/AppContainer';
|
|
@@ -101,8 +99,6 @@ export const SearchResultContent: FC<Props> = (props: Props) => {
|
|
|
forceHideMenuItems,
|
|
forceHideMenuItems,
|
|
|
} = props;
|
|
} = props;
|
|
|
|
|
|
|
|
- const { t } = useTranslation();
|
|
|
|
|
-
|
|
|
|
|
const page = pageWithMeta?.pageData;
|
|
const page = pageWithMeta?.pageData;
|
|
|
const { open: openDuplicateModal } = usePageDuplicateModal();
|
|
const { open: openDuplicateModal } = usePageDuplicateModal();
|
|
|
const { open: openRenameModal } = usePageRenameModal();
|
|
const { open: openRenameModal } = usePageRenameModal();
|
|
@@ -119,25 +115,9 @@ export const SearchResultContent: FC<Props> = (props: Props) => {
|
|
|
openRenameModal(pageToRename);
|
|
openRenameModal(pageToRename);
|
|
|
}, [openRenameModal]);
|
|
}, [openRenameModal]);
|
|
|
|
|
|
|
|
-
|
|
|
|
|
- const onDeletedHandler: OnDeletedFunction = useCallback((pathOrPathsToDelete, isRecursively, isCompletely) => {
|
|
|
|
|
- if (typeof pathOrPathsToDelete !== 'string') {
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- const path = pathOrPathsToDelete;
|
|
|
|
|
-
|
|
|
|
|
- if (isCompletely) {
|
|
|
|
|
- toastSuccess(t('deleted_pages_completely', { path }));
|
|
|
|
|
- }
|
|
|
|
|
- else {
|
|
|
|
|
- toastSuccess(t('deleted_pages', { path }));
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- }, []);
|
|
|
|
|
-
|
|
|
|
|
const deleteItemClickedHandler = useCallback((pageToDelete) => {
|
|
const deleteItemClickedHandler = useCallback((pageToDelete) => {
|
|
|
- openDeleteModal([pageToDelete], { onDeleted: onDeletedHandler });
|
|
|
|
|
- }, [openDeleteModal, onDeletedHandler]);
|
|
|
|
|
|
|
+ openDeleteModal([pageToDelete]);
|
|
|
|
|
+ }, [openDeleteModal]);
|
|
|
|
|
|
|
|
const ControlComponents = useCallback(() => {
|
|
const ControlComponents = useCallback(() => {
|
|
|
if (page == null) {
|
|
if (page == null) {
|