Files
krafttrainer/frontend/src/components/layout/ConfirmDialog.tsx
Christoph K. dfd66e43c6 Initial commit
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-21 15:03:55 +01:00

41 lines
1.1 KiB
TypeScript
Executable File

interface ConfirmDialogProps {
isOpen: boolean;
title: string;
message: string;
onConfirm: () => void;
onCancel: () => void;
}
export function ConfirmDialog({
isOpen,
title,
message,
onConfirm,
onCancel,
}: ConfirmDialogProps) {
if (!isOpen) return null;
return (
<div className="fixed inset-0 z-50 flex items-center justify-center bg-black/60">
<div className="bg-gray-900 border border-gray-700 rounded-xl p-6 max-w-sm w-full mx-4 shadow-xl">
<h3 className="text-lg font-semibold text-gray-100 mb-2">{title}</h3>
<p className="text-gray-300 mb-6">{message}</p>
<div className="flex gap-3 justify-end">
<button
onClick={onCancel}
className="px-4 py-2 rounded-lg bg-gray-700 hover:bg-gray-600 text-gray-200 min-h-[44px] min-w-[44px]"
>
Abbrechen
</button>
<button
onClick={onConfirm}
className="px-4 py-2 rounded-lg bg-red-600 hover:bg-red-500 text-white min-h-[44px] min-w-[44px]"
>
Bestätigen
</button>
</div>
</div>
</div>
);
}