Alpha108 commited on
Commit
34d0ca6
·
verified ·
1 Parent(s): 86e80c9

Update ui_components.py

Browse files
Files changed (1) hide show
  1. ui_components.py +21 -24
ui_components.py CHANGED
@@ -1,27 +1,24 @@
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
 
1
  import streamlit as st
2
 
3
+ def quick_controls():
4
+ idea = st.text_area("Your idea", placeholder="Describe the idea for your LinkedIn post…")
5
+ tone = st.selectbox("Tone", ["Professional","Friendly","Contrarian","Technical","Inspirational"], index=0)
6
+ words = st.slider("Words", 80, 300, 160, 10)
7
+ variations = st.radio("Variations", [1,2,3], index=0, horizontal=True)
8
+ col1, col2 = st.columns(2)
9
+ with col1:
10
+ include_emoji = st.toggle("Include emojis", value=True)
11
+ with col2:
12
+ add_hashtags = st.toggle("Add hashtags", value=False)
13
+ language = st.selectbox("Language", ["English","Urdu","Arabic","French","Spanish"], index=0)
14
+ return idea, tone, words, variations, include_emoji, add_hashtags, language
15
 
16
+ def pro_controls(defaults):
17
+ topic = st.text_input("Topic", value=defaults.get("topic",""))
18
+ purpose = st.selectbox("Purpose", ["awareness","lead-gen","hiring","product launch","opinion","lesson learned"], index=0)
19
+ audience = st.text_input("Audience", value=defaults.get("audience",""))
20
+ tone = st.selectbox("Tone", ["Professional","Friendly","Contrarian","Technical","Inspirational"], index=0)
21
+ language = st.selectbox("Language", ["English","Urdu","Arabic","French","Spanish"], index=0)
22
+ evidence = st.text_area("Evidence (metric/anecdote/quote)", value="")
23
+ style_text = st.text_area("Style cues (max 4, one per line)", value="Short punchy hooks\nActionable bullets\nOne metric per paragraph\nQuestion-led CTA")
24
+ return topic, purpose, audience, tone, language, evidence, style_text