| 123456789101112131415161718192021222324252627282930313233343536373839 |
- import { useTranslation } from 'next-i18next';
- import { useUpdateStateAfterSave } from '~/client/services/page-operation';
- import { useDrawioModalLauncherForView } from '~/client/services/side-effects/drawio-modal-launcher-for-view';
- import { useHandsontableModalLauncherForView } from '~/client/services/side-effects/handsontable-modal-launcher-for-view';
- import { toastSuccess, toastError } from '~/client/util/toastr';
- import { useCurrentPageId } from '~/stores/context';
- export const PageContentsUtilities = (): null => {
- const { t } = useTranslation();
- const { data: pageId } = useCurrentPageId();
- const updateStateAfterSave = useUpdateStateAfterSave(pageId);
- useHandsontableModalLauncherForView({
- onSaveSuccess: () => {
- toastSuccess(t('toaster.save_succeeded'));
- updateStateAfterSave?.();
- },
- onSaveError: (error) => {
- toastError(error);
- },
- });
- useDrawioModalLauncherForView({
- onSaveSuccess: () => {
- toastSuccess(t('toaster.save_succeeded'));
- updateStateAfterSave?.();
- },
- onSaveError: (error) => {
- toastError(error);
- },
- });
- return null;
- };
|