Fixed NewLetter email delete function

This commit is contained in:
rockyeverlast
2024-06-04 20:25:24 +05:30
parent 5e7b46fe47
commit 5171423aa5

View File

@@ -181,8 +181,13 @@ const NewsLetter = () => {
size={"xs"}
colorScheme="red"
variant="ghost"
// onClick={() => {
// setDeleteAlert(true);
// }}
onClick={() => {
setActionId(item.id);
setDeleteAlert(true);
setActionStatus(item.status);
}}
>
<DeleteIcon me={2} /> Delete
@@ -214,57 +219,13 @@ const NewsLetter = () => {
totalPages={email?.data?.data?.totalPages}
noDataTitle={"NewsLetter"}
/>
{/* <CustomAlertDialog
<CustomAlertDialog
onClose={() => setDeleteAlert(false)}
isOpen={deleteAlert}
alertHandler={() => handleDelete(actionId)}
message={"Are you sure you want to delete Email?"}
isLoading={deleteIsLoading}
/> */}
<AlertDialog
motionPreset="slideInBottom"
// leastDestructiveRef={cancelRef}
onClose={() => setDeleteAlert(false)}
isOpen={deleteAlert}
isCentered
>
<AlertDialogOverlay />
<AlertDialogContent w={400}>
<AlertDialogCloseButton className="web-text-xsmall link" />
<AlertDialogBody
className="text-center web-text-large fw-bold"
pt={8}
>
Are you sure you want to delete Email?
</AlertDialogBody>
<AlertDialogFooter display={"flex"} justifyContent={"center"}>
<Button
size={"sm"}
// ref={cancelRef}
onClick={() => setDeleteAlert(false)}
>
No
</Button>
<Button
backgroundColor={"#ff6b6b"}
isLoading={deleteIsLoading}
// onClick={() => {
// email.forEach((item) => {
// handleDelete(item.id);
// });
// }}
onClick={() => handleDelete(actionId)}
size={"sm"}
colorScheme="red"
ml={3}
>
Yes
</Button>
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialog>
/>
</>
);
};