Spaces:
Sleeping
Sleeping
Update ui_components.py
Browse files- ui_components.py +21 -24
ui_components.py
CHANGED
|
@@ -1,27 +1,24 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
-
def
|
| 11 |
-
st.
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|