'use client';
import { X, AlertTriangle, Info, CheckCircle, XCircle } from 'lucide-react';
import { useEffect } from 'react';
interface CustomModalProps {
isOpen: boolean;
onClose: () => void;
title: string;
message: string;
type?: 'warning' | 'error' | 'success' | 'info';
confirmText?: string;
cancelText?: string;
onConfirm?: () => void;
showCancel?: boolean;
}
export default function CustomModal({
isOpen,
onClose,
title,
message,
type = 'info',
confirmText = 'OK',
cancelText = 'Cancel',
onConfirm,
showCancel = false,
}: CustomModalProps) {
useEffect(() => {
if (isOpen) {
document.body.style.overflow = 'hidden';
} else {
document.body.style.overflow = 'unset';
}
return () => {
document.body.style.overflow = 'unset';
};
}, [isOpen]);
if (!isOpen) return null;
const getIcon = () => {
switch (type) {
case 'warning':
return
{message}
{/* Actions */}