junaid17 commited on
Commit
626ae0d
·
verified ·
1 Parent(s): 08ca12e

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +4 -9
main.py CHANGED
@@ -167,14 +167,9 @@ if st.session_state.output_text:
167
  unsafe_allow_html=True
168
  )
169
 
170
- # Copy button with actual clipboard functionality
171
  col_copy, col_empty = st.columns([1, 3])
172
  with col_copy:
173
- if st.button("📋 Copy Output", use_container_width=True):
174
- # Use Streamlit's native clipboard through components
175
- st.write(f"""
176
- <script>
177
- navigator.clipboard.writeText(`{st.session_state.output_text}`);
178
- </script>
179
- """, unsafe_allow_html=True)
180
- st.toast("✓ Copied to clipboard!", icon="✅")
 
167
  unsafe_allow_html=True
168
  )
169
 
170
+ # Copy button with pyperclip alternative
171
  col_copy, col_empty = st.columns([1, 3])
172
  with col_copy:
173
+ # Display the output in a code block that users can easily select and copy
174
+ st.code(st.session_state.output_text, language=None)
175
+ st.caption("👆 Select and copy the text above (Ctrl+C / Cmd+C)")