'use client';

import { LayoutProvider } from '../layout/context/layoutcontext';
import { PrimeReactProvider } from 'primereact/api';
import { KeycloakProvider } from '../contexts/KeycloakContext';
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>
            <KeycloakProvider>
                <DevAuthProvider>
                    <AuthProvider>
                        <LayoutProvider>{children}</LayoutProvider>
                    </AuthProvider>
                </DevAuthProvider>
            </KeycloakProvider>
        </PrimeReactProvider>
    );
}