|
|
@@ -17,6 +17,7 @@ import { useTranslation } from "react-i18next"; |
|
|
|
import Typography from "@mui/material/Typography"; |
|
|
|
import { usePathname } from "next/navigation"; |
|
|
|
import Link from "next/link"; |
|
|
|
import { NAVIGATION_CONTENT_WIDTH } from "@/config/uiConfig"; |
|
|
|
|
|
|
|
interface NavigationItem { |
|
|
|
icon: React.ReactNode; |
|
|
@@ -25,7 +26,7 @@ interface NavigationItem { |
|
|
|
} |
|
|
|
|
|
|
|
const navigationItems: NavigationItem[] = [ |
|
|
|
{ icon: <WorkHistory />, label: "User Workspace", path: "/workspace" }, |
|
|
|
{ icon: <WorkHistory />, label: "User Workspace", path: "/home" }, |
|
|
|
{ icon: <Dashboard />, label: "Dashboard", path: "/dashboard" }, |
|
|
|
{ icon: <RequestQuote />, label: "Expense Claim", path: "/claim" }, |
|
|
|
{ icon: <Assignment />, label: "Project Management", path: "/projects" }, |
|
|
@@ -40,7 +41,7 @@ const NavigationContent: React.FC = () => { |
|
|
|
const pathname = usePathname(); |
|
|
|
|
|
|
|
return ( |
|
|
|
<Box> |
|
|
|
<Box sx={{ width: NAVIGATION_CONTENT_WIDTH }}> |
|
|
|
<Box sx={{ p: "1.5rem" }}> |
|
|
|
{/* Replace this with company logo and/or name */} |
|
|
|
<Typography variant="h4">TSMS</Typography> |
|
|
@@ -49,13 +50,17 @@ const NavigationContent: React.FC = () => { |
|
|
|
<List component="nav"> |
|
|
|
{navigationItems.map(({ icon, label, path }, index) => { |
|
|
|
return ( |
|
|
|
<ListItemButton |
|
|
|
<Box |
|
|
|
key={`${label}-${index}`} |
|
|
|
selected={pathname.includes(path)} |
|
|
|
component={Link} |
|
|
|
href={path} |
|
|
|
sx={{ textDecoration: "none", color: "inherit" }} |
|
|
|
> |
|
|
|
<ListItemIcon>{icon}</ListItemIcon> |
|
|
|
<ListItemText primary={<Link href={path}>{t(label)}</Link>} /> |
|
|
|
</ListItemButton> |
|
|
|
<ListItemButton selected={pathname.includes(path)}> |
|
|
|
<ListItemIcon>{icon}</ListItemIcon> |
|
|
|
<ListItemText primary={t(label)} /> |
|
|
|
</ListItemButton> |
|
|
|
</Box> |
|
|
|
); |
|
|
|
})} |
|
|
|
</List> |
|
|
|