);
diff --git a/components/AdminKeysManagement.tsx b/components/AdminKeysManagement.tsx
new file mode 100644
index 0000000..972cd7a
--- /dev/null
+++ b/components/AdminKeysManagement.tsx
@@ -0,0 +1,257 @@
+"use client";
+
+import React, { useState } from "react";
+import { useQuery } from "@tanstack/react-query";
+import { GenerateKeyPair, GetKeys } from "@/utils/adminApi";
+
+import {
+ AlertDialog,
+ AlertDialogAction,
+ AlertDialogCancel,
+ AlertDialogContent,
+ AlertDialogDescription,
+ AlertDialogFooter,
+ AlertDialogHeader,
+ AlertDialogTitle,
+ AlertDialogTrigger,
+} from "@/components/ui/alert-dialog";
+import { Button } from "@/components/ui/button";
+import { ThreeDots } from "react-loader-spinner";
+
+import {
+ Form,
+ FormControl,
+ FormDescription,
+ FormField,
+ FormItem,
+ FormLabel,
+ FormMessage,
+} from "@/components/ui/form";
+import { Input } from "@/components/ui/input";
+
+
+// const FormSchema = z.object({
+// title: z.string().min(2, {
+// message: "trackingNumber must be at least 2 characters.",
+// }),
+// password: z.string().min(4, {
+// message: "Password must be at least 4 characters.",
+// }),
+// });
+
+export default function AdminKeysManagement() {
+ // List Keys
+ const {
+ data: data1,
+ error: Error1,
+ isLoading: isListLoading,
+ refetch: refetch1,
+ } = useQuery({
+ queryKey: ["KeysList"],
+ queryFn: () => GetKeys(),
+ // refetchOnWindowFocus: false,
+ });
+ console.log(data1);
+
+ // GenerateKeyPair
+ const {
+ data: data2,
+ error: Error2,
+ isLoading: isNewKeyLoading,
+ refetch: refetch2,
+ } = useQuery({
+ queryKey: ["GenerateKey"],
+ queryFn: () => GenerateKeyPair(),
+ enabled: false, // Disable automatic fetching
+ });
+ const handleClick = () => {
+ refetch2();
+ console.log(data2);
+ // Manually trigger the query when the button is clicked
+ };
+
+ // }
+ return (
+
+
+ {/* 1 */}
+
+
+
+
+
+
+ اطلاعات کلید جدید
+
+ {isNewKeyLoading ? (
+
+
+
+ ) : (
+
+
+ کلید عمومی :
+
+
+ {data2?.publicKey}
+
+
+
+ کلید خصوصی :
+
+
+ {data2?.privateKey}
+
+
+ )}
+
+
+
+ بستن
+ {/* Continue */}
+
+
+
+
+ {/* 1 */}
+
+
+
+
+
+
+ افزودن کلید جدید
+
+ {isNewKeyLoading ? (
+
+
+
+ ) : (
+ <>>
+ //
+ //
+ )}
+
+
+
+ بستن
+ {/* Continue */}
+
+
+
+
+
+ لیست کلیدها
+
+ {/* 2 */}
+
+ {data1?.map((item: any) => {
+ return (
+
+
+ عنوان کلید :
+ {item.title}
+
+
+ آی دی بازرس :
+
+ {item.inspectorId}
+
+
+
+ );
+ })}
+
+
+
+ );
+}
diff --git a/components/AdminManagement.tsx b/components/AdminUserManagement.tsx
similarity index 99%
rename from components/AdminManagement.tsx
rename to components/AdminUserManagement.tsx
index 5b3f89e..827cd7d 100644
--- a/components/AdminManagement.tsx
+++ b/components/AdminUserManagement.tsx
@@ -22,7 +22,7 @@ import { Button } from "./ui/button";
import { AdminCardItems } from "@/constants";
import TableAdmin from "./TableAdmin";
-export default function AdminManagement() {
+export default function AdminUserManagement() {
return (
diff --git a/components/ComplainsDetails.tsx b/components/ComplainsDetails.tsx
index 92f39a4..92ce15e 100644
--- a/components/ComplainsDetails.tsx
+++ b/components/ComplainsDetails.tsx
@@ -90,7 +90,7 @@ export default function ComplainsDetails({ id }: { id: number }) {
{data.contents?.map((item: any) => {
return (
-
+
{item.sender == 0 ? "شهروند" : "بازرس"}
@@ -110,7 +110,7 @@ export default function ComplainsDetails({ id }: { id: number }) {
})}
{data.contents?.map((item: any) => {
return (
-
+
{item.sender == 0 ? "شهروند" : "بازرس"}
@@ -130,7 +130,7 @@ export default function ComplainsDetails({ id }: { id: number }) {
})}
{data.contents?.map((item: any) => {
return (
-
+
{item.sender == 0 ? "شهروند" : "بازرس"}
@@ -150,7 +150,7 @@ export default function ComplainsDetails({ id }: { id: number }) {
})}
{data.contents?.map((item: any) => {
return (
-
+
{item.sender == 0 ? "شهروند" : "بازرس"}
@@ -170,7 +170,7 @@ export default function ComplainsDetails({ id }: { id: number }) {
})}
{data.contents?.map((item: any) => {
return (
-
+
{item.sender == 0 ? "شهروند" : "بازرس"}
@@ -190,7 +190,7 @@ export default function ComplainsDetails({ id }: { id: number }) {
})}
{data.contents?.map((item: any) => {
return (
-
+
{item.sender == 0 ? "شهروند" : "بازرس"}
diff --git a/components/FollowResult.tsx b/components/FollowResult.tsx
index a955e20..1ed4fc2 100644
--- a/components/FollowResult.tsx
+++ b/components/FollowResult.tsx
@@ -30,20 +30,27 @@ export default function FollowResult() {
const [trackingNumber, setTrackingNumber] = useState();
const [password, setPassword] = useState();
const [complaintData, setComplaintData] = useState();
+ const [printStyle, setPrintStyle] = useState(true);
// Print component Data
const componentRef = useRef(null);
const handlePrint = useReactToPrint({
- content: () => componentRef.current
+ content: () => componentRef.current,
+ // onBeforePrint() {
+ // setPrintStyle(!printStyle);
+ // },
+ // onAfterPrint() {
+ // setPrintStyle(!printStyle)
+ // },
});
-
-
+
useEffect(() => {
setTrackingNumber(localStorage.getItem("trackingNumber2"));
setPassword(localStorage.getItem("password2"));
}, []);
+
const complaintPrintMutation = useMutation({
mutationKey: ["complaintPrint"],
mutationFn: postComplaintTracking,
@@ -70,10 +77,7 @@ export default function FollowResult() {
Data: { trackingNumber: trackingNumber, password: password },
});
}
-
-
-const printableContent = 'This is the content to be printed.';
-
+
return (
@@ -114,7 +118,7 @@ const printableContent = 'This is the content to be printed.';
-
+
{complaintPrintMutation.isPending ? (
) : (
-
+
{" "}
موضوع شکایت:{" "}
@@ -164,8 +170,8 @@ const printableContent = 'This is the content to be printed.';
)}
-
- {/* Cancel */}
+
+ {/* Cancel */}
);
diff --git a/components/RequestStep1.tsx b/components/RequestStep1.tsx
index 4428591..5f99518 100644
--- a/components/RequestStep1.tsx
+++ b/components/RequestStep1.tsx
@@ -64,7 +64,7 @@ export default function RequestStep1() {
لطفا جهت ارسال درخواست فرم زیر را تکمیل نمایید.
-
+
در صورت عدم تمایل به ثبت مشخصات شخصی می توانید به صفحه ی بعد مراجعه کنید.