diff --git a/src/Components/Header.jsx b/src/Components/Header.jsx
index 1f7e795..ff3251e 100644
--- a/src/Components/Header.jsx
+++ b/src/Components/Header.jsx
@@ -50,26 +50,10 @@ const Header = ({ link, btnTitle, title }) => {
{title}
*/}
- {btnTitle &&
- link &&
- (link === "" ? (
-
- }
- backgroundColor={"purple.900"}
- _hover={{
- backgroundColor: "purple.800",
- }}
- color={"whitesmoke"}
- size="sm"
- rounded={"sm"}
- >
- {btnTitle}
-
-
- ) : (
+ {btnTitle != "Export email" ? (
+
}
+ leftIcon={}
backgroundColor={"purple.900"}
_hover={{
backgroundColor: "purple.800",
@@ -77,11 +61,25 @@ const Header = ({ link, btnTitle, title }) => {
color={"whitesmoke"}
size="sm"
rounded={"sm"}
- onClick={handleDownload}
>
{btnTitle}
- ))}
+
+ ) : (
+ }
+ backgroundColor={"purple.900"}
+ _hover={{
+ backgroundColor: "purple.800",
+ }}
+ color={"whitesmoke"}
+ size="sm"
+ rounded={"sm"}
+ onClick={handleDownload}
+ >
+ {btnTitle}
+
+ )}
);
};
diff --git a/src/Pages/NewLetter/NewsLetter.jsx b/src/Pages/NewLetter/NewsLetter.jsx
index afc88a0..e969d0b 100644
--- a/src/Pages/NewLetter/NewsLetter.jsx
+++ b/src/Pages/NewLetter/NewsLetter.jsx
@@ -12,6 +12,15 @@ import {
Tooltip,
useToast,
} from "@chakra-ui/react";
+import {
+ AlertDialog,
+ AlertDialogBody,
+ AlertDialogCloseButton,
+ AlertDialogContent,
+ AlertDialogFooter,
+ AlertDialogOverlay,
+ useDisclosure,
+} from "@chakra-ui/react";
import { OPACITY_ON_LOAD } from "../../Layout/animations";
import { TABLE_PAGINATION } from "../../Constants/Paginations";
import {
@@ -43,8 +52,8 @@ const NewsLetter = () => {
const { data } = useGetNewsLetterQuery();
// console.log(useGetNewsletterQuery);
- const faq = data?.data?.rows;
- console.log(faq);
+ const email = data?.data?.rows;
+ console.log(email);
const [deleteEmail] = useDeleteEmailMutation();
// const [updateFaqStatus] = useUpdateFaqStatusMutation();
@@ -111,7 +120,7 @@ const NewsLetter = () => {
"Actions",
];
- const extractedArray = faq?.map((item, index) => {
+ const extractedArray = email?.map((item, index) => {
return {
Title: (
@@ -172,7 +181,9 @@ const NewsLetter = () => {
size={"xs"}
colorScheme="red"
variant="ghost"
- onClick={() => handleDelete(item.id)}
+ onClick={() => {
+ setDeleteAlert(true);
+ }}
>
Delete
@@ -189,7 +200,7 @@ const NewsLetter = () => {
title={"News Letter"}
btnTitle={"Export email"}
link={"/faq/add-faq"}
- apiData={faq}
+ apiData={email}
tableHeadRow={tableHeadRow}
extractedArray={extractedArray}
searchTerm={searchTerm}
@@ -200,16 +211,60 @@ const NewsLetter = () => {
setPageSize={setPageSize}
currentPage={currentPage}
setCurrentPage={setCurrentPage}
- totalPages={faq?.data?.data?.totalPages}
- noDataTitle={"faq"}
+ totalPages={email?.data?.data?.totalPages}
+ noDataTitle={"NewsLetter"}
/>
- setDeleteAlert(false)}
isOpen={deleteAlert}
alertHandler={() => handleDelete(actionId)}
- message={"Are you sure you want to delete Faq?"}
+ message={"Are you sure you want to delete Email?"}
isLoading={deleteIsLoading}
- />
+ /> */}
+
+ setDeleteAlert(false)}
+ isOpen={deleteAlert}
+ isCentered
+ >
+
+
+
+
+
+ Are you sure you want to delete Email?
+
+
+
+
+
+
+
>
);
};