import { createBrowserRouter, RouterProvider } from "react-router"
import RootLayout from "@/routes/__root"
import DashboardPage from "@/routes/dashboard"
import LoginPage from "@/routes/login"
import QuestionsPage from "@/routes/questions"
import CategoriesPage from "@/routes/categories"
import UsersPage from "@/routes/users"
import SettingsPage from "@/routes/settings"

const router = createBrowserRouter([
  {
    path: "/login",
    Component: LoginPage,
  },
  {
    path: "/",
    Component: RootLayout,
    children: [
      { index: true, Component: DashboardPage },
      { path: "questions", Component: QuestionsPage },
      { path: "categories", Component: CategoriesPage },
      { path: "users", Component: UsersPage },
      { path: "settings", Component: SettingsPage },
    ],
  },
])

export default function App() {
  return <RouterProvider router={router} />
}
