import Link from "next/link"; import { useRouter } from "next/router"; const Breadcrumb = () => { const router = useRouter(); return (
{router.pathname.startsWith("/projects") && (

/

Projects {router.pathname.replace("/projects", "") === "/create" && ( <>

/

Create Project )} {/* if path contains only one slash, it means page is project details */} {(router.pathname.match(new RegExp("/", "g")) || []).length == 2 && ( <>

/

Project Details )}
)}
); }; export default Breadcrumb;