Almost finish implementing client side
This commit is contained in:
21
Client/app/components/Modal.tsx
Normal file
21
Client/app/components/Modal.tsx
Normal file
@@ -0,0 +1,21 @@
|
||||
import Icon, { ICONS } from "./Icon";
|
||||
|
||||
interface ModalProps {
|
||||
isOpen: boolean;
|
||||
onClose: () => void;
|
||||
children: React.ReactNode;
|
||||
}
|
||||
|
||||
export default function Modal({ isOpen, onClose, children }: ModalProps) {
|
||||
if (!isOpen) return null;
|
||||
return (
|
||||
<div className="fixed inset-0 bg-black bg-opacity-50 z-50 flex justify-center items-center p-4">
|
||||
<div className="bg-white rounded-lg shadow-xl w-full max-w-md p-6 relative">
|
||||
<button onClick={onClose} className="absolute top-3 right-3 text-gray-400 hover:text-gray-600">
|
||||
<Icon path={ICONS.close} />
|
||||
</button>
|
||||
{children}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user