'use client'; import { useRouter, usePathname } from 'next/navigation'; import { useState } from 'react'; import Image from 'next/image'; import Link from 'next/link'; interface User { id: string; email: string; name: string | null; } interface DashboardLayoutProps { user: User; children: React.ReactNode; } interface NavItem { label: string; href: string; icon: React.ReactNode; } export default function DashboardLayout({ user, children }: DashboardLayoutProps) { const router = useRouter(); const pathname = usePathname(); const [loading, setLoading] = useState(false); const navItems: NavItem[] = [ { label: 'Tableau de Board', href: '/dashboard', icon: ( ), }, { label: 'Calendrier', href: '/dashboard/calendrier', icon: ( ), }, { label: 'Chauffeurs', href: '/dashboard/chauffeurs', icon: ( ), }, { label: 'Adhérents', href: '/dashboard/adherents', icon: ( ), }, { label: 'Univers Pro', href: '/dashboard/univers-pro', icon: ( ), }, { label: 'Messagerie', href: '/dashboard/messagerie', icon: ( ), }, { label: 'Factures', href: '/dashboard/factures', icon: ( ), }, ]; const handleLogout = async () => { setLoading(true); try { await fetch('/api/auth/logout', { method: 'POST' }); router.push('/login'); router.refresh(); } catch (error) { console.error('Logout error:', error); } finally { setLoading(false); } }; return (
{/* Sidebar */} {/* Main Content Area */}
{/* Top Navbar */}

{/* Notification Icon */} {/* Profile Avatar */}
{/* Page Content */}
{children}
); }