import { Dialog, Transition } from '@headlessui/react' import { Fragment } from 'react' import { XMarkIcon } from '@heroicons/react/24/outline' import classNames from '@/utils/classnames' // https://headlessui.com/react/dialog type IModal = { className?: string wrapperClassName?: string isShow: boolean onClose?: () => void title?: React.ReactNode description?: React.ReactNode children?: React.ReactNode closable?: boolean overflowVisible?: boolean } export default function Modal({ className, wrapperClassName, isShow, onClose = () => { }, title, description, children, closable = false, overflowVisible = false, }: IModal) { return (
{ e.preventDefault() e.stopPropagation() }} >
{title && {title} } {description && {description} } {closable &&
{ e.stopPropagation() onClose() } } />
} {children}
) }