geethareddy commited on
Commit
941d51f
·
verified ·
1 Parent(s): cf7b3eb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -36,12 +36,13 @@ with gr.Blocks() as demo:
36
  btn = gr.Button(item["name"], elem_id=f"menu-item-{item['name'].lower()}")
37
  output_html = gr.HTML() # Output will be formatted HTML
38
 
39
- # Display only formatted HTML content
40
  btn.click(
41
  fn=get_food_details,
42
- inputs=[], # No textboxes used here
43
- outputs=output_html,
44
- _js=f'() => {{"name": "{item["name"]}", "image": "{item["image"]}", "nutrition_details": "{item["nutrition"]}"}}'
 
45
  )
46
 
47
  gr.Markdown("<p style='text-align:center; margin-top:20px; color: gray;'>© 2024 Delicious Restaurant | Designed with ❤️</p>")
 
36
  btn = gr.Button(item["name"], elem_id=f"menu-item-{item['name'].lower()}")
37
  output_html = gr.HTML() # Output will be formatted HTML
38
 
39
+ # Display clean HTML content on button click
40
  btn.click(
41
  fn=get_food_details,
42
+ inputs=[gr.Text(value=item["name"], visible=False),
43
+ gr.Text(value=item["image"], visible=False),
44
+ gr.Text(value=item["nutrition"], visible=False)],
45
+ outputs=output_html
46
  )
47
 
48
  gr.Markdown("<p style='text-align:center; margin-top:20px; color: gray;'>© 2024 Delicious Restaurant | Designed with ❤️</p>")