Display a preview of the input content with basic statistics. Shows: - Input text preview - Character count - Word count
()
| 1226 | |
| 1227 | |
| 1228 | def enhance_input_preview(): |
| 1229 | """Display a preview of the input content with basic statistics. |
| 1230 | |
| 1231 | Shows: |
| 1232 | - Input text preview |
| 1233 | - Character count |
| 1234 | - Word count |
| 1235 | """ |
| 1236 | if "input_content" in st.session_state and st.session_state.input_content: |
| 1237 | with st.expander("Input Preview", expanded=True): |
| 1238 | st.markdown("### Current Input") |
| 1239 | st.code(st.session_state.input_content, language="text") |
| 1240 | |
| 1241 | # Basic statistics |
| 1242 | char_count = len(st.session_state.input_content) |
| 1243 | word_count = len(st.session_state.input_content.split()) |
| 1244 | |
| 1245 | col1, col2 = st.columns(2) |
| 1246 | with col1: |
| 1247 | st.metric("Characters", char_count) |
| 1248 | with col2: |
| 1249 | st.metric("Words", word_count) |
| 1250 | |
| 1251 | |
| 1252 | def get_clipboard_content() -> Tuple[bool, str, str]: |