import List from "@mui/material/List";
import ListItem from "@mui/material/ListItem";
import ListItemButton from "@mui/material/ListItemButton";
import ListItemIcon from "@mui/material/ListItemIcon";
import ListItemText from "@mui/material/ListItemText";
import Stack from "@mui/material/Stack";
import HomeRoundedIcon from "@mui/icons-material/HomeRounded";
import AnalyticsRoundedIcon from "@mui/icons-material/AnalyticsRounded";
import FormatListBulletedIcon from "@mui/icons-material/FormatListBulleted";
import { Link, useLocation } from "react-router-dom";
import { useSelector } from "react-redux";
import { RootState } from "../../redux/store/store";
import DashboardOutlinedIcon from "@mui/icons-material/DashboardOutlined";
import ManageAccountsOutlinedIcon from "@mui/icons-material/ManageAccountsOutlined";
//Eknoor singh and Jaanvi
//date:- 12-Feb-2025
//Made a different variable for super admin to access all the details.
type PropType = {
hidden: boolean;
};
export default function MenuContent({ hidden }: PropType) {
const location = useLocation();
const userRole = useSelector(
(state: RootState) => state.profileReducer.user?.userType
);
const baseMenuItems = [
{
text: "Dashboard",
icon: ,
url: "/panel/dashboard",
},
userRole === "superadmin" && {
text: "Admins",
icon: ,
url: "/panel/admin-list",
},
userRole === "admin" && {
text: "Users",
icon: ,
url: "/panel/user-list",
},
userRole === "superadmin" && {
text: "Roles",
icon: ,
url: "/panel/role-list",
},
userRole === "admin" && {
text: "Vehicles",
icon: ,
url: "/panel/vehicle-list",
},
];
const filteredMenuItems = baseMenuItems.filter(Boolean);
return (
{filteredMenuItems.map((item, index) => (
{/* Wrap ListItemButton with Link to enable routing */}
{item.icon}
))}
);
}