import React, { useRef } from 'react'; import s from './DrawerCommon.module.scss'; import classNames from 'classnames'; import { IconClose } from 'src/components/icons'; interface Props { visible: boolean title?: string children?: React.ReactNode onClose: () => void } const DrawerCommon = ({ title, visible, children, onClose }: Props) => { const refInner = useRef(null) const handleClickOut = (e: any) => { if (e.target.contains(refInner.current)) { onClose() } } return (

{title}

{children}
) } export default DrawerCommon;