{t("campaigns.domain")}
<_DataTable
table={table}
columns={columns}
count={count}
pageSize={PAGE_SIZE}
pagination
search
navigateTo={(row) => row.id}
isLoading={isLoading}
queryObject={raw}
orderBy={[
{ key: "name", label: t("fields.name") },
{ key: "created_at", label: t("fields.createdAt") },
{ key: "updated_at", label: t("fields.updatedAt") },
]}
/>
)
}
const CampaignActions = ({ campaign }: { campaign: AdminCampaign }) => {
const { t } = useTranslation()
const prompt = usePrompt()
const { mutateAsync } = useDeleteCampaign(campaign.id)
const handleDelete = async () => {
const confirm = await prompt({
title: t("general.areYouSure"),
description: t("campaigns.deleteCampaignWarning", {
name: campaign.name,
}),
verificationInstruction: t("general.typeToConfirm"),
verificationText: campaign.name,
confirmText: t("actions.delete"),
cancelText: t("actions.cancel"),
})
if (!confirm) {
return
}
await mutateAsync(undefined, {
onSuccess: () => {
toast.success(
t("campaigns.delete.successToast", { name: campaign.name })
)
},
onError: (e) => {
toast.error(e.message)
},
})
}
return (