import { createRoot } from "react-dom/client";
import "./index.css";
import { createBrowserRouter, RouterProvider } from "react-router";
import DefaultLayout from "./components/layouts/DefaultLayout.tsx";
import AboutPage from "./components/pages/AboutPage.tsx";
import ContactsPage from "./components/pages/ContactsPage.tsx";
import PopupContainer from "./components/ui/PopupContainer.tsx";
import SurroundingsPage from "./components/pages/SurroundingsPage.tsx";
import LayoutWithFooter from "./components/layouts/LayoutWithFooter.tsx";

const router = createBrowserRouter([
  {
    element: <DefaultLayout />,
    children: [
      {
        path: "/about",
        element: <AboutPage />,
      },
      {
        path: "/contacts",
        element: <ContactsPage />,
      },
    ],
  },
  {
    element: <LayoutWithFooter />,
    children: [
      {
        path: "/",
        element: <></>,
      },
      {
        path: "/surroundings",
        element: <SurroundingsPage />,
      },
    ],
  },
]);

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