import ReactDOM from "react-dom/client";
import { createBrowserRouter, RouterProvider } from "react-router-dom";
import "./index.css";
import DefaultLayout from "./layouts/DefaultLayout";
import MasterplanPage from "./pages/MasterplanPage";
import ComplexPage from "./pages/ComplexPage";
import ComplexWingPage from "./pages/ComplexWingPage";
import AboutProjectsPage from "./pages/AboutProjectsPage";
import UnitTypesPage from "./pages/UnitTypesPage";
import AboutPage from "./pages/AboutPage";
import FavoritesPage from "./pages/FavoritesPage";
import SearchPage from "./pages/SearchPage";
import ApartmentPage from "./pages/ApartmentPage";
import VirtualTour from "./pages/VirtualTour";

const router = createBrowserRouter([
  {
    path: "/",
    element: <DefaultLayout />,
    children: [
      {
        index: true,
        element: <MasterplanPage />,
      },
      {
        path: "masterplan",
        element: <MasterplanPage />,
      },
      {
        path: "masterplan/:complexId",
        element: <ComplexPage />,
      },
      {
        path: "masterplan/:complexId/wing",
        element: <ComplexWingPage />,
      },
      {
        path: "about-projects",
        element: <AboutProjectsPage />,
      },
      {
        path: "unit-types",
        element: <UnitTypesPage />,
      },
      {
        path: "about",
        element: <AboutPage />,
      },
      {
        path: "favorites",
        element: <FavoritesPage />,
      },
      {
        path: "search",
        element: <SearchPage />,
      },
      {
        path: "search/:id",
        element: <ApartmentPage />,
      },
      {
        path: "virtual-tour/:appartmentTypeId",
        element: <VirtualTour />,
      },
    ],
  },
]);

ReactDOM.createRoot(document.getElementById("root")!).render(
  <RouterProvider router={router} />
);
