panel 2 courier api restore

This commit is contained in:
alma 2025-04-25 19:18:26 +02:00
parent 84713f4630
commit 7ca22e9de8

View File

@ -271,15 +271,8 @@ const getFolderIcon = (folder: string) => {
} }
}; };
// Initial sidebar items - only INBOX // Update the initialSidebarItems to be empty since we're using folders under Accounts now
const initialSidebarItems = [ const initialSidebarItems: any[] = []; // Remove the default Inbox item
{
view: 'INBOX' as MailFolder,
label: 'Inbox',
icon: Inbox,
folder: 'INBOX'
}
];
function formatDate(date: Date | null): string { function formatDate(date: Date | null): string {
if (!date) return ''; if (!date) return '';
@ -1241,9 +1234,10 @@ export default function CourrierPage() {
} }
}; };
// Fix the sidebar navigation without the folders section and divider // Update the renderSidebarNav function to handle empty items or display other navigation options
const renderSidebarNav = () => ( const renderSidebarNav = () => (
<nav className="p-3"> <nav className="p-3">
{sidebarItems.length > 0 ? (
<ul className="space-y-0.5 px-2"> <ul className="space-y-0.5 px-2">
{sidebarItems.map((item) => ( {sidebarItems.map((item) => (
<li key={item.view}> <li key={item.view}>
@ -1272,6 +1266,12 @@ export default function CourrierPage() {
</li> </li>
))} ))}
</ul> </ul>
) : (
// If needed, you can add other navigation items here that aren't folders
<div className="px-2 py-2">
{/* This section is empty since we're now using folders under accounts */}
</div>
)}
</nav> </nav>
); );
@ -1634,9 +1634,9 @@ export default function CourrierPage() {
</div> </div>
</Button> </Button>
<Button <Button
variant="outline" variant="ghost"
size="icon" size="icon"
className="h-9 w-9 flex-none" className="h-9 w-9 text-gray-400 hover:text-gray-600"
onClick={() => { onClick={() => {
setLoading(true); setLoading(true);
loadEmails(); loadEmails();
@ -1680,18 +1680,6 @@ export default function CourrierPage() {
<div className="pl-4 mt-1 mb-2 space-y-0.5 border-l border-gray-200"> <div className="pl-4 mt-1 mb-2 space-y-0.5 border-l border-gray-200">
<div className="px-2 py-1 text-xs text-gray-500 font-medium flex justify-between items-center"> <div className="px-2 py-1 text-xs text-gray-500 font-medium flex justify-between items-center">
<span>Folders</span> <span>Folders</span>
<Button
variant="ghost"
size="icon"
className="h-5 w-5 text-gray-400 hover:text-gray-600"
onClick={(e) => {
e.stopPropagation();
setLoading(true);
loadEmails();
}}
>
<RefreshCw className="h-3 w-3" />
</Button>
</div> </div>
{account.folders && account.folders.length > 0 ? ( {account.folders && account.folders.length > 0 ? (
account.folders.map((folder) => ( account.folders.map((folder) => (