diff --git a/app/layout.tsx b/app/layout.tsx
index 22aa2d6..27706bf 100644
--- a/app/layout.tsx
+++ b/app/layout.tsx
@@ -1,13 +1,8 @@
import type { Metadata } from "next";
-import { Inter } from "next/font/google";
import "./globals.css";
import { Toaster } from "@/components/ui/toaster";
-import Navbar from "@/components/Navbar";
-import NavbarSm from "@/components/NavbarSm";
import Provider from "../utils/Provider";
import { Toaster as SonnerToaster } from "@/components/ui/sonner";
-const inter = Inter({ subsets: ["latin"] });
-import { Suspense } from "react";
import ProgressBarProviders from "@/components/PrograssBar";
export const metadata: Metadata = {
@@ -24,7 +19,6 @@ export default function RootLayout({
- {/* }>{children} */}
{children}
diff --git a/components/AdminCategories.tsx b/components/AdminCategories.tsx
index 450e037..27d1137 100644
--- a/components/AdminCategories.tsx
+++ b/components/AdminCategories.tsx
@@ -433,16 +433,12 @@ const resetFormAdd = () => {
});
}}
id={item.id}
-
- // onClick={() => handleClickDelete(item?.id)}
/>
- {/* */}
setKeyId(item?.id)}
onClick={() =>
handleClickEdit(
item?.id,
diff --git a/components/BoxDashboard.tsx b/components/BoxDashboard.tsx
index 904cf04..165c68d 100644
--- a/components/BoxDashboard.tsx
+++ b/components/BoxDashboard.tsx
@@ -7,22 +7,21 @@ export default function BoxDashboard({
}: {
value: string;
title: string;
-}) {
+ }) {
+
const boxIcons = {
"درخواست ناشناس": ,
"درخواست شناس": ,
درخواست: ,
کاربر: ,
};
- const handelIcon = (item: keyof typeof boxIcons) => {
- const icon = boxIcons[item];
- return icon;
- };
+
const checkIcon = boxIcons[title as keyof typeof boxIcons] ? (
boxIcons[title as keyof typeof boxIcons]
) : (
);
+
return (
{
@@ -176,7 +169,6 @@ export default function ComplainsDetails({
if (dcKey != false && dcKey != null) {
if (check) {
- // localStorage.setItem("privateKey", dcKey);
localStorage.setItem("privatePassword", dcKey);
localStorage.setItem("privateKey", selectedFile);
}
diff --git a/components/ControllerDashboard.tsx b/components/ControllerDashboard.tsx
index f5790c0..61e349c 100644
--- a/components/ControllerDashboard.tsx
+++ b/components/ControllerDashboard.tsx
@@ -39,36 +39,6 @@ export default function ControllerDashboard() {
})}
-
- {/* */}
-
- {/* max Lg show */}
- {/* */}
);
}
diff --git a/components/Footer.tsx b/components/Footer.tsx
deleted file mode 100644
index 73276c6..0000000
--- a/components/Footer.tsx
+++ /dev/null
@@ -1,86 +0,0 @@
-import React from "react";
-import Image from "next/image";
-import img1 from "../public/img/footerImg1.png";
-import img2 from "../public/img/footerImg2.png";
-import { footerItems } from "@/constants";
-import { aboutFooterItems } from "@/constants";
-import Link from "next/link";
-
-export default function Footer() {
- return (
- //
-
-
-
- //
- );
-}
diff --git a/components/InspectorOperations.tsx b/components/InspectorOperations.tsx
index eecae03..c2bf5b7 100644
--- a/components/InspectorOperations.tsx
+++ b/components/InspectorOperations.tsx
@@ -32,7 +32,6 @@ import useData from "@/store/useData";
import { useMutation, useQueryClient } from "@tanstack/react-query";
import { OperateByInspector } from "@/utils/inspectorApi";
import { toast } from "sonner";
-import secureLocalStorage from "react-secure-storage";
import { Decrypt } from "@/lib/utils";
export default function InspectorOperations({
@@ -64,6 +63,7 @@ export default function InspectorOperations({
.refine((files) => files.length <= 5, `Maximum of 5 File are allowed.`)
.nullish(),
});
+
const password = useData((state) => state.data.password);
const possibleOperations = complaintData?.possibleOperationsWithDescription;
const queryClient = useQueryClient();
@@ -145,10 +145,6 @@ export default function InspectorOperations({
)}
/>
- {/*
-
-
-
*/}
-
-
-
-
-
-
-
-
ســــــــوت زن
- سامانه افشار فساد شهرداری
-
-
-
- {menuItems.map((item, index, array) => {
-
- if (array.length - 1 !== index){
- return (
-
-
{item.name}
-
- );
- }else{
- return (
- <>>
- );
- }
-
- })}
-
-
-
-
-
-
-
-
- );
-}
diff --git a/components/NavbarSm.tsx b/components/NavbarSm.tsx
deleted file mode 100644
index c62da18..0000000
--- a/components/NavbarSm.tsx
+++ /dev/null
@@ -1,89 +0,0 @@
-"use client";
-
-import React from "react";
-import { useRef } from "react";
-import { useState, useEffect } from "react";
-// import { useClickAway } from "react-use/lib/useClickAway";
-import { AnimatePresence, motion } from "framer-motion";
-import { Squash as Hamburger } from "hamburger-react";
-import { menuItems } from "@/constants";
-import Link from "next/link";
-import { Button } from "./ui/button";
-import TopNav from "./TopNav";
-import { usePathname } from "next/navigation";
-
-// import { routes } from "../routes";
-
-export default function NavbarSm() {
- const pathname = usePathname();
-
- // useClickAway(ref, () => setOpen(false));
-
- const [isOpen, setOpen] = useState(false);
- const ref = useRef(null);
-
- return (
- <>
-
-
-
- {/*
-
- */}
-
-
-
-
-
- {isOpen && (
-
-
- {menuItems.map((item, idx, array) => {
- // const { Icon } = item;
- const lastItem = array.length - 1;
- return (
-
- setOpen((prev) => !prev)}
- className={`flex items-center justify-between w-full p-3 rounded-xl text-white
- ${lastItem === idx ? "bg-yellow" : "bg-blue"} `}
- href={item.href}
- >
- {item.name}
- {/* */}
-
-
- );
- })}
-
-
- )}
-
-
- >
- );
-}
diff --git a/components/Pagination.tsx b/components/Pagination.tsx
index edb4726..0fd9557 100644
--- a/components/Pagination.tsx
+++ b/components/Pagination.tsx
@@ -3,8 +3,6 @@ import React, { useEffect, useState } from "react";
import ReactPaginate from "react-paginate";
import { MdKeyboardArrowRight, MdKeyboardArrowLeft } from "react-icons/md";
import { twMerge } from "tailwind-merge";
-// Example items, to simulate fetching from another resources.
-const items = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14];
export default function Pagination({
currentPage,
@@ -23,8 +21,7 @@ export default function Pagination({
console.log(event.selected);
Page(event.selected);
};
- console.log(countPage);
- // console.log(pageCount, "1111");
+
return (
<>
(false);
const Queries: any = useQueries({
queries: data?.map((item: any) => ({
queryKey: ["user", item.code],
queryFn: () => getInfo(item.code),
})),
});
+
const codes = data.map((item: any) => item.code);
const charts = Queries.map((item: any) => item.data);
const successfulRequests = Queries.filter(
(item: any) => item.isSuccess == true
);
+
return (
{successfulRequests.length == data.length && (
@@ -42,7 +43,6 @@ export default function Reports({ data }: { data: any }) {
value={item.code}
>
{item.title}
- {/* نمودار شماره یک */}
);
})}
@@ -65,22 +65,6 @@ export default function Reports({ data }: { data: any }) {
);
})}
- {/* Tab Content */}
- {/*
-
-
-
-
-
-
-
-
-
-
-
-
-
- */}
)}
diff --git a/components/Search.tsx b/components/Search.tsx
index cd9e039..81782c1 100644
--- a/components/Search.tsx
+++ b/components/Search.tsx
@@ -5,19 +5,6 @@ import { Label } from "./ui/label";
import { Button } from "./ui/button";
import { CiSearch } from "react-icons/ci";
-import {
- AlertDialog,
- AlertDialogAction,
- AlertDialogCancel,
- AlertDialogContent,
- AlertDialogDescription,
- AlertDialogFooter,
- AlertDialogHeader,
- AlertDialogTitle,
- AlertDialogTrigger,
-} from "@/components/ui/alert-dialog";
-import { IoMdClose } from "react-icons/io";
-import { useMediaQuery } from "react-responsive";
export default function Search({
mode,
value,
@@ -29,9 +16,7 @@ export default function Search({
action?: (any: any) => any;
changeValue?: (any: any) => any ;
}) {
- // useEffect(() => {
- // const isMobile = useMediaQuery({ query: "(max-width: 768px)" });
- // }, []);
+
return (
- {/*
*/}
diff --git a/components/TabController.tsx b/components/TabController.tsx
index c73eed9..6c760f9 100644
--- a/components/TabController.tsx
+++ b/components/TabController.tsx
@@ -26,40 +26,11 @@ import Pagination from "./Pagination";
import { Skeleton } from "./ui/skeleton";
export default function TabController() {
- const saveData = useData((state) => state.saveData);
- const [selectedFile, setSelectedFile] = useState
(null);
const [search, setSearch] = useState(null);
const [page, setPage] = useState(1);
const [totalCount, setTotalCount] = useState(0);
const router = useRouter();
- const handleFileChange = (event: any) => {
- const file = event.target.files[0];
- const reader = new FileReader();
- reader.onload = (e) => {
- const contents = e?.target?.result;
- // Process the contents of the file here
- setSelectedFile(contents);
- };
-
- reader.readAsText(file);
- };
-
- const checkKey = (item: any) => {
- const dcKey = Decrypt(item.cipherKeyInspector, selectedFile);
- if (dcKey != false && dcKey != null) {
- saveData({
- trackingNumber: item.trackingNumber,
- password: Decrypt(item.cipherKeyInspector, selectedFile),
- });
- router.push(`/UserPanel/ControllerDashboard/Complaints/${item.id}`);
- } else {
- toast("کلید شما معتبر نمی باشد.", {
- className: "!bg-red-500 !text-white",
- });
- }
- };
-
const [psblState, setPsblState] = useState(0);
const [selectedTab, setSelectedTab] = useState("0");
@@ -73,9 +44,6 @@ export default function TabController() {
refetchOnWindowFocus: false,
});
- // const initialSelectedTab = dataState[0]?.value || '';
- // setSelectedTab(initialSelectedTab);
-
const { data, isLoading, refetch } = useQuery({
queryKey: ["ComplaintsList", psblState, dataState, page],
queryFn: () =>
@@ -113,13 +81,7 @@ export default function TabController() {
لیست شکایت ها
{
- // setPsblState(value);
- // setSelectedTab(value);
- // refetch();
- // }}
className=""
dir="rtl"
>
@@ -131,7 +93,6 @@ export default function TabController() {
*/}
{dataState?.map((item: any) => {
- // const isActive = item.value === selectedTab;
return (
{data ? (
checkKey(item)}
data={data?.data}
/>
) : (
@@ -183,8 +143,6 @@ export default function TabController() {
{!isZero ? (
setPage(num + 1)}
/>
diff --git a/components/TableController.tsx b/components/TableController.tsx
index 977a526..d5c672f 100644
--- a/components/TableController.tsx
+++ b/components/TableController.tsx
@@ -51,52 +51,8 @@ interface Complaint {
lastActor: number;
cipherKeyInspector: string;
}
-export default function TableController({
- data,
- checkKey,
-}: {
- data: Complaint[];
- checkKey: (item: any) => any;
-}) {
- const saveData = useData((state) => state.saveData);
- const [selectedFile, setSelectedFile] = useState(null);
- const [open, setOpen] = useState(false);
- const [rowData, setRowData] = useState(null);
- const [check, setCheck] = useState(false);
+export default function TableController({ data }: { data: Complaint[] }) {
const router = useRouter();
-
- const handleFileChange = (event: any) => {
- const file = event.target.files[0];
- const reader = new FileReader();
- reader.onload = (e) => {
- const contents = e?.target?.result;
- setSelectedFile(contents);
- };
-
- reader.readAsText(file);
- };
-
- const checkKey2 = (item: any) => {
- const dcKey = Decrypt(item.cipherKeyInspector, selectedFile);
- if (dcKey != false && dcKey != null) {
- saveData({
- trackingNumber: item.trackingNumber,
- password: Decrypt(item.cipherKeyInspector, selectedFile),
- });
- secureLocalStorage.setItem("trackingNumber", item.trackingNumber);
- secureLocalStorage.setItem("privateKey", selectedFile);
- // secureLocalStorage.setItem(
- // "privateKey",
- // Decrypt(item.cipherKeyInspector, selectedFile)
- // );
- router.push(`/UserPanel/ControllerDashboard/Complaints/${item.id}`);
- } else {
- // toast("******کلید شما معتبر نمی باشد.", {
- // className: "!bg-red-500 !text-white",
- // });
- }
- };
- console.log(check);
return (
@@ -124,10 +80,6 @@ export default function TableController({
className="cursor-pointer hover:bg-gray-200"
key={item.id}
>
- {/* */}
{index + 1}
@@ -146,7 +98,6 @@ export default function TableController({
? item?.complaintOrganization.title
: "-"}
- {/* */}
);
})}
@@ -161,46 +112,6 @@ export default function TableController({
})}
-
);
}
diff --git a/components/TopNav.tsx b/components/TopNav.tsx
deleted file mode 100644
index 81e7b17..0000000
--- a/components/TopNav.tsx
+++ /dev/null
@@ -1,60 +0,0 @@
-"use client";
-
-import React from "react";
-import { Input } from "./ui/input";
-import Link from "next/link";
-import Search from "./Search";
-import { usePathname } from "next/navigation";
-
-export default function TopNav() {
- const pathname = usePathname();
-
- return (
-
-
- سال 1402 | مهارم تورم، رشد تولید
-
- {/*
Current pathname: {pathname}
*/}
-
-
-
- امروز: چهارشنبه 24 آبان 1402
-
-
-
-
-
-
-
- );
-}