ankban commited on
Commit
63576e9
·
verified ·
1 Parent(s): 309f0f0

Create file_dashboard.py

Browse files
Files changed (1) hide show
  1. file_dashboard.py +25 -0
file_dashboard.py ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from file_viewer_panel import file_viewer_dashboard
3
+ from file_study_guide_panel import file_study_guide_dashboard
4
+
5
+ def file_based_learning_router():
6
+ with gr.Column(scale=4, elem_id="main-column") as router:
7
+ view_state = gr.State("study")
8
+
9
+ study_panel = gr.Column(visible=True)
10
+ viewer_panel = gr.Column(visible=False)
11
+
12
+ with study_panel:
13
+ file_study_guide_dashboard()
14
+
15
+ with viewer_panel:
16
+ file_viewer_dashboard()
17
+
18
+ def switch_view(mode):
19
+ return (
20
+ gr.update(visible=(mode == "study")),
21
+ gr.update(visible=(mode == "file")),
22
+ mode
23
+ )
24
+
25
+ return router, switch_view, study_panel, viewer_panel