// ** React Imports import { Fragment, useEffect } from 'react' // ** MUI Imports import Backdrop from '@mui/material/Backdrop' import Box, { BoxProps } from '@mui/material/Box' // ** Types import { SidebarType } from './type' const Sidebar = (props: BoxProps & SidebarType) => { // ** Props const { sx, show, direction, children, hideBackdrop, onOpen, onClose, backDropClick } = props const handleBackdropClick = () => { if (backDropClick) { backDropClick() } } useEffect(() => { if (show && onOpen) { onOpen() } if (show === false && onClose) { onClose() } }, [onClose, onOpen, show]) return ( {children} {hideBackdrop ? null : ( theme.zIndex.drawer - 1 }} /> )} ) } export default Sidebar Sidebar.defaultProps = { direction: 'left' }