geethareddy commited on
Commit
eebcf19
·
verified ·
1 Parent(s): 51119a7

Update components/menu.py

Browse files
Files changed (1) hide show
  1. components/menu.py +6 -4
components/menu.py CHANGED
@@ -13,10 +13,12 @@ def generate_menu():
13
  for item in menu_items:
14
  with gr.Column():
15
  gr.Image(item["image"], label=item["name"])
16
- gr.Button("Add", elem_id=f"add-{item['name']}").click(
17
- generate_popup_card,
18
- inputs=[item["name"], item["model"]],
19
- outputs="popup-container"
 
 
20
  )
21
 
22
  return menu_row
 
13
  for item in menu_items:
14
  with gr.Column():
15
  gr.Image(item["image"], label=item["name"])
16
+ button = gr.Button("Add", elem_id=f"add-{item['name']}")
17
+ # Pass the item name and model path to the popup_card function
18
+ button.click(
19
+ generate_popup_card,
20
+ inputs=[],
21
+ outputs=[gr.update(visible=True)], # Dynamically create a popup
22
  )
23
 
24
  return menu_row