'use client';

import { Suspense } from 'react';
import { ToastContainer } from '@/components/ui/Toast';
import AuthProvider from '@/components/SessionProvider';
import { PostHogProvider } from '@/components/PostHogProvider';
import CookieBanner from '@/components/CookieBanner';
import GoogleAnalytics from '@/components/analytics/GoogleAnalytics';
import FacebookPixel from '@/components/analytics/FacebookPixel';

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