2025-01-16 16:31:32 +03:00
|
|
|
'use client';
|
|
|
|
|
2025-01-30 00:40:32 +03:00
|
|
|
import React from 'react';
|
|
|
|
|
2025-02-10 01:32:55 +03:00
|
|
|
import { DialogType, useDialogsStore } from '@/stores/dialogs';
|
2025-01-16 16:31:32 +03:00
|
|
|
|
2025-02-19 23:30:35 +03:00
|
|
|
const DlgChangeInputSchema = React.lazy(() =>
|
2025-03-12 11:55:43 +03:00
|
|
|
import('@/features/oss/dialogs/dlg-change-input-schema').then(module => ({ default: module.DlgChangeInputSchema }))
|
2025-02-19 23:30:35 +03:00
|
|
|
);
|
|
|
|
const DlgChangeLocation = React.lazy(() =>
|
2025-03-12 11:55:43 +03:00
|
|
|
import('@/features/library/dialogs/dlg-change-location').then(module => ({
|
2025-02-19 23:30:35 +03:00
|
|
|
default: module.DlgChangeLocation
|
|
|
|
}))
|
|
|
|
);
|
|
|
|
const DlgCloneLibraryItem = React.lazy(() =>
|
2025-03-12 11:55:43 +03:00
|
|
|
import('@/features/library/dialogs/dlg-clone-library-item').then(module => ({
|
2025-02-19 23:30:35 +03:00
|
|
|
default: module.DlgCloneLibraryItem
|
|
|
|
}))
|
|
|
|
);
|
|
|
|
const DlgCreateCst = React.lazy(() =>
|
2025-03-12 11:55:43 +03:00
|
|
|
import('@/features/rsform/dialogs/dlg-create-cst').then(module => ({ default: module.DlgCreateCst }))
|
2025-02-19 23:30:35 +03:00
|
|
|
);
|
|
|
|
const DlgCreateOperation = React.lazy(() =>
|
2025-03-12 11:55:43 +03:00
|
|
|
import('@/features/oss/dialogs/dlg-create-operation').then(module => ({
|
2025-02-19 23:30:35 +03:00
|
|
|
default: module.DlgCreateOperation
|
|
|
|
}))
|
|
|
|
);
|
|
|
|
const DlgCreateVersion = React.lazy(() =>
|
2025-03-12 11:55:43 +03:00
|
|
|
import('@/features/library/dialogs/dlg-create-version').then(module => ({
|
2025-02-19 23:30:35 +03:00
|
|
|
default: module.DlgCreateVersion
|
|
|
|
}))
|
|
|
|
);
|
|
|
|
const DlgCstTemplate = React.lazy(() =>
|
2025-03-12 11:55:43 +03:00
|
|
|
import('@/features/rsform/dialogs/dlg-cst-template').then(module => ({
|
2025-02-19 23:30:35 +03:00
|
|
|
default: module.DlgCstTemplate
|
|
|
|
}))
|
|
|
|
);
|
|
|
|
const DlgDeleteCst = React.lazy(() =>
|
2025-03-12 11:55:43 +03:00
|
|
|
import('@/features/rsform/dialogs/dlg-delete-cst').then(module => ({
|
2025-02-19 23:30:35 +03:00
|
|
|
default: module.DlgDeleteCst
|
|
|
|
}))
|
|
|
|
);
|
|
|
|
const DlgDeleteOperation = React.lazy(() =>
|
2025-03-12 11:55:43 +03:00
|
|
|
import('@/features/oss/dialogs/dlg-delete-operation').then(module => ({
|
2025-02-19 23:30:35 +03:00
|
|
|
default: module.DlgDeleteOperation
|
|
|
|
}))
|
|
|
|
);
|
|
|
|
const DlgEditEditors = React.lazy(() =>
|
2025-03-12 11:55:43 +03:00
|
|
|
import('@/features/library/dialogs/dlg-edit-editors').then(module => ({
|
2025-02-19 23:30:35 +03:00
|
|
|
default: module.DlgEditEditors
|
|
|
|
}))
|
|
|
|
);
|
|
|
|
const DlgEditOperation = React.lazy(() =>
|
2025-03-12 11:55:43 +03:00
|
|
|
import('@/features/oss/dialogs/dlg-edit-operation').then(module => ({
|
2025-02-19 23:30:35 +03:00
|
|
|
default: module.DlgEditOperation
|
|
|
|
}))
|
|
|
|
);
|
|
|
|
const DlgEditReference = React.lazy(() =>
|
2025-03-12 11:55:43 +03:00
|
|
|
import('@/features/rsform/dialogs/dlg-edit-reference').then(module => ({
|
2025-02-19 23:30:35 +03:00
|
|
|
default: module.DlgEditReference
|
|
|
|
}))
|
|
|
|
);
|
|
|
|
const DlgEditVersions = React.lazy(() =>
|
2025-03-12 11:55:43 +03:00
|
|
|
import('@/features/library/dialogs/dlg-edit-versions').then(module => ({
|
2025-02-19 23:30:35 +03:00
|
|
|
default: module.DlgEditVersions
|
|
|
|
}))
|
|
|
|
);
|
|
|
|
const DlgEditWordForms = React.lazy(() =>
|
2025-03-12 11:55:43 +03:00
|
|
|
import('@/features/rsform/dialogs/dlg-edit-word-forms').then(module => ({
|
2025-02-19 23:30:35 +03:00
|
|
|
default: module.DlgEditWordForms
|
|
|
|
}))
|
|
|
|
);
|
|
|
|
const DlgInlineSynthesis = React.lazy(() =>
|
2025-03-12 11:55:43 +03:00
|
|
|
import('@/features/rsform/dialogs/dlg-inline-synthesis').then(module => ({
|
2025-02-19 23:30:35 +03:00
|
|
|
default: module.DlgInlineSynthesis
|
|
|
|
}))
|
|
|
|
);
|
|
|
|
const DlgRelocateConstituents = React.lazy(() =>
|
2025-03-12 11:55:43 +03:00
|
|
|
import('@/features/oss/dialogs/dlg-relocate-constituents').then(module => ({
|
2025-02-19 23:30:35 +03:00
|
|
|
default: module.DlgRelocateConstituents
|
|
|
|
}))
|
|
|
|
);
|
|
|
|
const DlgRenameCst = React.lazy(() =>
|
2025-03-12 11:55:43 +03:00
|
|
|
import('@/features/rsform/dialogs/dlg-rename-cst').then(module => ({
|
2025-02-19 23:30:35 +03:00
|
|
|
default: module.DlgRenameCst
|
|
|
|
}))
|
|
|
|
);
|
|
|
|
const DlgShowAST = React.lazy(() =>
|
2025-03-12 11:55:43 +03:00
|
|
|
import('@/features/rsform/dialogs/dlg-show-ast').then(module => ({
|
2025-02-19 23:30:35 +03:00
|
|
|
default: module.DlgShowAST
|
|
|
|
}))
|
|
|
|
);
|
|
|
|
const DlgShowQR = React.lazy(() =>
|
2025-03-12 11:55:43 +03:00
|
|
|
import('@/features/rsform/dialogs/dlg-show-qr').then(module => ({
|
2025-02-19 23:30:35 +03:00
|
|
|
default: module.DlgShowQR
|
|
|
|
}))
|
|
|
|
);
|
|
|
|
const DlgShowTypeGraph = React.lazy(() =>
|
2025-03-12 11:55:43 +03:00
|
|
|
import('@/features/rsform/dialogs/dlg-show-type-graph').then(module => ({
|
2025-02-19 23:30:35 +03:00
|
|
|
default: module.DlgShowTypeGraph
|
|
|
|
}))
|
|
|
|
);
|
|
|
|
const DlgSubstituteCst = React.lazy(() =>
|
2025-03-12 11:55:43 +03:00
|
|
|
import('@/features/rsform/dialogs/dlg-substitute-cst').then(module => ({
|
2025-02-19 23:30:35 +03:00
|
|
|
default: module.DlgSubstituteCst
|
|
|
|
}))
|
|
|
|
);
|
|
|
|
const DlgUploadRSForm = React.lazy(() =>
|
2025-03-12 11:55:43 +03:00
|
|
|
import('@/features/rsform/dialogs/dlg-upload-rsform').then(module => ({
|
2025-02-19 23:30:35 +03:00
|
|
|
default: module.DlgUploadRSForm
|
|
|
|
}))
|
|
|
|
);
|
|
|
|
const DlgGraphParams = React.lazy(() =>
|
2025-03-12 11:55:43 +03:00
|
|
|
import('@/features/rsform/dialogs/dlg-graph-params').then(module => ({ default: module.DlgGraphParams }))
|
2025-02-19 23:30:35 +03:00
|
|
|
);
|
2025-04-21 20:37:11 +03:00
|
|
|
const DlgCreateBlock = React.lazy(() =>
|
|
|
|
import('@/features/oss/dialogs/dlg-create-block').then(module => ({
|
|
|
|
default: module.DlgCreateBlock
|
|
|
|
}))
|
|
|
|
);
|
2025-01-30 00:40:32 +03:00
|
|
|
|
2025-01-16 16:31:32 +03:00
|
|
|
export const GlobalDialogs = () => {
|
|
|
|
const active = useDialogsStore(state => state.active);
|
|
|
|
|
2025-02-19 22:33:09 +03:00
|
|
|
if (active === null) {
|
2025-01-16 16:31:32 +03:00
|
|
|
return null;
|
|
|
|
}
|
|
|
|
switch (active) {
|
|
|
|
case DialogType.CONSTITUENTA_TEMPLATE:
|
|
|
|
return <DlgCstTemplate />;
|
|
|
|
case DialogType.CREATE_CONSTITUENTA:
|
|
|
|
return <DlgCreateCst />;
|
|
|
|
case DialogType.CREATE_OPERATION:
|
|
|
|
return <DlgCreateOperation />;
|
2025-04-21 20:37:11 +03:00
|
|
|
case DialogType.CREATE_BLOCK:
|
|
|
|
return <DlgCreateBlock />;
|
2025-01-16 16:31:32 +03:00
|
|
|
case DialogType.DELETE_CONSTITUENTA:
|
|
|
|
return <DlgDeleteCst />;
|
|
|
|
case DialogType.EDIT_EDITORS:
|
|
|
|
return <DlgEditEditors />;
|
|
|
|
case DialogType.EDIT_OPERATION:
|
|
|
|
return <DlgEditOperation />;
|
|
|
|
case DialogType.EDIT_REFERENCE:
|
|
|
|
return <DlgEditReference />;
|
|
|
|
case DialogType.EDIT_VERSIONS:
|
|
|
|
return <DlgEditVersions />;
|
|
|
|
case DialogType.EDIT_WORD_FORMS:
|
|
|
|
return <DlgEditWordForms />;
|
|
|
|
case DialogType.INLINE_SYNTHESIS:
|
|
|
|
return <DlgInlineSynthesis />;
|
|
|
|
case DialogType.SHOW_AST:
|
|
|
|
return <DlgShowAST />;
|
|
|
|
case DialogType.SHOW_TYPE_GRAPH:
|
|
|
|
return <DlgShowTypeGraph />;
|
|
|
|
case DialogType.CHANGE_INPUT_SCHEMA:
|
|
|
|
return <DlgChangeInputSchema />;
|
|
|
|
case DialogType.CHANGE_LOCATION:
|
|
|
|
return <DlgChangeLocation />;
|
|
|
|
case DialogType.CLONE_LIBRARY_ITEM:
|
|
|
|
return <DlgCloneLibraryItem />;
|
|
|
|
case DialogType.CREATE_VERSION:
|
|
|
|
return <DlgCreateVersion />;
|
|
|
|
case DialogType.DELETE_OPERATION:
|
|
|
|
return <DlgDeleteOperation />;
|
|
|
|
case DialogType.GRAPH_PARAMETERS:
|
|
|
|
return <DlgGraphParams />;
|
|
|
|
case DialogType.RELOCATE_CONSTITUENTS:
|
|
|
|
return <DlgRelocateConstituents />;
|
|
|
|
case DialogType.RENAME_CONSTITUENTA:
|
|
|
|
return <DlgRenameCst />;
|
|
|
|
case DialogType.SHOW_QR_CODE:
|
|
|
|
return <DlgShowQR />;
|
|
|
|
case DialogType.SUBSTITUTE_CONSTITUENTS:
|
|
|
|
return <DlgSubstituteCst />;
|
|
|
|
case DialogType.UPLOAD_RSFORM:
|
|
|
|
return <DlgUploadRSForm />;
|
|
|
|
}
|
|
|
|
};
|