import ReactDOM from "react-dom/client";
import { createBrowserRouter, RouterProvider } from "react-router-dom";
import Layout from "./components/header/Header/Layout";
import Masterplan from "./pages/Masterplan";
import Company from "./pages/Company";
import "./index.css";
import Complex from "./pages/Complex";
import ComplexWing from "./pages/ComplexWing";
import Search from "./pages/Search";
import SearchParticularApartments from "./pages/SearchParticularApartments";
import SearchApartment from "./pages/SearchApartment";
import Favorites from "./pages/Favorites";
import VirtualTour from "./pages/VirtualTour";
import AboutComplex from "./pages/AboutComplex";

const router = createBrowserRouter([
  {
    path: "/",
    element: <Layout />,
    children: [
      {
        path: "/",
        element: <Masterplan />,
      },
      {
        path: "/masterplan",
        element: <Masterplan />,
      },
      {
        path: "/masterplan/:complexId",
        element: <Complex />,
      },
      {
        path: "/masterplan/:complexId/aboutComplex",
        element: <AboutComplex />,
      },
      {
        path: "/masterplan/:complexId/wing",
        element: <ComplexWing />,
      },
      {
        path: "/company",
        element: <Company />,
      },
      {
        path: "/search",
        element: <Search />,
      },
      {
        path: "/search/:apartmentType",
        element: <SearchParticularApartments />,
      },
      {
        path: "/search/:apartmentType/:apartmentId",
        element: <SearchApartment />,
      },
      {
        path: "/favorites",
        element: <Favorites />,
      },
      {
        path: "virtual-tour/:appartmentTypeId",
        element: <VirtualTour />,
      },
    ],
  },
]);

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