'use client';

import { LayoutProvider } from '../layout/context/layoutcontext';
import { PrimeReactProvider } from 'primereact/api';
import { AuthProvider } from '../contexts/AuthContext';
import { DevAuthProvider } from './auth/DevAuthProvider';
import { useServerStatusInit } from '../hooks/useServerStatusInit';

export function ClientProviders({ children }: { children: React.ReactNode }) {
    // Initialiser le monitoring serveur SSE globalement
    // useServerStatusInit(); // Temporairement désactivé - endpoint non disponible

    return (
        <PrimeReactProvider>
            <DevAuthProvider>
                <AuthProvider>
                    <LayoutProvider>{children}</LayoutProvider>
                </AuthProvider>
            </DevAuthProvider>
        </PrimeReactProvider>
    );
}