44 lines
1.1 KiB
TypeScript
44 lines
1.1 KiB
TypeScript
// components/common/ConfirmModal.tsx
|
|
import React from "react";
|
|
|
|
interface ConfirmModalProps {
|
|
open: boolean;
|
|
title?: string;
|
|
message: string;
|
|
onConfirm: () => void;
|
|
onCancel: () => void;
|
|
}
|
|
|
|
export default function ConfirmModal({
|
|
open,
|
|
title,
|
|
message,
|
|
onConfirm,
|
|
onCancel,
|
|
}: ConfirmModalProps) {
|
|
if (!open) return null;
|
|
|
|
return (
|
|
<div className="fixed inset-0 bg-black bg-opacity-40 flex items-center justify-center z-50">
|
|
<div className="bg-white p-6 rounded shadow-xl w-[360px] max-w-full text-center">
|
|
{title && <h2 className="text-lg font-semibold mb-3">{title}</h2>}
|
|
<p className="mb-6 text-gray-800">{message}</p>
|
|
<div className="flex justify-center gap-4">
|
|
<button
|
|
className="bg-gray-300 hover:bg-gray-400 text-black px-4 py-2 rounded"
|
|
onClick={onCancel}
|
|
>
|
|
Abbrechen
|
|
</button>
|
|
<button
|
|
className="bg-littwin-blue text-white px-4 py-2 rounded"
|
|
onClick={onConfirm}
|
|
>
|
|
Bestätigen
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|