"use client"; import Breadcrumbs from "@mui/material/Breadcrumbs"; import Typography from "@mui/material/Typography"; import Link from "next/link"; import MUILink from "@mui/material/Link"; import { usePathname } from "next/navigation"; const pathToLabelMap: { [path: string]: string } = { "": "Overview", "/projects": "Projects", "/projects/create": "Create Project", "/tasks": "Task Template", "/tasks/create": "Create Task Template", "/settings/qcItem": "Qc Item", "/settings/rss": "Demand Forecast Setting", "/scheduling/rough": "Demand Forecast", "/scheduling/rough/edit": "FG & Material Demand Forecast Detail", "/scheduling/detail": "Detail Scheduling", "/scheduling/detail/edit": "FG Production Schedule", "/inventory": "Inventory", "/settings/importTesting": "Import Testing", "/do": "Delivery Order", }; const Breadcrumb = () => { const pathname = usePathname(); const segments = pathname.split("/"); return ( {segments.map((segment, index) => { const href = segments.slice(0, index + 1).join("/"); const label = pathToLabelMap[href] || segment; if (index === segments.length - 1) { return ( {label} ); } else { return ( {label} ); } })} ); }; export default Breadcrumb;