
import React from 'react';
import ReactDOM from 'react-dom/client';
import { BrowserRouter } from 'react-router-dom';
import App from '@/App';
import { AuthProvider } from '@/contexts/SupabaseAuthContext';
import { WalletProvider } from '@/contexts/WalletContext';
import { BtcPriceProvider } from '@/contexts/BtcPriceContext';
import { Toaster } from '@/components/ui/toaster';
import '@/index.css';

const AppProviders = ({ children }) => (
    <BrowserRouter>
        <AuthProvider>
            <WalletProvider>
                <BtcPriceProvider>
                    {children}
                </BtcPriceProvider>
            </WalletProvider>
        </AuthProvider>
    </BrowserRouter>
);

ReactDOM.createRoot(document.getElementById('root')).render(
  <React.StrictMode>
    <AppProviders>
        <App />
        <Toaster />
    </AppProviders>
  </React.StrictMode>
);
