|
|
@@ -6,6 +6,9 @@ import Link from "next/link"; |
|
|
|
import MUILink from "@mui/material/Link"; |
|
|
|
import { usePathname } from "next/navigation"; |
|
|
|
import { useTranslation } from "react-i18next"; |
|
|
|
import Clock from "./Clock"; |
|
|
|
import { Grid } from "@mui/material"; |
|
|
|
import { I18nProvider } from "@/i18n"; |
|
|
|
|
|
|
|
const pathToLabelMap: { [path: string]: string } = { |
|
|
|
"": "Overview", |
|
|
@@ -39,34 +42,42 @@ const Breadcrumb = () => { |
|
|
|
|
|
|
|
// const { t } = useTranslation("customer"); |
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
<Breadcrumbs> |
|
|
|
{segments.map((segment, index) => { |
|
|
|
const href = segments.slice(0, index + 1).join("/"); |
|
|
|
const label = pathToLabelMap[href] || segment; |
|
|
|
<Grid container> |
|
|
|
<Grid item xs={6}> |
|
|
|
<Breadcrumbs> |
|
|
|
{segments.map((segment, index) => { |
|
|
|
const href = segments.slice(0, index + 1).join("/"); |
|
|
|
const label = pathToLabelMap[href] || segment; |
|
|
|
|
|
|
|
if (index === segments.length - 1) { |
|
|
|
return ( |
|
|
|
<Typography key={index} color="text.primary"> |
|
|
|
{label} |
|
|
|
{/* {t(label)} */} |
|
|
|
</Typography> |
|
|
|
); |
|
|
|
} else { |
|
|
|
return ( |
|
|
|
<MUILink |
|
|
|
underline="hover" |
|
|
|
color="inherit" |
|
|
|
key={index} |
|
|
|
component={Link} |
|
|
|
href={href || "/"} |
|
|
|
> |
|
|
|
{label} |
|
|
|
</MUILink> |
|
|
|
); |
|
|
|
} |
|
|
|
})} |
|
|
|
</Breadcrumbs> |
|
|
|
if (index === segments.length - 1) { |
|
|
|
return ( |
|
|
|
<Typography key={index} color="text.primary"> |
|
|
|
{label} |
|
|
|
{/* {t(label)} */} |
|
|
|
</Typography> |
|
|
|
); |
|
|
|
} else { |
|
|
|
return ( |
|
|
|
<MUILink |
|
|
|
underline="hover" |
|
|
|
color="inherit" |
|
|
|
key={index} |
|
|
|
component={Link} |
|
|
|
href={href || "/"} |
|
|
|
> |
|
|
|
{label} |
|
|
|
</MUILink> |
|
|
|
); |
|
|
|
} |
|
|
|
})} |
|
|
|
</Breadcrumbs> |
|
|
|
</Grid> |
|
|
|
<Grid item xs={6} sx={{ display: 'flex', justifyContent: 'flex-end' }}> |
|
|
|
<Clock /> |
|
|
|
</Grid> |
|
|
|
</Grid> |
|
|
|
); |
|
|
|
}; |
|
|
|
|
|
|
|