import React from "react";
import { Outlet, useLocation } from "react-router-dom";
import Navbar from "./Navbar";
import Footer from "./Footer";

const Layout = () => {
  const location = useLocation();

  // Hide footer on specific pages
  const hideFooterPages = ["/", "/ForgetPw", "/ResetPw"];
  const shouldHideFooter = hideFooterPages.includes(location.pathname);

  return (
    <div className="app-container">
      <Navbar />
      <div className="content">
        <Outlet /> {/* Current page renders here */}
      </div>
      {!shouldHideFooter && <Footer />}
    </div>
  );
};

export default Layout;
