Spaces:
Sleeping
Sleeping
Update components/menu.py
Browse files- 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']}")
|
17 |
-
|
18 |
-
|
19 |
-
|
|
|
|
|
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
|