Add confirmation modal

This commit is contained in:
2026-07-29 04:13:38 -04:00
parent 9be3f50344
commit aecb3679fd
2 changed files with 53 additions and 0 deletions
+39
View File
@@ -0,0 +1,39 @@
import type { FC } from "react";
type ConfirmModalProps = {
message: string;
onConfirm: () => void;
onCancel: () => void;
};
const ConfirmModal: FC<ConfirmModalProps> = ({
message,
onConfirm,
onCancel,
}) => {
return (
<div className="fixed inset-0 z-50 flex items-center justify-center bg-black/60">
<div className="flex flex-col gap-6 rounded-lg bg-slate-800 p-8 shadow-xl">
<p className="text-lg font-semibold">{message}</p>
<div className="flex justify-end gap-4">
<button
type="button"
onClick={onCancel}
className="rounded-lg bg-slate-700 px-4 py-2 font-semibold hover:bg-slate-600"
>
Cancel
</button>
<button
type="button"
onClick={onConfirm}
className="rounded-lg bg-emerald-600 px-4 py-2 font-semibold hover:bg-emerald-500"
>
Confirm
</button>
</div>
</div>
</div>
);
};
export default ConfirmModal;