All Downloads are FREE. Search and download functionalities are using the official Maven repository.

components.layout.dashboard.SidebarMenu.tsx Maven / Gradle / Ivy

There is a newer version: 0.80.3
Show newest version
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 (
     0 ? 'right' : 'left',
      }}
      transformOrigin={{
        vertical: 'top',
        horizontal: 'left',
      }}
    >
      
        {children}
      
    
  );
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy