Sembunyikan header di halaman JS berikutnya
import { Fragment } from "react";
import MainHeader from "./../layout/main-header";
import { useRouter } from "next/router";
function Layout(props) {
const router = useRouter();
const showHeader = router.pathname === "/admin" ? false : true;
return (
<Fragment>
{showHeader && <MainHeader />}
<main>{props.children}</main>
</Fragment>
);
}
export default Layout;
Nabila