import cn from 'classnames' import { FC, useRef } from 'react' import s from './Sidebar.module.css' import { Transition } from '@headlessui/react' import { useOverlay, useModal, OverlayContainer } from '@react-aria/overlays' import { useDialog } from '@react-aria/dialog' import { FocusScope } from '@react-aria/focus' interface Props { className?: string children?: any open?: boolean onClose: () => void } const Sidebar: FC = ({ className, children, open = false, onClose }) => { const rootClassName = cn(s.root, className) const ref = useRef(null) const { modalProps } = useModal() const { overlayProps } = useOverlay( { isOpen: open, isDismissable: true, onClose: onClose, }, ref ) const { dialogProps } = useDialog({}, ref) return (
{children}
) } export default Sidebar