import React, { useState, useEffect, useRef } from 'react' import { router, Link, usePage } from '@inertiajs/react' import { Breadcrumb, Flowbite } from 'flowbite-react' import { ToastContainer, toast } from 'react-toastify' import { HiMenu, HiChevronDown, HiHome } from 'react-icons/hi' import { HiOutlineBell } from 'react-icons/hi2' import ApplicationLogo from '@/Components/Defaults/ApplicationLogo' import Dropdown from '@/Components/Defaults/Dropdown' import SidebarNav from './Partials/SidebarNav' import NotificationContent from './Partials/NotificationContent' import NotificationDeposit from './Partials/NotificationDeposit' import NotificationStock from './Partials/NotificationStock' const customTheme = { button: { color: { primary: 'bg-blue-700 hover:bg-blue-600 text-white', }, }, dropdown: { color: { primary: 'bg-blue-700 hover:bg-blue-600 text-white', }, }, } export default function Authenticated({ children, page = '', action = '', parent = null, }) { const { props: { count_unread_notifications, notifications, auth, flash }, } = usePage() const [showingNavigationDropdown, setShowingNavigationDropdown] = useState(false) useEffect(() => { if (flash.message !== null) { toast(flash.message.message, { type: flash.message.type }) } }, [flash]) useEffect(() => { if (typeof Notification !== undefined) { Notification.requestPermission() } }, []) return (
{page !== '' && ( parent === null ? router.visit(route('dashboard')) : router.visit(parent) } >

{page}

{typeof action === 'string' && ( {action} )} {typeof action === 'object' && action.map((item) => ( {item} ))}
)}
{children}
) }