import { Outlet, useLocation } from "react-router";
import NavMenu from "./NavMenu";
import { useEffect } from "react";

function LayoutWithFooter() {
  const location = useLocation();

  useEffect(() => {
    window.scrollTo(0, 0);
  }, [location.pathname]);

  return (
    <div className="min-h-dvh bg-[#F7F6F3]">
      <NavMenu />
      <main className="h-dvh">
        <Outlet />
      </main>
    </div>
  );
}

export default LayoutWithFooter;
