import Link from "next/link"; import { useRouter } from "next/router"; const Breadcrumb = () => { const router = useRouter(); return (
/
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 && !router.pathname.includes("/create") && !router.pathname.includes("/update") && !router.pathname.includes("/delete") && ( <>/
Project Details > )}