import { createRoot } from 'react-dom/client';
import App from './App.tsx';
import { AdminApp } from './components/AdminApp.tsx';
import { ErrorBoundary } from './components/ErrorBoundary.tsx';
import './index.css';

const pathname = window.location.pathname;
const isAdminRoute = pathname === '/admin' || pathname.startsWith('/admin/');

createRoot(document.getElementById('root')!).render(
  <ErrorBoundary>{isAdminRoute ? <AdminApp /> : <App />}</ErrorBoundary>,
);
