geethareddy commited on
Commit
6a7494c
·
verified ·
1 Parent(s): 65e275b

Create popup_card.py

Browse files
Files changed (1) hide show
  1. components/popup_card.py +12 -0
components/popup_card.py ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+
3
+ def generate_popup_card(name, model_path):
4
+ with gr.Blocks() as popup:
5
+ gr.Markdown(f"### {name}")
6
+ gr.ModelViewer(model_path, label="View in 3D")
7
+ gr.Textbox(label="Special Instructions", placeholder="Add any requests here...")
8
+ gr.Slider(1, 10, label="Quantity")
9
+ gr.Button("Add to Cart")
10
+ gr.Button("Close", elem_id="close-popup").click(None, None, "popup-container")
11
+
12
+ return popup