+ {isLoading && emails.length === 0 ? (
+
+
+
+ ) : emails.length === 0 ? (
+
+ {tList('no_emails')}
+
+ ) : (
+ <>
+ {emails.map((email) => {
+ const isUnread = !email.keywords?.$seen;
+ const isStarred = email.keywords?.$flagged === true;
+ const counterpart = showRecipient ? (email.to?.[0] ?? email.from?.[0]) : email.from?.[0];
+ const who = counterpart?.name || counterpart?.email || '';
+ return (
+
handleRowClick(email)}
+ onDoubleClick={() => openAsEmailTab(email, false)}
+ onKeyDown={(e) => {
+ if (e.key === 'Enter' || e.key === ' ') {
+ e.preventDefault();
+ handleRowClick(email);
+ }
+ }}
+ className={cn(
+ "cursor-pointer border-b border-border/50 px-3 py-2 transition-colors",
+ email.id === selectedEmailId
+ ? "bg-accent text-accent-foreground"
+ : "hover:bg-muted/50",
+ )}
+ >
+
+ {isUnread && (
+
+ )}
+
+ {who}
+
+
+ {formatDate(email.receivedAt)}
+
+
+
+
+ {email.subject || '—'}
+
+ {email.hasAttachment && (
+
+ )}
+ {isStarred && (
+
+ )}
+
+ {email.preview && (
+
+ {email.preview}
+
+ )}
+
+ );
+ })}
+ {isLoadingMore && (
+
+
+ {tList('loading_more')}
+
+ )}
+ >
+ )}
+