import type { ReactNode } from 'react' ; import { Box } from '@chakra-ui/react' ; import Navbar from './Navbar' ; import Footer from './Footer' ; import { useRouter } from 'next/router' ; interface Props { children ? : ReactNode ; } const Layout = ( { children } ) => { const router = useRouter ( ) ; return ( < > < header > < Navbar /> < /header> < Box fontFamily = "Poppins" > { children } < /Box> < Box hidden = { router . pathname !== '/' } > < footer > < Footer /> < /footer> < /Box> < />); } ; export default Layout ;