File size: 967 Bytes
e3b7e79
 
 
bcfa5dd
 
 
 
e3b7e79
bcfa5dd
 
 
e3b7e79
 
bcfa5dd
 
e3b7e79
 
 
bcfa5dd
e3b7e79
 
 
 
 
 
 
 
bcfa5dd
 
e3b7e79
 
bcfa5dd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import gradio as gr
from components.cart import add_to_cart

def show_popup(dish_name):
    """Display a popup for the selected dish."""
    popup_content = gr.Column([
        gr.Markdown(f"### {dish_name}"),
        gr.Radio(
            label="Choose a Spice Level",
            choices=["Mild", "Medium", "Spicy"],
            value="Medium"
        ),
        gr.CheckboxGroup(
            label="Extras",
            choices=["Extra Raita + $1.00", "Extra Onion + $1.00"]
        ),
        gr.Textbox(
            label="Special Instructions",
            placeholder="Add any specific instructions."
        ),
        gr.Slider(
            label="Quantity",
            minimum=1,
            maximum=10,
            step=1,
            value=1
        ),
        gr.Button("Add to Cart").click(
            add_to_cart, inputs=[dish_name, gr.Radio, gr.CheckboxGroup, gr.Textbox, gr.Slider], outputs="cart_display"
        )
    ])
    return popup_content