import { BrowserRouter, Routes, Route } from 'react-router-dom';
import AppShell from '@/components/system/layout/AppShell';
import buildRoutes from '@/constants/routes/routes';
import { useEffect } from 'react';
import { Toaster } from '@/components/ui/toaster';

const App = () => {
  const isProd = process.env.NODE_ENV === 'production';
  useEffect(() => {}, []);
  return (
    <BrowserRouter basename={isProd ? '/AI-powered-switches' : '/'}>
      <Routes>
        <Route path="/" element={<AppShell />}>
          {buildRoutes()}
        </Route>
      </Routes>
      <Toaster />
    </BrowserRouter>
  );
};

export default App;
