Spaces:
Sleeping
Sleeping
Update ui/suggestions_tab.py
Browse files- ui/suggestions_tab.py +27 -36
ui/suggestions_tab.py
CHANGED
@@ -13,49 +13,46 @@ def create_suggestions_tab():
|
|
13 |
elem_classes="centered-text"
|
14 |
)
|
15 |
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
|
|
|
|
23 |
|
24 |
-
|
25 |
-
|
26 |
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
|
|
|
|
|
|
35 |
|
36 |
-
#
|
37 |
suggest_btn.click(
|
38 |
generate_product_description,
|
39 |
inputs=suggestion_input,
|
40 |
outputs=suggestions_output
|
41 |
)
|
42 |
|
43 |
-
#
|
44 |
gr.Markdown(
|
45 |
"""
|
46 |
<style>
|
47 |
.centered-text {
|
48 |
text-align: center;
|
49 |
-
font-size:
|
50 |
-
font-weight:
|
51 |
-
margin-bottom: 16px;
|
52 |
-
}
|
53 |
-
#suggestion-form-box {
|
54 |
-
border: 1px solid #333;
|
55 |
-
border-radius: 12px;
|
56 |
-
padding: 24px;
|
57 |
-
background: #1c1c1c;
|
58 |
-
box-shadow: 0 4px 12px rgba(0,0,0,0.4);
|
59 |
}
|
60 |
#suggestion-box textarea {
|
61 |
font-family: 'Courier New', monospace;
|
@@ -63,13 +60,7 @@ def create_suggestions_tab():
|
|
63 |
background-color: #111827;
|
64 |
color: #e5e7eb;
|
65 |
border-radius: 10px;
|
66 |
-
padding:
|
67 |
-
}
|
68 |
-
button {
|
69 |
-
font-weight: bold;
|
70 |
-
font-size: 14px;
|
71 |
-
margin-top: 12px;
|
72 |
-
width: 100%;
|
73 |
}
|
74 |
</style>
|
75 |
"""
|
|
|
13 |
elem_classes="centered-text"
|
14 |
)
|
15 |
|
16 |
+
# π© Input Section
|
17 |
+
suggestion_input = gr.Textbox(
|
18 |
+
label="π¬ Your Request",
|
19 |
+
placeholder="Try: Gifts under 500, or Shampoo for dry hair",
|
20 |
+
lines=1
|
21 |
+
)
|
22 |
+
|
23 |
+
# π Add vertical spacing
|
24 |
+
gr.Markdown("<br>")
|
25 |
|
26 |
+
# π¦ Button
|
27 |
+
suggest_btn = gr.Button("π Get Suggestions")
|
28 |
|
29 |
+
# π Add vertical spacing
|
30 |
+
gr.Markdown("<br>")
|
31 |
+
|
32 |
+
# π¨ Output Section
|
33 |
+
suggestions_output = gr.Textbox(
|
34 |
+
label="β¨ Suggested Products",
|
35 |
+
lines=10,
|
36 |
+
interactive=False,
|
37 |
+
show_copy_button=True,
|
38 |
+
elem_id="suggestion-box"
|
39 |
+
)
|
40 |
|
41 |
+
# Logic
|
42 |
suggest_btn.click(
|
43 |
generate_product_description,
|
44 |
inputs=suggestion_input,
|
45 |
outputs=suggestions_output
|
46 |
)
|
47 |
|
48 |
+
# Optional styling
|
49 |
gr.Markdown(
|
50 |
"""
|
51 |
<style>
|
52 |
.centered-text {
|
53 |
text-align: center;
|
54 |
+
font-size: 16px;
|
55 |
+
font-weight: 500;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
}
|
57 |
#suggestion-box textarea {
|
58 |
font-family: 'Courier New', monospace;
|
|
|
60 |
background-color: #111827;
|
61 |
color: #e5e7eb;
|
62 |
border-radius: 10px;
|
63 |
+
padding: 10px;
|
|
|
|
|
|
|
|
|
|
|
|
|
64 |
}
|
65 |
</style>
|
66 |
"""
|