Parishri07 commited on
Commit
96af891
Β·
verified Β·
1 Parent(s): efdcdc4

Update ui/navigator_tab.py

Browse files
Files changed (1) hide show
  1. ui/navigator_tab.py +31 -0
ui/navigator_tab.py CHANGED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from config import BASE_DIR
3
+ from utils.file_utils import get_subfolders, get_csv_files
4
+ from utils.data_utils import get_quantities_from_csv, display_quantity_info
5
+
6
+ def reset_all():
7
+ return (
8
+ None, None, None, None, None, None, None,
9
+ gr.update(choices=[], visible=False), "", {}
10
+ )
11
+
12
+ def create_navigator_tab():
13
+ with gr.TabItem("🧭 Navigator"):
14
+ with gr.Row():
15
+ country = gr.Dropdown(label="🌍 Country", choices=get_subfolders(BASE_DIR), interactive=True)
16
+ state = gr.Dropdown(label="πŸ™ State", choices=[], interactive=True)
17
+ city = gr.Dropdown(label="🏘 City", choices=[], interactive=True)
18
+ store = gr.Dropdown(label="πŸͺ Store", choices=[], interactive=True)
19
+ category = gr.Dropdown(label="πŸ› Category", choices=[], interactive=True)
20
+ product = gr.Dropdown(label="πŸ“¦ Product", choices=[], interactive=True)
21
+ brand = gr.Dropdown(label="🏷 Brand", choices=[], interactive=True)
22
+ quantity = gr.Dropdown(label="πŸ”’ Quantity", visible=False, interactive=True)
23
+
24
+ result = gr.Textbox(label="πŸ” Product Info", lines=5)
25
+ data_state = gr.State()
26
+ reset_btn = gr.Button("πŸ”„ Reset All")
27
+
28
+ # Chain dropdowns and bind logic here if needed
29
+
30
+ # Return all widgets as needed
31
+ return