'use client' import { FC } from 'react' import { Global } from '@emotion/react' import MUISwipeableDrawer from '@mui/material/SwipeableDrawer' import { SWIPE_AREA_WIDTH } from './constants' import { ContentContainer, Puller, SwipeableContainer } from './styled' import { SwipeableDrawerProps } from './types' const SwipeableDrawer: FC = ({ children, globalHeight = `calc(25% - ${SWIPE_AREA_WIDTH}px)`, ...props }) => ( <> .MuiPaper-root': { height: globalHeight, overflow: 'visible', }, '& .MuiDrawer-root': { userSelect: 'none', }, }} /> {/* @ts-ignore TODO: investigate 'JSXElementConstructor' is not a valid JSX element type */} {}} anchor="bottom" disableSwipeToOpen ModalProps={{ keepMounted: false, }} sx={{ '& -MuiBackdrop-root': { backgroundColor: 'rgba(0, 0, 0, 0.25)', }, }} {...props} > {children} ) export default SwipeableDrawer