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