'use client' import { Dialog } from '@headlessui/react' import { useTranslation } from 'react-i18next' import { XMarkIcon } from '@heroicons/react/24/outline' import Button from '../button' import cn from '@/utils/classnames' export type IDrawerProps = { title?: string description?: string panelClassname?: string children: React.ReactNode footer?: React.ReactNode mask?: boolean positionCenter?: boolean isOpen: boolean showClose?: boolean clickOutsideNotOpen?: boolean onClose: () => void onCancel?: () => void onOk?: () => void } export default function Drawer({ title = '', description = '', panelClassname = '', children, footer, mask = true, positionCenter, showClose = false, isOpen, clickOutsideNotOpen, onClose, onCancel, onOk, }: IDrawerProps) { const { t } = useTranslation() return ( !clickOutsideNotOpen && onClose()} className="fixed z-30 inset-0 overflow-y-auto" >
{/* mask */}
<> {title && {title} } {showClose && } {description && {description}} {children} {footer || (footer === null ? null :
)}
) }