feat: add reusable confirmation dialogs for destructive actions

This commit is contained in:
cesnimda
2026-03-22 14:12:00 +01:00
parent 0863728eab
commit 758d2c6a0b
8 changed files with 107 additions and 15 deletions
@@ -95,7 +95,7 @@ export default function Attachments({ jobId }: { jobId: number }) {
};
const remove = async (a: AttachmentItem) => {
if (!confirmAction(`Delete attachment "${a.fileName}"?`)) return;
if (!(await confirmAction(`Delete attachment "${a.fileName}"?`, { title: "Delete attachment", confirmLabel: "Delete", destructive: true }))) return;
try {
await api.delete(`/attachments/${a.id}`);
toast("Deleted attachment.", "success");