Files
ef_front/app/components/Modal.tsx

22 lines
637 B
TypeScript
Raw Permalink Normal View History

2025-09-07 22:57:43 +00:00
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;