'use client' import type { FC } from 'react' import React, { useRef } from 'react' import cn from 'classnames' import Drawer from '@/app/components/base/drawer' import { XClose } from '@/app/components/base/icons/src/vender/line/general' import useBreakpoints, { MediaType } from '@/hooks/use-breakpoints' type Props = { isShow: boolean onHide: () => void panelClassName?: string maxWidthClassName?: string contentClassName?: string headerClassName?: string height?: number | string title: string | JSX.Element titleDescription?: string | JSX.Element body: JSX.Element foot?: JSX.Element isShowMask?: boolean clickOutsideNotOpen?: boolean } const DrawerPlus: FC = ({ isShow, onHide, panelClassName = '', maxWidthClassName = '!max-w-[640px]', height = 'calc(100vh - 72px)', contentClassName, headerClassName, title, titleDescription, body, foot, isShowMask, clickOutsideNotOpen = true, }) => { const ref = useRef(null) const media = useBreakpoints() const isMobile = media === MediaType.mobile if (!isShow) return null return ( // clickOutsideNotOpen to fix confirm modal click cause drawer close
{title}
{titleDescription && (
{titleDescription}
)}
{body}
{foot && (
{foot}
)}
) } export default React.memo(DrawerPlus)