ConceptPortal-public/rsconcept/frontend/src/features/help/pages/manuals-page/topic-page.tsx

115 lines
5.8 KiB
TypeScript
Raw Normal View History

2025-03-12 11:55:43 +03:00
import { useWindowSize } from '@/hooks/use-window-size';
2024-05-16 22:39:28 +03:00
2025-03-12 11:55:43 +03:00
import { HelpConceptOSS } from '../../items/cc/help-concept-oss';
import { HelpConceptPropagation } from '../../items/cc/help-concept-propagation';
import { HelpConceptRelations } from '../../items/cc/help-concept-relations';
2025-07-21 15:09:30 +03:00
import { HelpConceptStructuring } from '../../items/cc/help-concept-structuring';
2025-03-12 11:55:43 +03:00
import { HelpConceptSynthesis } from '../../items/cc/help-concept-synthesis';
import { HelpConceptSystem } from '../../items/cc/help-concept-system';
import { HelpCstAttributes } from '../../items/cc/help-cst-attributes';
import { HelpAccess } from '../../items/help-access';
2025-07-21 15:09:30 +03:00
import { HelpAssistant } from '../../items/help-assistant';
2025-03-12 11:55:43 +03:00
import { HelpConcept } from '../../items/help-concept';
import { HelpExteor } from '../../items/help-exteor';
import { HelpInfo } from '../../items/help-info';
import { HelpInterface } from '../../items/help-interface';
import { HelpMain } from '../../items/help-main';
import { HelpRSLang } from '../../items/help-rslang';
import { HelpTerminologyControl } from '../../items/help-terminology-control';
import { HelpThesaurus } from '../../items/help-thesaurus';
import { HelpVersions } from '../../items/help-versions';
import { HelpAPI } from '../../items/info/help-api';
import { HelpContributors } from '../../items/info/help-contributors';
import { HelpPrivacy } from '../../items/info/help-privacy';
import { HelpRules } from '../../items/info/help-rules';
import { HelpRSLangCorrect } from '../../items/rslang/help-rslang-correct';
import { HelpRSLangInterpret } from '../../items/rslang/help-rslang-interpret';
import { HelpRSLangOperations } from '../../items/rslang/help-rslang-operations';
import { HelpRSLangTemplates } from '../../items/rslang/help-rslang-templates';
import { HelpRSLangTypes } from '../../items/rslang/help-rslang-types';
import { HelpCstClass } from '../../items/ui/help-cst-class';
import { HelpCstStatus } from '../../items/ui/help-cst-status';
import { HelpFormulaTree } from '../../items/ui/help-formula-tree';
import { HelpLibrary } from '../../items/ui/help-library';
import { HelpOssGraph } from '../../items/ui/help-oss-graph';
2025-08-06 19:56:32 +03:00
import { HelpOssSidebar } from '../../items/ui/help-oss-sidebar';
2025-03-12 11:55:43 +03:00
import { HelpRelocateCst } from '../../items/ui/help-relocate-cst';
import { HelpRSCard } from '../../items/ui/help-rscard';
import { HelpRSEditor } from '../../items/ui/help-rseditor';
import { HelpRSGraphTerm } from '../../items/ui/help-rsgraph-term';
import { HelpRSList } from '../../items/ui/help-rslist';
import { HelpRSMenu } from '../../items/ui/help-rsmenu';
import { HelpSubstitutions } from '../../items/ui/help-substitutions';
import { HelpTypeGraph } from '../../items/ui/help-type-graph';
import { HelpTopic } from '../../models/help-topic';
2024-05-16 22:39:28 +03:00
2024-06-07 15:05:08 +03:00
// PDF Viewer setup
const OFFSET_X_SMALL = 32;
const OFFSET_X_LARGE = 280;
const MIN_SIZE_SMALL = 300;
const MIN_SIZE_LARGE = 600;
2024-05-16 22:39:28 +03:00
interface TopicPageProps {
topic: HelpTopic;
}
2025-02-19 23:30:35 +03:00
export function TopicPage({ topic }: TopicPageProps) {
2024-06-07 15:05:08 +03:00
const size = useWindowSize();
2024-08-17 23:42:56 +03:00
if (topic === HelpTopic.MAIN) return <HelpMain />;
2024-08-21 12:37:50 +03:00
if (topic === HelpTopic.THESAURUS) return <HelpThesaurus />;
2024-05-16 22:39:28 +03:00
if (topic === HelpTopic.INTERFACE) return <HelpInterface />;
if (topic === HelpTopic.UI_LIBRARY) return <HelpLibrary />;
2024-08-17 23:42:56 +03:00
if (topic === HelpTopic.UI_RS_MENU) return <HelpRSMenu />;
if (topic === HelpTopic.UI_RS_CARD) return <HelpRSCard />;
if (topic === HelpTopic.UI_RS_LIST) return <HelpRSList />;
if (topic === HelpTopic.UI_RS_EDITOR) return <HelpRSEditor />;
if (topic === HelpTopic.UI_GRAPH_TERM) return <HelpRSGraphTerm />;
2024-05-16 22:39:28 +03:00
if (topic === HelpTopic.UI_FORMULA_TREE) return <HelpFormulaTree />;
2024-11-19 22:30:52 +03:00
if (topic === HelpTopic.UI_TYPE_GRAPH) return <HelpTypeGraph />;
2024-05-16 22:39:28 +03:00
if (topic === HelpTopic.UI_CST_STATUS) return <HelpCstStatus />;
if (topic === HelpTopic.UI_CST_CLASS) return <HelpCstClass />;
2024-06-10 11:58:23 +03:00
if (topic === HelpTopic.UI_OSS_GRAPH) return <HelpOssGraph />;
2025-08-06 19:56:32 +03:00
if (topic === HelpTopic.UI_OSS_SIDEBAR) return <HelpOssSidebar />;
2024-10-29 12:06:43 +03:00
if (topic === HelpTopic.UI_SUBSTITUTIONS) return <HelpSubstitutions />;
if (topic === HelpTopic.UI_RELOCATE_CST) return <HelpRelocateCst />;
2024-05-16 22:39:28 +03:00
if (topic === HelpTopic.CONCEPTUAL) return <HelpConcept />;
if (topic === HelpTopic.CC_SYSTEM) return <HelpConceptSystem />;
if (topic === HelpTopic.CC_CONSTITUENTA) return <HelpCstAttributes />;
if (topic === HelpTopic.CC_RELATIONS) return <HelpConceptRelations />;
if (topic === HelpTopic.CC_SYNTHESIS) return <HelpConceptSynthesis />;
2025-07-21 15:09:30 +03:00
if (topic === HelpTopic.CC_STRUCTURING) return <HelpConceptStructuring />;
2024-06-10 11:58:23 +03:00
if (topic === HelpTopic.CC_OSS) return <HelpConceptOSS />;
2024-08-19 22:03:39 +03:00
if (topic === HelpTopic.CC_PROPAGATION) return <HelpConceptPropagation />;
2024-05-16 22:39:28 +03:00
if (topic === HelpTopic.RSLANG) return <HelpRSLang />;
if (topic === HelpTopic.RSL_TYPES) return <HelpRSLangTypes />;
if (topic === HelpTopic.RSL_CORRECT) return <HelpRSLangCorrect />;
if (topic === HelpTopic.RSL_INTERPRET) return <HelpRSLangInterpret />;
if (topic === HelpTopic.RSL_OPERATIONS) return <HelpRSLangOperations />;
2024-05-17 15:48:54 +03:00
if (topic === HelpTopic.RSL_TEMPLATES) return <HelpRSLangTemplates />;
2024-05-16 22:39:28 +03:00
if (topic === HelpTopic.TERM_CONTROL) return <HelpTerminologyControl />;
2024-06-04 16:06:48 +03:00
if (topic === HelpTopic.ACCESS) return <HelpAccess />;
2024-05-16 22:39:28 +03:00
if (topic === HelpTopic.VERSIONS) return <HelpVersions />;
2025-07-21 15:09:30 +03:00
if (topic === HelpTopic.ASSISTANT) return <HelpAssistant />;
2024-06-07 13:42:50 +03:00
if (topic === HelpTopic.INFO) return <HelpInfo />;
if (topic === HelpTopic.INFO_RULES) return <HelpRules />;
if (topic === HelpTopic.INFO_CONTRIB) return <HelpContributors />;
2024-06-07 15:05:08 +03:00
if (topic === HelpTopic.INFO_PRIVACY)
return (
<HelpPrivacy
offsetXpx={size.isSmall ? OFFSET_X_SMALL : OFFSET_X_LARGE}
minWidth={size.isSmall ? MIN_SIZE_SMALL : MIN_SIZE_LARGE}
/>
);
2024-06-07 13:42:50 +03:00
if (topic === HelpTopic.INFO_API) return <HelpAPI />;
2024-05-16 22:39:28 +03:00
if (topic === HelpTopic.EXTEOR) return <HelpExteor />;
return null;
}