- {/* Courrier Title */}
-
-
- {/* Compose button and refresh button */}
-
-
-
-
-
- {/* Scrollable area for accounts and folders */}
-
- {/* Accounts Section */}
-
-
-
Accounts
-
-
-
- {/* Display all accounts */}
-
- {/* Form for adding a new account */}
- {showAddAccountForm && (
-
- )}
-
- {accounts.map((account) => (
-
-
handleAccountSelect(account)}
- tabIndex={0}
- role="button"
- onKeyDown={e => { if (e.key === 'Enter' || e.key === ' ') handleAccountSelect(account); }}
- >
-
-
{account.name}
- {/* More options button (⋮) */}
- {account.id !== 'loading-account' && (
-
-
-
-
-
- { e.stopPropagation(); setAccountToEdit(account); setShowEditModal(true); }}>
- Edit
-
- { e.stopPropagation(); setAccountToDelete(account); setShowDeleteDialog(true); }}>
- Delete
-
-
-
- )}
- {/* Expand/collapse arrow */}
- {account.id !== 'loading-account' && (
-
- )}
-
- {/* Show folders for any expanded account */}
- {expandedAccounts[account.id] && account.folders && account.folders.length > 0 && (
-
- {account.folders.map((folder) => renderFolderButton(folder, account.id))}
-
- )}
-
- ))}
-
-
-
+
+ {
+ const account = accounts.find(a => a.id === accountId);
+ if (account) {
+ setSelectedAccount(account);
+ changeFolder(folder);
+ }
+ }}
+ onRefresh={() => {
+ if (selectedAccount) {
+ loadEmails(selectedAccount.id, currentFolder);
+ }
+ }}
+ onCompose={() => {
+ setComposeType('new');
+ setShowComposeModal(true);
+ }}
+ isLoading={isLoading}
+ />
{/* Panel 2: Email List - Always visible */}
diff --git a/components/email/EmailSidebarContent.tsx b/components/email/EmailSidebarContent.tsx
deleted file mode 100644
index 2b2a6862..00000000
--- a/components/email/EmailSidebarContent.tsx
+++ /dev/null
@@ -1,68 +0,0 @@
-import React from 'react';
-import {
- Inbox, Send, Star, Trash, Folder,
- AlertOctagon, Archive, Edit
-} from 'lucide-react';
-import { Button } from '@/components/ui/button';
-
-interface EmailSidebarContentProps {
- mailboxes: string[];
- currentFolder: string;
- onFolderChange: (folder: string) => void;
-}
-
-export default function EmailSidebarContent({
- mailboxes,
- currentFolder,
- onFolderChange
-}: EmailSidebarContentProps) {
-
- // Helper to format folder names
- const formatFolderName = (folder: string) => {
- return folder.charAt(0).toUpperCase() + folder.slice(1).toLowerCase();
- };
-
- // Helper to get folder icons
- const getFolderIcon = (folder: string) => {
- const folderLower = folder.toLowerCase();
-
- if (folderLower.includes('inbox')) {
- return
;
- } else if (folderLower.includes('sent')) {
- return
;
- } else if (folderLower.includes('trash')) {
- return
;
- } else if (folderLower.includes('archive')) {
- return
;
- } else if (folderLower.includes('draft')) {
- return
;
- } else if (folderLower.includes('spam') || folderLower.includes('junk')) {
- return
;
- } else {
- return
;
- }
- };
-
- return (
-
- );
-}
\ No newline at end of file