import { useState } from "react";
import reactLogo from "./assets/react.svg";
import viteLogo from "/vite.svg";
import SignInUp from "./components/login-logout/signInup";
import LandingPage from "./components/landing-page/homePage.jsx";
import SignUp from "./components/login-logout/signUp.jsx";
import LogIn from "./components/login-logout/logIn.jsx";
import EndPoints from "./components/operations/endPoint.jsx";
import Features from "./components/operations/features.jsx";
import EditProfile from "./components/profile/editProfile.jsx";

import "./App.css";

// routing
import { createBrowserRouter, RouterProvider } from "react-router-dom";

const router = createBrowserRouter([
  {
    path: "/",
    element: <LandingPage />,
    children: [
      { path: "/end-points", element: <EndPoints /> },
      { path: "/features", element: <Features /> },
      { path: "/edit-profile", element: <EditProfile /> },
    ],
  },
  {
    path: "/",
    element: <SignInUp />,
    children: [
      { path: "sign-up", element: <SignUp /> },
      { path: "log-in", element: <LogIn /> },
    ],
  },
]);

function App() {
  const [resetNave, navResetFunction] = useState(false);

  const outerUpdate = () => {
    console.log("Update");
    navResetFunction((val) => (val = false));
  };

  return (
    <div
      className="containment"
      onClick={() => {
        outerUpdate();
      }}
    >
      <RouterProvider router={router} />
      {/* <SignInUp /> */}
    </div>
  );
}

export default App;
