Spaces:
Sleeping
Sleeping
Update components/menu_display.py
Browse files- components/menu_display.py +10 -6
components/menu_display.py
CHANGED
@@ -27,9 +27,13 @@ def menu_page():
|
|
27 |
|
28 |
with gr.Group():
|
29 |
gr.Markdown("### Menu")
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
|
|
|
|
|
|
|
|
|
27 |
|
28 |
with gr.Group():
|
29 |
gr.Markdown("### Menu")
|
30 |
+
if isinstance(menu_items, str):
|
31 |
+
gr.Label(menu_items) # Display message if menu_items is a string (e.g., "Please log in first!")
|
32 |
+
else:
|
33 |
+
for item in menu_items:
|
34 |
+
with gr.Row(): # Use gr.Row to display menu items
|
35 |
+
gr.Image(item["Image"], label=item["Name"])
|
36 |
+
gr.Text(f"{item['Price']} ₹")
|
37 |
+
spice_level = gr.Radio(["Mild 🌶️", "Medium 🌶️🌶️", "High 🌶️🌶️🌶️"], label="Spice Level")
|
38 |
+
add_button = gr.Button("Add to Cart")
|
39 |
+
add_button.click(add_to_cart, inputs=[item["Name"], spice_level], outputs=gr.Label("Status"))
|