Spaces:
Sleeping
Sleeping
| 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 | |