MCPcopy
hub / github.com/Anil-matcha/Open-Generative-AI / navigate

Function navigate

src/main.js:9–40  ·  view source on GitHub ↗
(page)

Source from the content-addressed store, hash-verified

7
8// Router
9function navigate(page) {
10 if (!contentArea) return;
11 contentArea.innerHTML = '';
12
13 if (page === 'image') {
14 contentArea.appendChild(ImageStudio());
15 } else if (page === 'video') {
16 import('./components/VideoStudio.js').then(({ VideoStudio }) => {
17 contentArea.appendChild(VideoStudio());
18 });
19 } else if (page === 'cinema') {
20 import('./components/CinemaStudio.js').then(({ CinemaStudio }) => {
21 contentArea.appendChild(CinemaStudio());
22 });
23 } else if (page === 'lipsync') {
24 import('./components/LipSyncStudio.js').then(({ LipSyncStudio }) => {
25 contentArea.appendChild(LipSyncStudio());
26 });
27 } else if (page === 'workflows') {
28 import('./components/WorkflowStudio.js').then(({ WorkflowStudio }) => {
29 contentArea.appendChild(WorkflowStudio());
30 });
31 } else if (page === 'agents') {
32 import('./components/AgentStudio.js').then(({ AgentStudio }) => {
33 contentArea.appendChild(AgentStudio());
34 });
35 } else if (page === 'mcp-cli') {
36 import('./components/McpCliStudio.js').then(({ McpCliStudio }) => {
37 contentArea.appendChild(McpCliStudio());
38 });
39 }
40}
41
42app.innerHTML = '';
43// Pass navigate to Header so links work

Callers 2

main.jsFile · 0.85
HeaderFunction · 0.85

Calls 7

ImageStudioFunction · 0.90
VideoStudioFunction · 0.50
CinemaStudioFunction · 0.50
LipSyncStudioFunction · 0.50
WorkflowStudioFunction · 0.50
AgentStudioFunction · 0.50
McpCliStudioFunction · 0.50

Tested by

no test coverage detected