import { PropsWithChildren, useState } from 'react'; import ApplicationLogo from '@/Components/ApplicationLogo'; import Footer from '@/Components/Footer'; import { Link, usePage } from '@inertiajs/react'; import { User } from '@/types'; import { AlertOctagon, Bell, Bookmark, ChevronDown, Grid, Home, LogOut } from 'react-feather'; import Modal from '@/Components/Modal'; import axios from 'axios'; import ModalButton from '@/Components/ModalButton'; import NavIconLink from '@/Components/NavIconLink'; export default function Authenticated({ user, children }: PropsWithChildren<{ user: User }>) { const { url } = usePage(); const [isUserOptionsHiglighted, setIsUserOptionsHiglighted] = useState(false); const [isDashboardHiglighted, setIsDashboardHiglighted] = useState(false); const [isNotificationsHiglighted, setIsNotificationsHiglighted] = useState(false); const [isBookmarksHiglighted, setIsBookmarksHiglighted] = useState(false); const [isLogoutModalOpen, setIsLogoutModalOpen] = useState(false); const handleCloseLogoutModal = () => { setIsLogoutModalOpen(false); axios.post('/logout') .then(response => { console.log(response.data); window.location.href = '/'; }) .catch(error => { console.error(error); }); }; return (
{children}
) }