import React from "react"; import { useRouter } from "next/router"; import Link from "next/link"; import AppBar from "@material-ui/core/AppBar"; import Tabs from "@material-ui/core/Tabs"; import Tab from "@material-ui/core/Tab"; import routes from "../routes"; const TopAppBar = () => { const router = useRouter(); const pathname = ( routes.find(({ pathname }) => pathname === router.pathname) || { pathname: "/", } ).pathname; return ( {routes.map(({ pathname, icon }) => ( ((props, ref) => ( ))} /> ))} ); }; export default TopAppBar;