mirror of
https://github.com/Stirling-Tools/Stirling-PDF.git
synced 2026-09-02 21:03:34 +03:00
<img width="1002" height="487" alt="Screenshot 2026-06-11 at 6 20 10 PM" src="https://github.com/user-attachments/assets/5ee3cfc2-6c4f-4b35-9586-ef45fa216c6a" />
49 lines
1.3 KiB
TypeScript
49 lines
1.3 KiB
TypeScript
import { Modal, Text, Button, Stack, Group } from "@mantine/core";
|
|
import { useTranslation } from "react-i18next";
|
|
|
|
interface PolicyDeleteConfirmModalProps {
|
|
opened: boolean;
|
|
/** The policy's display label (the category name). */
|
|
label: string;
|
|
onConfirm: () => void;
|
|
onCancel: () => void;
|
|
}
|
|
|
|
/** Confirm before deleting a policy — removing it discards its backing workflow. */
|
|
export function PolicyDeleteConfirmModal({
|
|
opened,
|
|
label,
|
|
onConfirm,
|
|
onCancel,
|
|
}: PolicyDeleteConfirmModalProps) {
|
|
const { t } = useTranslation();
|
|
return (
|
|
<Modal
|
|
opened={opened}
|
|
onClose={onCancel}
|
|
title={t("policies.deleteConfirmTitle", "Delete {{label}} policy?", {
|
|
label,
|
|
})}
|
|
centered
|
|
size="sm"
|
|
>
|
|
<Stack gap="md">
|
|
<Text size="sm">
|
|
{t(
|
|
"policies.deleteConfirmBody",
|
|
"This removes the policy and its workflow. Documents already processed are not affected.",
|
|
)}
|
|
</Text>
|
|
<Group gap="sm" justify="flex-end">
|
|
<Button variant="outline" size="sm" onClick={onCancel}>
|
|
{t("cancel", "Cancel")}
|
|
</Button>
|
|
<Button color="red" size="sm" onClick={onConfirm}>
|
|
{t("delete", "Delete")}
|
|
</Button>
|
|
</Group>
|
|
</Stack>
|
|
</Modal>
|
|
);
|
|
}
|