Codes Cleaned

Kahdooie
Hossein Rahmani 2024-01-27 11:58:45 +03:30
parent 08872f04b9
commit fa6c67d3f5
15 changed files with 10 additions and 531 deletions

View File

@ -1,13 +1,8 @@
import type { Metadata } from "next"; import type { Metadata } from "next";
import { Inter } from "next/font/google";
import "./globals.css"; import "./globals.css";
import { Toaster } from "@/components/ui/toaster"; import { Toaster } from "@/components/ui/toaster";
import Navbar from "@/components/Navbar";
import NavbarSm from "@/components/NavbarSm";
import Provider from "../utils/Provider"; import Provider from "../utils/Provider";
import { Toaster as SonnerToaster } from "@/components/ui/sonner"; import { Toaster as SonnerToaster } from "@/components/ui/sonner";
const inter = Inter({ subsets: ["latin"] });
import { Suspense } from "react";
import ProgressBarProviders from "@/components/PrograssBar"; import ProgressBarProviders from "@/components/PrograssBar";
export const metadata: Metadata = { export const metadata: Metadata = {
@ -24,7 +19,6 @@ export default function RootLayout({
<html lang="fa" dir="rtl"> <html lang="fa" dir="rtl">
<body className="font-[yekan] bg-white"> <body className="font-[yekan] bg-white">
<Provider> <Provider>
{/* <Suspense fallback={<Loading />}>{children}</Suspense> */}
<ProgressBarProviders>{children}</ProgressBarProviders> <ProgressBarProviders>{children}</ProgressBarProviders>
<Toaster /> <Toaster />
<SonnerToaster /> <SonnerToaster />

View File

@ -433,16 +433,12 @@ const resetFormAdd = () => {
}); });
}} }}
id={item.id} id={item.id}
// onClick={() => handleClickDelete(item?.id)}
/> />
<AlertDialogTrigger asChild> <AlertDialogTrigger asChild>
{/* <Button variant="outline">Show Dialog</Button> */}
<FaRegEdit <FaRegEdit
aria-hidden="true" aria-hidden="true"
className="self-end w-6 h-6 text-slate-600 hover:cursor-pointer" className="self-end w-6 h-6 text-slate-600 hover:cursor-pointer"
// onClick={() => setKeyId(item?.id)}
onClick={() => onClick={() =>
handleClickEdit( handleClickEdit(
item?.id, item?.id,

View File

@ -8,21 +8,20 @@ export default function BoxDashboard({
value: string; value: string;
title: string; title: string;
}) { }) {
const boxIcons = { const boxIcons = {
"درخواست ناشناس": <EyeOff className=" mb-2 mx-auto" />, "درخواست ناشناس": <EyeOff className=" mb-2 mx-auto" />,
"درخواست شناس": <UserCheck className=" mb-2 mx-auto" />, "درخواست شناس": <UserCheck className=" mb-2 mx-auto" />,
درخواست: <ClipboardList className=" mb-2 mx-auto" />, درخواست: <ClipboardList className=" mb-2 mx-auto" />,
کاربر: <User className=" mb-2 mx-auto" />, کاربر: <User className=" mb-2 mx-auto" />,
}; };
const handelIcon = (item: keyof typeof boxIcons) => {
const icon = boxIcons[item];
return icon;
};
const checkIcon = boxIcons[title as keyof typeof boxIcons] ? ( const checkIcon = boxIcons[title as keyof typeof boxIcons] ? (
boxIcons[title as keyof typeof boxIcons] boxIcons[title as keyof typeof boxIcons]
) : ( ) : (
<Info className=" mb-2 mx-auto" /> <Info className=" mb-2 mx-auto" />
); );
return ( return (
<div <div
className=" px-7 py-8 bg-zinc-100 rounded-lg shadow flex flex-col justify-evenly items-center text-black className=" px-7 py-8 bg-zinc-100 rounded-lg shadow flex flex-col justify-evenly items-center text-black

View File

@ -69,10 +69,8 @@ export default function ComplainsDetails({
const cipherKeyInspector = data.cipherKeyInspector; const cipherKeyInspector = data.cipherKeyInspector;
const newDcKey = Decrypt(cipherKeyInspector, prvKey); const newDcKey = Decrypt(cipherKeyInspector, prvKey);
// const pw = localStorage.getItem("privatePassword") as string;
const pw = newDcKey as string; const pw = newDcKey as string;
localStorage.setItem("trackingNumber", data.trackingNumber); localStorage.setItem("trackingNumber", data.trackingNumber);
// if (pw != null) {
if (pw) { if (pw) {
getComplaintMutation.mutate({ getComplaintMutation.mutate({
trackingNumber: data.trackingNumber, trackingNumber: data.trackingNumber,
@ -80,11 +78,6 @@ export default function ComplainsDetails({
}); });
setOpen(false); setOpen(false);
} }
// else {
// toast("کلید خصوصی وجود ندارد ، بارگداری کنید.", {
// className: "!bg-red-500 !text-white",
// });
// }
}, []); }, []);
useEffect(() => { useEffect(() => {
@ -176,7 +169,6 @@ export default function ComplainsDetails({
if (dcKey != false && dcKey != null) { if (dcKey != false && dcKey != null) {
if (check) { if (check) {
// localStorage.setItem("privateKey", dcKey);
localStorage.setItem("privatePassword", dcKey); localStorage.setItem("privatePassword", dcKey);
localStorage.setItem("privateKey", selectedFile); localStorage.setItem("privateKey", selectedFile);
} }

View File

@ -39,36 +39,6 @@ export default function ControllerDashboard() {
})} })}
</div> </div>
</div> </div>
{/* <div className="w-full flex-row gap-6 h-[20vh] hidden lg:flex">
<div className="w-3/5 flex flex-row gap-7">
<BoxDashboard />
<BoxDashboard />
<BoxDashboard />
</div>
</div> */}
{/* max Lg show */}
{/* <div className="w-full mb-6 flex-col gap-12 flex lg:hidden">
<div className="w-full flex flex-row flex-wrap justify-center gap-4 ">
<BoxDashboard />
<BoxDashboard />
<BoxDashboard />
<BoxDashboard />
<BoxDashboard />
</div>
<div className="w-full flex flex-col gap-12 ">
<div className="h-1/2">
<LineChart />
</div>
<hr />
<div className="h-1/2">
<HorizontalChart />
</div>
</div>
</div> */}
</div> </div>
); );
} }

View File

@ -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 (
// <div classNameName="flex justify-center items-center w-full bg-blue ">
<footer className="bg-blue dark:bg-gray-900">
<div className="mx-auto w-full max-w-screen-3xl px-4 py-7 md:px-8 md:py-8 lg:pt-14 lg:pb-7 lg:px-11 ">
<div className="md:flex md:justify-between w-full ">
<div className="grid gap-10 sm:gap-16 md:gap-20 lg:gap-28 grid-cols-1 w-full md:grid-cols-2 md:w-3/4 lg:w-2/4">
<div>
<h2 className="text-white text-sm sm:text-base font-bold mb-4 ">
درباره سامانه عیون
</h2>
{aboutFooterItems.map((item) => {
return (
<div key={item.id}>
<p className=" text-white text-xs md:text-sm font-normal md:leading-7">
{item.name}
</p>
</div>
);
})}
</div>
<div>
<h2 className="text-white text-sm sm:text-base font-bold mb-4">
دسترسی سریع
</h2>
<ul className="text-gray-500 dark:text-gray-400 font-medium text-right">
{footerItems.map((item, index, array) => {
return (
<Link key={item.id} href={item.href}>
<div className=" text-white text-xs md:text-sm font-normal leading-6 mb-3">
{item.name}
</div>
</Link>
);
})}
</ul>
</div>
</div>
<div className=" max-md:mt-6 flex flex-row justify-center md:justify-end items-start w-full md:w-1/4 ">
<div className="w-23 h-23 sm:w-36 sm:h-36 ">
<Image
src={img1}
className="h-full w-full object-contain"
alt=" Logo1"
quality={100}
width={100}
height={100}
/>
</div>
<div className="w-23 h-23 sm:w-36 sm:h-36 ">
<Image
src={img2}
className="h-full w-full object-contain"
alt=" Logo2"
quality={100}
width={100}
height={100}
/>
</div>
</div>
</div>
<hr className=" border-gray-200 sm:mx-auto dark:border-gray-700 mt-5 sm:mt-10" />
<div className="sm:flex sm:items-center sm:justify-between">
<p className="text-white text-xs font-normal mt-4">
تمامی حقوق مادی و معنوی این وب سایت متعلق به عیون میباشد.
</p>
</div>
</div>
</footer>
// </div>
);
}

View File

@ -32,7 +32,6 @@ import useData from "@/store/useData";
import { useMutation, useQueryClient } from "@tanstack/react-query"; import { useMutation, useQueryClient } from "@tanstack/react-query";
import { OperateByInspector } from "@/utils/inspectorApi"; import { OperateByInspector } from "@/utils/inspectorApi";
import { toast } from "sonner"; import { toast } from "sonner";
import secureLocalStorage from "react-secure-storage";
import { Decrypt } from "@/lib/utils"; import { Decrypt } from "@/lib/utils";
export default function InspectorOperations({ export default function InspectorOperations({
@ -64,6 +63,7 @@ export default function InspectorOperations({
.refine((files) => files.length <= 5, `Maximum of 5 File are allowed.`) .refine((files) => files.length <= 5, `Maximum of 5 File are allowed.`)
.nullish(), .nullish(),
}); });
const password = useData((state) => state.data.password); const password = useData((state) => state.data.password);
const possibleOperations = complaintData?.possibleOperationsWithDescription; const possibleOperations = complaintData?.possibleOperationsWithDescription;
const queryClient = useQueryClient(); const queryClient = useQueryClient();
@ -145,10 +145,6 @@ export default function InspectorOperations({
</FormItem> </FormItem>
)} )}
/> />
{/* <div className="grid w-full max-w-sm items-center gap-1.5 mt-1">
<Label htmlFor="picture">پیوست</Label>
<Input multiple id="picture" type="file" className="bg-white " />
</div> */}
<FormField <FormField
control={form.control} control={form.control}
name="media" name="media"

View File

@ -1,63 +0,0 @@
"use client";
import React from "react";
import { Input } from "./ui/input";
import Image from "next/image";
import { menuItems } from "@/constants";
import Link from "next/link";
import Login from "./Login";
import { Button } from "./ui/button";
import { usePathname } from 'next/navigation'
import TopNav from "./TopNav";
export default function Navbar() {
const pathname = usePathname()
return (
<div className={`max-md:hidden left-0 right-0 top-0 z-10 ${pathname === "/" ? "absolute" : "sticky"}`}>
<TopNav />
<div className=" bg-white h-16 shadow-md flex items-center justify-between py-2 px-8">
<div className=" flex ">
<div className=" flex items-center ">
<Image
src="/img/logo.png"
quality={100}
alt="log"
width={32}
height={32}
/>
<div className=" text-brown flex flex-col text-center w-40">
<h1 className="text-[21px] w-full">ســــــــوت زن</h1>
<h1 className="text-[9px]">سامانه افشار فساد شهرداری</h1>
</div>
</div>
<div className=" flex gap-5 items-center mr-8">
{menuItems.map((item, index, array) => {
if (array.length - 1 !== index){
return (
<Link key={item.id} href={item.href}>
<div className=" text-sm font-bold">{item.name}</div>
</Link>
);
}else{
return (
<></>
);
}
})}
</div>
</div>
<Link href="/Login" >
<Button className=" bg-blue hover:bg-blue/90 rounded-lg">
ورود به پنل کاربری
</Button>
</Link>
</div>
</div>
);
}

View File

@ -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 (
<>
<div
ref={ref}
className={`md:hidden w-full bg-white z-[100] flex flex-row justify-between items-center px-4
sticky top-0
shadow-md`}
>
<Hamburger toggled={isOpen} size={20} toggle={setOpen} />
{/* <Link href="/Login">
<Button className=" bg-blue hover:bg-blue/90 rounded-lg text-xs ">
ورود به پنل کاربری
</Button>
</Link> */}
<div className="md:hidden">
<TopNav />
</div>
<AnimatePresence>
{isOpen && (
<motion.div
initial={{ opacity: 0 }}
animate={{ opacity: 1 }}
exit={{ opacity: 0 }}
transition={{ duration: 0.2 }}
className="fixed z-[100] left-0 shadow-4xl right-0 top-[3rem] p-5 bg-gradient-to-b from-blue to-white border-b border-b-white/20"
>
<ul className="grid gap-2 ">
{menuItems.map((item, idx, array) => {
// const { Icon } = item;
const lastItem = array.length - 1;
return (
<motion.li
initial={{ scale: 0, opacity: 0 }}
animate={{ scale: 1, opacity: 1 }}
transition={{
type: "spring",
stiffness: 260,
damping: 20,
delay: 0.1 + idx / 10,
}}
key={item.name}
className=" w-full p-[0.08rem] rounded-xl bg-gradient-to-tr from-neutral-800 via-white to-neutral-700"
>
<Link
onClick={() => 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}
>
<span className="flex gap-1 text-sm">{item.name}</span>
{/* <Icon className="text-xl" /> */}
</Link>
</motion.li>
);
})}
</ul>
</motion.div>
)}
</AnimatePresence>
</div>
</>
);
}

View File

@ -3,8 +3,6 @@ import React, { useEffect, useState } from "react";
import ReactPaginate from "react-paginate"; import ReactPaginate from "react-paginate";
import { MdKeyboardArrowRight, MdKeyboardArrowLeft } from "react-icons/md"; import { MdKeyboardArrowRight, MdKeyboardArrowLeft } from "react-icons/md";
import { twMerge } from "tailwind-merge"; 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({ export default function Pagination({
currentPage, currentPage,
@ -23,8 +21,7 @@ export default function Pagination({
console.log(event.selected); console.log(event.selected);
Page(event.selected); Page(event.selected);
}; };
console.log(countPage);
// console.log(pageCount, "1111");
return ( return (
<> <>
<ReactPaginate <ReactPaginate

View File

@ -11,18 +11,19 @@ import { getInfo, getInfoList } from "@/utils/infoApi";
import { useQueries, useQuery } from "@tanstack/react-query"; import { useQueries, useQuery } from "@tanstack/react-query";
export default function Reports({ data }: { data: any }) { export default function Reports({ data }: { data: any }) {
const [first, setfirst] = useState<any>(false);
const Queries: any = useQueries({ const Queries: any = useQueries({
queries: data?.map((item: any) => ({ queries: data?.map((item: any) => ({
queryKey: ["user", item.code], queryKey: ["user", item.code],
queryFn: () => getInfo(item.code), queryFn: () => getInfo(item.code),
})), })),
}); });
const codes = data.map((item: any) => item.code); const codes = data.map((item: any) => item.code);
const charts = Queries.map((item: any) => item.data); const charts = Queries.map((item: any) => item.data);
const successfulRequests = Queries.filter( const successfulRequests = Queries.filter(
(item: any) => item.isSuccess == true (item: any) => item.isSuccess == true
); );
return ( return (
<div className=""> <div className="">
{successfulRequests.length == data.length && ( {successfulRequests.length == data.length && (
@ -42,7 +43,6 @@ export default function Reports({ data }: { data: any }) {
value={item.code} value={item.code}
> >
{item.title} {item.title}
{/* <BsBarChartLineFill /> نمودار شماره یک */}
</TabsTrigger> </TabsTrigger>
); );
})} })}
@ -65,22 +65,6 @@ export default function Reports({ data }: { data: any }) {
</TabsContent> </TabsContent>
); );
})} })}
{/* Tab Content */}
{/* <TabsContent value="tab1" className="w-full h-full ">
<VerticalChart />
</TabsContent>
<TabsContent value="tab2" className="w-full h-full ">
<HorizontalChart />
</TabsContent>
<TabsContent value="tab3" className="w-full h-full ">
<LineChart />
</TabsContent>
<TabsContent value="tab4" className="w-full h-full ">
<HorizontalChart />
</TabsContent> */}
</div> </div>
</Tabs> </Tabs>
)} )}

View File

@ -5,19 +5,6 @@ import { Label } from "./ui/label";
import { Button } from "./ui/button"; import { Button } from "./ui/button";
import { CiSearch } from "react-icons/ci"; 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({ export default function Search({
mode, mode,
value, value,
@ -29,9 +16,7 @@ export default function Search({
action?: (any: any) => any; action?: (any: any) => any;
changeValue?: (any: any) => any ; changeValue?: (any: any) => any ;
}) { }) {
// useEffect(() => {
// const isMobile = useMediaQuery({ query: "(max-width: 768px)" });
// }, []);
return ( return (
<div className="relative flex items-center w-full bg-gray-300 lg:w-1/5 rounded-xl"> <div className="relative flex items-center w-full bg-gray-300 lg:w-1/5 rounded-xl">
<Input <Input
@ -55,11 +40,6 @@ export default function Search({
placeholder="جستجو..." placeholder="جستجو..."
required required
/> />
{/* <Button
className="absolute left-0 w-auto h-auto bg-transparent text-slate-800"
>
<CiSearch />
</Button> */}
<button onClick={action} className="absolute left-3"> <button onClick={action} className="absolute left-3">
<CiSearch /> <CiSearch />
</button> </button>

View File

@ -26,40 +26,11 @@ import Pagination from "./Pagination";
import { Skeleton } from "./ui/skeleton"; import { Skeleton } from "./ui/skeleton";
export default function TabController() { export default function TabController() {
const saveData = useData((state) => state.saveData);
const [selectedFile, setSelectedFile] = useState<any>(null);
const [search, setSearch] = useState<any>(null); const [search, setSearch] = useState<any>(null);
const [page, setPage] = useState<any>(1); const [page, setPage] = useState<any>(1);
const [totalCount, setTotalCount] = useState<any>(0); const [totalCount, setTotalCount] = useState<any>(0);
const router = useRouter(); 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 [psblState, setPsblState] = useState(0);
const [selectedTab, setSelectedTab] = useState<string>("0"); const [selectedTab, setSelectedTab] = useState<string>("0");
@ -73,9 +44,6 @@ export default function TabController() {
refetchOnWindowFocus: false, refetchOnWindowFocus: false,
}); });
// const initialSelectedTab = dataState[0]?.value || '';
// setSelectedTab(initialSelectedTab);
const { data, isLoading, refetch } = useQuery({ const { data, isLoading, refetch } = useQuery({
queryKey: ["ComplaintsList", psblState, dataState, page], queryKey: ["ComplaintsList", psblState, dataState, page],
queryFn: () => queryFn: () =>
@ -113,13 +81,7 @@ export default function TabController() {
لیست شکایت ها لیست شکایت ها
</p> </p>
<Tabs <Tabs
// defaultValue="0"
value={String(selectedTab)} value={String(selectedTab)}
// onClick={(value) => {
// setPsblState(value);
// setSelectedTab(value);
// refetch();
// }}
className="" className=""
dir="rtl" dir="rtl"
> >
@ -131,7 +93,6 @@ export default function TabController() {
</p> */} </p> */}
{dataState?.map((item: any) => { {dataState?.map((item: any) => {
// const isActive = item.value === selectedTab;
return ( return (
<TabsTrigger <TabsTrigger
key={item.value} key={item.value}
@ -169,7 +130,6 @@ export default function TabController() {
<TabsContent value={selectedTab} key={selectedTab}> <TabsContent value={selectedTab} key={selectedTab}>
{data ? ( {data ? (
<TableController <TableController
checkKey={(item) => checkKey(item)}
data={data?.data} data={data?.data}
/> />
) : ( ) : (
@ -183,8 +143,6 @@ export default function TabController() {
{!isZero ? ( {!isZero ? (
<Pagination <Pagination
// length={data3?.data.length}
// itemsPerPage={1}
countPage={totalCount} countPage={totalCount}
Page={(num: number) => setPage(num + 1)} Page={(num: number) => setPage(num + 1)}
/> />

View File

@ -51,52 +51,8 @@ interface Complaint {
lastActor: number; lastActor: number;
cipherKeyInspector: string; cipherKeyInspector: string;
} }
export default function TableController({ export default function TableController({ data }: { data: Complaint[] }) {
data,
checkKey,
}: {
data: Complaint[];
checkKey: (item: any) => any;
}) {
const saveData = useData((state) => state.saveData);
const [selectedFile, setSelectedFile] = useState<any>(null);
const [open, setOpen] = useState<boolean>(false);
const [rowData, setRowData] = useState<Complaint | null>(null);
const [check, setCheck] = useState<any>(false);
const router = useRouter(); 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 ( return (
<div> <div>
<Table className="border-[1px] border-solid border-muted rounded-md w-full min-w-[40rem] overflow-y-auto scrollbar-thumb-gray-600 scrollbar-track-gray-100 scrollbar-thin"> <Table className="border-[1px] border-solid border-muted rounded-md w-full min-w-[40rem] overflow-y-auto scrollbar-thumb-gray-600 scrollbar-track-gray-100 scrollbar-thin">
@ -124,10 +80,6 @@ export default function TableController({
className="cursor-pointer hover:bg-gray-200" className="cursor-pointer hover:bg-gray-200"
key={item.id} key={item.id}
> >
{/* <Link
href={`/UserPanel/ControllerDashboard/Complaints/${item.id}`}
className="contents"
> */}
<TableCell className="w-1/12 font-medium "> <TableCell className="w-1/12 font-medium ">
{index + 1} {index + 1}
</TableCell> </TableCell>
@ -146,7 +98,6 @@ export default function TableController({
? item?.complaintOrganization.title ? item?.complaintOrganization.title
: "-"} : "-"}
</TableCell> </TableCell>
{/* </Link> */}
</TableRow> </TableRow>
); );
})} })}
@ -161,46 +112,6 @@ export default function TableController({
})} })}
</TableBody> </TableBody>
</Table> </Table>
<Dialog open={open} onOpenChange={setOpen}>
<DialogContent dir="rtl" className="sm:max-w-[425px]">
<DialogHeader dir="rtl">
<DialogTitle dir="rtl">بارگذاری کلید خصوصی</DialogTitle>
<DialogDescription>
لطفا کلید خصوصی خود را آپلود نمایید.
</DialogDescription>
</DialogHeader>
<div className="grid w-full max-w-sm items-center gap-1.5">
{/* <Label htmlFor="picture">Picture</Label> */}
<Input
dir="rtl"
id="picture"
onChange={handleFileChange}
type="file"
accept=".txt"
/>
</div>
<div className="flex items-center space-x-2">
<Checkbox
checked={check}
onCheckedChange={setCheck}
id="terms"
className="ml-2 "
/>
<label
htmlFor="terms"
className="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
>
ذخیره کلید برای دفعات بعد
</label>
</div>
<DialogFooter>
<DialogClose asChild></DialogClose>
<Button onClick={() => checkKey2(rowData)} type="submit">
ذخیره
</Button>
</DialogFooter>
</DialogContent>
</Dialog>
</div> </div>
); );
} }

View File

@ -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 (
<div
className={`flex justify-between items-center w-full px-8 py-1 z-10 border-b-[#C9CFD7] border-b-[1px] border-solid max-md:bg-gray max-md:bg-transparent max-md:px-0 max-md:justify-end max-md:border-b-0 ${
pathname === "/" ? "bg-transparent" : "bg-white"
} `}
>
<p className="bg-gradient-to-r from-gradient1 to-gradient2 inline-block text-transparent bg-clip-text text-xs max-md:hidden font-bold">
سال 1402 | مهارم تورم، رشد تولید
</p>
{/* <p>Current pathname: {pathname}</p> */}
<div className="flex items-center gap-10">
<div className=" flex items-center gap-3 md:ml-4">
<p className="bg-gradient-to-r from-gradient1 to-gradient2 inline-block text-transparent bg-clip-text text-xs max-md:text-xs font-bold">
امروز: چهارشنبه 24 آبان 1402
</p>
<svg
className="max-md:hidden"
xmlns="http://www.w3.org/2000/svg"
width="18"
height="19"
viewBox="0 0 18 19"
fill="none"
>
<g clip-path="url(#clip0_113_99)">
<path
d="M11.2875 4.25C12.02 4.39292 12.6932 4.75119 13.221 5.27895C13.7488 5.80671 14.107 6.47995 14.2499 7.2125L11.2875 4.25ZM11.2875 1.25C12.8094 1.41908 14.2286 2.10063 15.3121 3.18276C16.3956 4.26488 17.079 5.68326 17.2499 7.205L11.2875 1.25ZM16.4999 13.19V15.44C16.5008 15.6489 16.458 15.8556 16.3743 16.047C16.2907 16.2384 16.1679 16.4102 16.014 16.5514C15.8601 16.6926 15.6784 16.8001 15.4805 16.867C15.2826 16.9339 15.073 16.9588 14.8649 16.94C12.5571 16.6892 10.3402 15.9006 8.39245 14.6375C6.58032 13.486 5.04395 11.9496 3.89245 10.1375C2.62493 8.1809 1.83613 5.95325 1.58995 3.635C1.57121 3.4276 1.59586 3.21857 1.66233 3.02122C1.72879 2.82387 1.83563 2.64252 1.97602 2.48872C2.11642 2.33491 2.2873 2.21203 2.47779 2.12789C2.66828 2.04375 2.87421 2.0002 3.08245 2H5.33245C5.69643 1.99642 6.04929 2.12531 6.32527 2.36265C6.60125 2.59999 6.78151 2.92959 6.83245 3.29C6.92742 4.01005 7.10354 4.71705 7.35745 5.3975C7.45836 5.66594 7.4802 5.95769 7.42038 6.23816C7.36056 6.51863 7.2216 6.77608 7.01995 6.98L6.06745 7.9325C7.13512 9.81016 8.68979 11.3648 10.5675 12.4325L11.5199 11.48C11.7239 11.2784 11.9813 11.1394 12.2618 11.0796C12.5423 11.0198 12.834 11.0416 13.1024 11.1425C13.7829 11.3964 14.4899 11.5725 15.21 11.6675C15.5743 11.7189 15.907 11.9024 16.1448 12.1831C16.3827 12.4638 16.5091 12.8222 16.4999 13.19Z"
stroke="black"
stroke-linecap="round"
stroke-linejoin="round"
/>
</g>
<defs>
<clipPath id="clip0_113_99">
<rect
width="18"
height="18"
fill="white"
transform="translate(0 0.5)"
/>
</clipPath>
</defs>
</svg>
</div>
</div>
</div>
);
}