'use client'; import React, { useState } from 'react'; import { Inbox, Send, Trash, Archive, Star, File, RefreshCw, Plus, MailOpen, Settings, ChevronDown, ChevronRight, Mail } from 'lucide-react'; import { Button } from '@/components/ui/button'; import { cn } from '@/lib/utils'; import { ScrollArea } from '@/components/ui/scroll-area'; import { Badge } from '@/components/ui/badge'; interface EmailSidebarProps { currentFolder: string; folders: string[]; onFolderChange: (folder: string) => void; onRefresh: () => void; onCompose: () => void; isLoading: boolean; } export default function EmailSidebar({ currentFolder, folders, onFolderChange, onRefresh, onCompose, isLoading }: EmailSidebarProps) { const [showFolders, setShowFolders] = useState(true); // Get the appropriate icon for a folder const getFolderIcon = (folder: string) => { const folderLower = folder.toLowerCase(); switch (folderLower) { case 'inbox': return ; case 'sent': case 'sent items': return ; case 'drafts': return ; case 'trash': case 'deleted': case 'bin': return ; case 'archive': case 'archived': return ; case 'starred': case 'important': return ; default: return ; } }; // Group folders into standard and custom const standardFolders = ['INBOX', 'Sent', 'Drafts', 'Trash', 'Archive', 'Junk']; const visibleStandardFolders = standardFolders.filter(f => folders.includes(f) || folders.some(folder => folder.toLowerCase() === f.toLowerCase()) ); const customFolders = folders.filter(f => !standardFolders.some(sf => sf.toLowerCase() === f.toLowerCase()) ); return ( ); }