import { AlertTriangle, CheckCircle, XCircle, Info } from 'lucide-react';
import { createPortal } from 'react-dom';
export type ModalType = 'confirm' | 'success' | 'error' | 'info';
interface ModalDialogProps {
isOpen: boolean;
title: string;
message: string;
type?: ModalType;
onConfirm: () => void;
onCancel?: () => void;
confirmText?: string;
cancelText?: string;
isDestructive?: boolean;
}
export default function ModalDialog({
isOpen,
title,
message,
type = 'confirm',
onConfirm,
onCancel,
confirmText = '确定',
cancelText = '取消',
isDestructive = false
}: ModalDialogProps) {
if (!isOpen) return null;
const getIcon = () => {
switch (type) {
case 'success':
return
{message}