absoulute full due added

This commit is contained in:
2025-08-20 19:56:48 +05:30
parent 061fd45efd
commit 2c467b75e4
6 changed files with 370 additions and 124 deletions

View File

@@ -0,0 +1,44 @@
export const ConfirmationDialog = ({
isOpen,
title,
message,
confirmLabel = "Confirm",
cancelLabel = "Cancel",
confirmColor = "bg-blue-600 hover:bg-blue-700",
onConfirm,
onCancel,
}: {
isOpen: boolean;
title: string;
message: string | React.ReactNode;
confirmLabel?: string;
cancelLabel?: string;
confirmColor?: string;
onConfirm: () => void;
onCancel: () => void;
}) => {
if (!isOpen) return null;
return (
<div className="fixed inset-0 bg-black bg-opacity-50 flex justify-center items-center z-50">
<div className="bg-white p-6 rounded-md shadow-md w-[90%] max-w-md">
<h2 className="text-xl font-semibold mb-4">{title}</h2>
<p>{message}</p>
<div className="mt-6 flex justify-end space-x-4">
<button
className="bg-gray-200 px-4 py-2 rounded hover:bg-gray-300"
onClick={onCancel}
>
{cancelLabel}
</button>
<button
className={`${confirmColor} text-white px-4 py-2 rounded`}
onClick={onConfirm}
>
{confirmLabel}
</button>
</div>
</div>
</div>
);
};