File size: 1,113 Bytes
6a94706
358b6a5
cd941f3
 
b537c3b
7980609
358b6a5
cd941f3
358b6a5
 
 
cd941f3
 
358b6a5
 
cd941f3
358b6a5
 
ad4e58e
4b7cf86
cd941f3
 
 
6a94706
358b6a5
cd941f3
ad4e58e
cd941f3
358b6a5
cd941f3
 
 
 
013b172
358b6a5
7980609
 
358b6a5
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
34
35
36
37
38
39
import gradio as gr
from components.menu import generate_menu
from components.popup import show_popup
from components.cart import display_cart, cart_data
import pandas as pd

# Load menu data
menu_data = pd.read_excel("data/menu.xlsx")

def main():
    with gr.Blocks(css="static/styles.css") as app:
        gr.Markdown("# Dynamic Menu with Popups and Ordering System")

        # Preference Selection
        preference = gr.Radio(
            label="Choose a Preference",
            choices=["All", "Vegetarian", "Non-Vegetarian", "Guilt-Free"],
            value="All"
        )

        # Menu Display
        menu_display = gr.Row()
        preference.change(generate_menu, inputs=[preference], outputs=menu_display)

        # Popup Display
        popup_display = gr.Column(visible=False)  # Placeholder for popup

        # Cart Section
        gr.Markdown("## Your Cart")
        cart_display = gr.Dataframe(
            value=cart_data(),
            headers=["Dish", "Spice Level", "Extras", "Instructions", "Quantity", "Price"]
        )

        app.launch()

if __name__ == "__main__":
    main()