42 lines
966 B
TypeScript
42 lines
966 B
TypeScript
import React from "react";
|
|
import ConfirmActionModal from "../modals/ConfirmActionModal";
|
|
|
|
type DeleteConfirmationModalProps = {
|
|
open: boolean;
|
|
title?: string;
|
|
description?: string;
|
|
confirmText?: string;
|
|
cancelText?: string;
|
|
loading?: boolean;
|
|
onConfirm: () => void;
|
|
onCancel: () => void;
|
|
children?: React.ReactNode;
|
|
};
|
|
|
|
export default function DeleteConfirmationModal({
|
|
open,
|
|
title = "Delete Item",
|
|
description = "Are you sure you want to delete this item? This action cannot be undone.",
|
|
confirmText = "Delete",
|
|
cancelText = "Cancel",
|
|
loading = false,
|
|
onConfirm,
|
|
onCancel,
|
|
children,
|
|
}: DeleteConfirmationModalProps) {
|
|
return (
|
|
<ConfirmActionModal
|
|
open={open}
|
|
pending={loading}
|
|
intent="danger"
|
|
title={title}
|
|
description={description}
|
|
confirmText={confirmText}
|
|
cancelText={cancelText}
|
|
onConfirm={onConfirm}
|
|
onClose={onCancel}
|
|
extraContent={children}
|
|
/>
|
|
);
|
|
}
|