From f8a9d5b250216eb3c3d9ed6d35664fb626459003 Mon Sep 17 00:00:00 2001 From: AFFAANh Date: Mon, 3 Aug 2026 17:33:32 +0530 Subject: [PATCH] feat(campaigns): add a delete action with a scope-aware confirmation The dialog says what will actually be destroyed, which differs by case: a synced MaskanX campaign is deleted on Meta too, an imported one is only forgotten here, and a draft never reached Meta at all. Co-Authored-By: Claude Opus 5 --- src/pages/Campaigns/CampaignActions.tsx | 30 +++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/pages/Campaigns/CampaignActions.tsx b/src/pages/Campaigns/CampaignActions.tsx index 43233b2..5547d2d 100644 --- a/src/pages/Campaigns/CampaignActions.tsx +++ b/src/pages/Campaigns/CampaignActions.tsx @@ -59,6 +59,26 @@ export default function CampaignActions({ campaign, account, onChanged }: Props) const isImported = campaign.origin === "imported"; + // Deleting a synced campaign also deletes it on Meta, so the dialog says + // which of the two is about to happen. + const confirmDelete = () => { + Modal.confirm({ + title: "Delete this campaign?", + okText: "Delete", + okButtonProps: { danger: true }, + content: ( + + {isImported + ? "MaskanX will forget this campaign. It stays in Meta, where it was created." + : campaign.meta_campaign_id + ? "This deletes the campaign, ad set and ad on Meta as well. It cannot be undone." + : "This campaign was never sent to Meta, so only the MaskanX record is removed."} + + ), + onOk: () => run("Delete", () => api.deleteCampaign(campaign.id)), + }); + }; + return ( {campaign.status === "approved" && !isImported && ( @@ -105,6 +125,16 @@ export default function CampaignActions({ campaign, account, onChanged }: Props) Stop )} + + ); }