Spaces:
Sleeping
Sleeping
File size: 1,040 Bytes
6a94706 358b6a5 b537c3b 7980609 358b6a5 ad4e58e 358b6a5 6a94706 358b6a5 ad4e58e 358b6a5 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 |
import gradio as gr
from components.menu import generate_menu
from components.cart import cart
import pandas as pd
# Load menu data
menu_data = pd.read_excel("data/menu.xlsx")
# Initialize the app
def main():
with gr.Blocks(css="static/styles.css") as app:
gr.Markdown("# Dynamic Menu with Popups and Cart")
# Preference Selection
preference = gr.Radio(
label="Select Preference",
choices=["All", "Vegetarian", "Non-Vegetarian", "Guilt-Free"],
value="All"
)
# Menu Display
menu_display = gr.Column()
preference.change(generate_menu, inputs=[preference, menu_data], outputs=menu_display)
# Popup Display
popup_display = gr.Column(visible=False) # Placeholder for popups
# Cart Display
gr.Markdown("## Your Cart")
cart_display = gr.Dataframe(headers=["Dish", "Spice Level", "Extras", "Instructions", "Quantity", "Price"])
app.launch()
if __name__ == "__main__":
main()
|