// components/Layout/GlobalElements.js
'use client';
import { usePathname } from 'next/navigation';
import SupportChatButton from '../SupportChat/SupportChatButton';
// import { useAuth } from '@/lib/auth-context';
import { useAuthStore } from '@/stores/authStore';

export default function GlobalElements() {
    const pathname = usePathname();
    const userData = useAuthStore((state) => state.user);

    const user = userData ? userData : userData;

    const hideOnPages = ['/login', '/register', '/support'];
    const shouldHide = hideOnPages.includes(pathname);

    return (
        <>
            {/* Other global elements like modals, toasts, etc. */}
            {!shouldHide && <SupportChatButton />}
        </>
    );
}