import React, { useState, useEffect } from 'react'; import { motion, AnimatePresence } from 'framer-motion'; import { X, Check, Info } from 'lucide-react'; const Modal = ({ isOpen, onClose, onConfirm, title, message, type = 'confirm', initialValue = '', placeholder = 'Enter something...', confirmText = 'OK', cancelText = 'Cancel' }) => { const [inputValue, setInputValue] = useState(initialValue); useEffect(() => { if (isOpen) { setInputValue(initialValue); } }, [isOpen, initialValue]); const handleSubmit = (e) => { e.preventDefault(); if (type === 'prompt') { onConfirm(inputValue); } else { onConfirm(); } onClose(); }; return ( {isOpen && (
{/* Backdrop */} {/* Modal Content */}

{title}

{message && (

{message}

)}
{type === 'prompt' && (
setInputValue(e.target.value)} placeholder={placeholder} className="w-full bg-surface-container-low border-b-2 border-primary/20 focus:border-primary px-2 py-3 text-xl font-body-md outline-none transition-all" />
)}
{confirmText}
{/* Decorative Sketched Element */}
)} ); }; export default Modal;