22 lines
705 B
TypeScript
22 lines
705 B
TypeScript
|
|
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 shadow-lg w-[90%] h-[90%] min-w-[450px] min-h-[500px] max-w-[800px] max-h-[1000px] overflow-y-auto relative" onClick={(event) => { event.stopPropagation(); }}>
|
||
|
|
{children}
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
);
|
||
|
|
|
||
|
|
};
|
||
|
|
|
||
|
|
export default Modal;
|