Spaces:
Sleeping
Sleeping
Create ui_components.py
Browse files- ui_components.py +27 -0
ui_components.py
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
|
| 3 |
+
PRESETS = [
|
| 4 |
+
{"label":"Playbook Tip","purpose":"awareness","tone":"Professional","cta":"What workflow would you automate first?"},
|
| 5 |
+
{"label":"Contrarian Hot Take","purpose":"opinion","tone":"Contrarian","cta":"Agree or disagree—and why?"},
|
| 6 |
+
{"label":"Product Launch","purpose":"product launch","tone":"Friendly","cta":"Want the demo? Comment 'demo'."},
|
| 7 |
+
{"label":"Hiring","purpose":"hiring","tone":"Professional","cta":"DM if interested or refer a friend."}
|
| 8 |
+
]
|
| 9 |
+
|
| 10 |
+
def preset_picker():
|
| 11 |
+
st.markdown("#### Presets")
|
| 12 |
+
cols = st.columns(len(PRESETS))
|
| 13 |
+
chosen = {}
|
| 14 |
+
for i,p in enumerate(PRESETS):
|
| 15 |
+
if cols[i].button(p["label"]):
|
| 16 |
+
chosen = p
|
| 17 |
+
return chosen
|
| 18 |
+
|
| 19 |
+
def refinement_bar():
|
| 20 |
+
c1,c2,c3,c4,c5 = st.columns(5)
|
| 21 |
+
actions = {}
|
| 22 |
+
if c1.button("Shorter"): actions["shorter"]=True
|
| 23 |
+
if c2.button("Punchier hook"): actions["punchier"]=True
|
| 24 |
+
if c3.button("Add data point"): actions["add_data"]=True
|
| 25 |
+
if c4.button("No emojis"): actions["less_emoji"]=True
|
| 26 |
+
if c5.button("Add hashtags"): actions["add_tags"]=True
|
| 27 |
+
return actions
|