File size: 898 Bytes
b86b48e
65e275b
 
b86b48e
 
 
 
 
65e275b
b86b48e
 
65e275b
b86b48e
 
 
 
 
 
 
65e275b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from components.popup_card import show_popup_card
import gradio as gr

menu_items = [
    {"name": "Veg Majestic", "price": 13, "image": "static/images/food_items/veg_majestic.png", "portion": "Medium"},
    {"name": "Murgh (Chicken)", "price": 14, "image": "static/images/food_items/murgh.png", "portion": "Large"},
    {"name": "Dal Fry", "price": 11, "image": "static/images/food_items/dal_fry.png", "portion": "Small"},
]

def render_menu(app):
    with app:
        for item in menu_items:
            with gr.Row():
                gr.Image(item["image"], elem_id=f"{item['name']}_img")
                gr.Markdown(f"**{item['name']}** - ₹{item['price']}")
                gr.Button("ADD", elem_id=f"{item['name']}_add").click(
                    show_popup_card, 
                    inputs=[item["name"], item["image"], item["portion"]],
                    outputs=[]
                )