kaisarhossain commited on
Commit
47cb9f1
·
verified ·
1 Parent(s): 6ae5e44

Update app.py

Browse files

app.py updated as per Gmail layout with dummy emails.

Files changed (1) hide show
  1. app.py +13 -7
app.py CHANGED
@@ -184,13 +184,19 @@ col1, col2, col3 = st.columns([2, 3, 2])
184
 
185
  with col1:
186
  st.markdown("#### 📩 Inbox")
187
- selected_email = st.radio(
188
- "Choose an email to view:",
189
- range(len(inbox_df)),
190
- format_func=lambda i: inbox_df.iloc[i]["Subject"],
191
- label_visibility="collapsed",
192
- index=None
193
- )
 
 
 
 
 
 
194
 
195
  with col2:
196
  st.markdown("#### ✉️ Email Details")
 
184
 
185
  with col1:
186
  st.markdown("#### 📩 Inbox")
187
+ if not inbox_df.empty:
188
+ # Ensure first email is selected by default
189
+ selected_email = st.radio(
190
+ "Choose an email to view:",
191
+ range(len(inbox_df)),
192
+ format_func=lambda i: inbox_df.iloc[i]["Subject"],
193
+ label_visibility="collapsed",
194
+ index=0 # default to first email
195
+ )
196
+ else:
197
+ st.info("No emails available in the inbox.")
198
+ selected_email = None
199
+
200
 
201
  with col2:
202
  st.markdown("#### ✉️ Email Details")