mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-11-04 18:32:51 +00:00
30 lines
672 B
TypeScript
30 lines
672 B
TypeScript
|
|
"use client";
|
||
|
|
|
||
|
|
import React from "react";
|
||
|
|
|
||
|
|
interface ModalProps {
|
||
|
|
isOpen: boolean;
|
||
|
|
onClose: () => void;
|
||
|
|
children: React.ReactNode;
|
||
|
|
}
|
||
|
|
|
||
|
|
const Modal: React.FC<ModalProps> = ({ isOpen, onClose, children }) => {
|
||
|
|
if (!isOpen) return null;
|
||
|
|
|
||
|
|
return (
|
||
|
|
<div className="fixed inset-0 bg-black bg-opacity-50 flex justify-center items-center z-50">
|
||
|
|
<div className="bg-white p-6 rounded-lg shadow-lg w-3/4 max-w-4xl relative">
|
||
|
|
<button
|
||
|
|
onClick={onClose}
|
||
|
|
className="absolute top-2 right-2 bg-red-500 text-white p-1 rounded"
|
||
|
|
>
|
||
|
|
✖
|
||
|
|
</button>
|
||
|
|
{children}
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
);
|
||
|
|
};
|
||
|
|
|
||
|
|
export default Modal;
|