import React, { useState, useEffect } from 'react'; import ApplicationLogo from '@/Components/ApplicationLogo'; import Dropdown from '@/Components/Dropdown'; import { ToastContainer, toast } from 'react-toastify' import ResponsiveNavLink from '@/Components/ResponsiveNavLink'; import { NavItem, NavDropdown } from '@/Components/NavItem'; import NavLink from '@/Components/NavLink'; import { Link } from '@inertiajs/react'; import MenuItem from '@/Components/SidebarMenuItem'; import { IconBell, IconBellRing } from '@/Icons'; import { router } from '@inertiajs/react' const Notification = ({ notifications, hasUnread }) => { const redirect = (item) => { router.get(route('notification.redirect', item)) } return ( {hasUnread ? ( ) : ( )} {notifications.map(item => (
redirect(item)}>
{item.content}
• {item.date}
))} {+notifications.length === 0 && (
No Notification Found
)}
) } export default function Authenticated({ auth, children, flash, notify }) { const [showingNavigationDropdown, setShowingNavigationDropdown] = useState(false); useEffect(() => { if (flash.message !== null) { toast(flash.message.message, {type: flash.message.type}) } }, [flash]) return (
{children}
); }