File size: 649 Bytes
afa132e |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
import React, { ReactNode } from 'react';
type ModalProps = {
onClose: () => void;
children: ReactNode;
};
export default function Modal({ onClose, children }: ModalProps) {
return (
<div className="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50">
<div className="bg-white dark:bg-gray-800 p-6 rounded-lg max-w-2xl w-full max-h-[80vh] overflow-auto">
<button
onClick={onClose}
className="float-right text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200"
>
×
</button>
{children}
</div>
</div>
);
}
|