import { Layout, Menu, Row } from "antd"; import Link from "next/link"; import { useRouter } from "next/router"; const { Header, Content, Footer } = Layout; export const withLayout = (Component: (arg: any) => JSX.Element) => ({ ...props }: any) => { const { route } = useRouter(); const menuItems = [ { label: "Home", path: "/" }, { label: "Bills", path: "/bills" }, ]; return ( <>
🍉 Melon item.path === route) + 1).toString(), ]} > {menuItems.map(({ label, path }, index) => ( {label} ))}
); };