import React from 'react';
import { BrowserRouter as Router } from 'react-router-dom';
import { ToastContainer } from 'react-toastify';
import 'react-toastify/dist/ReactToastify.css';
import { AuthProvider } from './context/AuthContext';
import { NotificationProvider } from './context/NotificationContext';
import { ThemeProvider } from './context/ThemeContext';
import AppRoutes from './routes';
import AiChatWidget from './components/common/AiChatWidget';

function App() {
  return (
    <Router>
      <ThemeProvider>
      <AuthProvider>
        <NotificationProvider>
          <div className="app">
            <AppRoutes />
            <AiChatWidget />
            <ToastContainer
              position="top-right"
              autoClose={3000}
              hideProgressBar={false}
              newestOnTop
              closeOnClick
              rtl={false}
              pauseOnFocusLoss
              draggable
              pauseOnHover
            />
          </div>
        </NotificationProvider>
      </AuthProvider>
      </ThemeProvider>
    </Router>
  );
}

export default App;
