{children}
import { useRouter } from 'next/router'; import { useState } from 'react'; const AdminLayout = ({ children }) => { const router = useRouter(); const [isLoggingOut, setIsLoggingOut] = useState(false); const handleLogout = async () => { setIsLoggingOut(true); try { // Cookie löschen document.cookie = 'isAuthenticated=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;'; // Zur Login-Seite weiterleiten router.push('/admin/login'); } catch (error) { console.error('Logout-Fehler:', error); } finally { setIsLoggingOut(false); } }; return (