'use client';

import { Suspense } from 'react';
import { ToastContainer } from '@/components/ui/Toast';
import AuthProvider from '@/components/SessionProvider';
import { PostHogProvider, PostHogPageView } from '@/components/PostHogProvider';
import CookieBanner from '@/components/CookieBanner';

export function Providers({ children }: { children: React.ReactNode }) {
    return (
        <PostHogProvider>
            <Suspense fallback={null}>
                <PostHogPageView />
            </Suspense>
            <AuthProvider>
                {children}
            </AuthProvider>
            <CookieBanner />
            <ToastContainer />
        </PostHogProvider>
    );
}
