import React, { useState } from 'react';

const Modal = ({ isOpen, onClose, children }: { isOpen: boolean, onClose: () => void, children: React.ReactNode }) => {
  if (!isOpen) return null;
  const handleClick = (e: React.MouseEvent<HTMLDivElement>) => {
    console.log(e);
  };

  return (

<div className="fixed inset-0 flex justify-center items-center"> <div className="absolute inset-0 bg-black opacity-50 " onClick={onClose}></div>
  <div className="bg-white p-8 rounded-xl shadow-lg w-[500px] h-[380px] relative" onClick={(event) => { event.stopPropagation(); }}>
    {children}
  </div>
</div>

  );
  
};

export default Modal;
