components.layout.dashboard.SidebarMenu.tsx Maven / Gradle / Ivy
import Menu from '@mui/material/Menu';
import React from 'react';
import { ReactChildren, SetState } from 'types/react';
import SidebarContextProvider from 'contexts/SidebarContext';
import { useSidebarContext } from 'hooks/sidebar';
export type SidebarItemType = "group" | "cascading" | "item"
export type SidebarItemProps = {
type: SidebarItemType,
key: string,
ref?: string,
children?: Array,
label?: string,
href?: string,
icon?: string,
activeIcon?: string
}
type SidebarMenuProps = {
anchorEl: null | HTMLElement
setAnchorEl: SetState,
children: ReactChildren
}
export default function SidebarMenu({children, anchorEl, setAnchorEl}: SidebarMenuProps){
const { level, sidebarType, handleMenuClose } = useSidebarContext()
const handleClose = () => {
setAnchorEl(null);
handleMenuClose()
};
return (
);
}