import { BrowserRouter, Route, Routes } from 'react-router-dom'
import { AdminPage } from '@pages/admin'
import { AdminOrganizationPage } from '@pages/admin-organization'
import { ROUTES } from '@shared/config/routes'
import { ScrollToTop } from './ScrollToTop'

export function RouterProvider() {
  return (
    <BrowserRouter>
      <ScrollToTop />
      <Routes>
        {/* Admin panel — own auth gate, independent of the user auth system */}
        <Route path={ROUTES.ADMIN} element={<AdminPage />} />
        <Route path={ROUTES.ADMIN_ORGANIZATION} element={<AdminOrganizationPage />} />
      </Routes>
    </BrowserRouter>
  )
}
