import { Button } from '@heroui/button' import { ModalBody, ModalContent, ModalFooter, ModalHeader, Modal as NextUIModal, useDisclosure } from '@heroui/modal' import React from 'react' export interface ModalProps { content: React.ReactNode title?: React.ReactNode size?: React.ComponentProps['size'] scrollBehavior?: React.ComponentProps['scrollBehavior'] onClose?: () => void onConfirm?: () => void onCancel?: () => void backdrop?: 'opaque' | 'blur' | 'transparent' showCancel?: boolean dismissible?: boolean confirmText?: string cancelText?: string } const Modal: React.FC = React.memo((props) => { const { backdrop = 'blur', title, content, showCancel = true, dismissible, confirmText = '确定', cancelText = '取消', onClose, onConfirm, onCancel, ...rest } = props const { onClose: onNativeClose } = useDisclosure() return ( { onClose?.() onNativeClose() }} classNames={{ backdrop: 'z-[99]', wrapper: 'z-[99]' }} {...rest} > {(nativeClose) => ( <> {title && ( {title} )} {content} {showCancel && ( )} )} ) }) Modal.displayName = 'Modal' export default Modal