35 lines
No EOL
1.1 KiB
TypeScript
35 lines
No EOL
1.1 KiB
TypeScript
import React from "react";
|
|
|
|
interface ModalProps {
|
|
title: string;
|
|
children: React.ReactNode;
|
|
onClose: () => void;
|
|
onConfirm: () => void;
|
|
}
|
|
|
|
const Modal: React.FC<ModalProps> = ({ title, children, onClose, onConfirm }) => {
|
|
return (
|
|
<div className="fixed inset-0 flex items-center justify-center bg-black bg-opacity-50">
|
|
<div className="bg-white rounded-lg shadow-lg w-full max-w-md p-6">
|
|
<h2 className="text-lg font-bold mb-4 text-gray-800">{title}</h2>
|
|
<div className="mb-4 space-y-4 text-gray-700">{children}</div> {/* Ajusta a cor do texto para cinza escuro */}
|
|
<div className="flex justify-end space-x-2">
|
|
<button
|
|
onClick={onClose}
|
|
className="px-4 py-2 bg-gray-300 text-gray-800 rounded hover:bg-gray-400"
|
|
>
|
|
Cancelar
|
|
</button>
|
|
<button
|
|
onClick={onConfirm}
|
|
className="px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700"
|
|
>
|
|
Confirmar
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default Modal; |