'use client' import type { FC } from 'react' import React, { useRef } from 'react' import { RiCloseLine } from '@remixicon/react' import cn from '@/utils/classnames' import Drawer from '@/app/components/base/drawer' 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 positionCenter?: boolean } const DrawerPlus: FC = ({ isShow, onHide, panelClassName = '', maxWidthClassName = '!max-w-[640px]', height = 'calc(100vh - 72px)', contentClassName, headerClassName, title, titleDescription, body, foot, isShowMask, clickOutsideNotOpen = true, positionCenter, }) => { 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)