Compare commits
No commits in common. "4381d3a7f3def263a7ccb6a7388bb37e85c08b65" and "96144c8c77649300feed93cb3ceb470aeb849751" have entirely different histories.
4381d3a7f3
...
96144c8c77
|
|
@ -5,7 +5,7 @@ import { Toaster } from "@/components/ui/toaster";
|
||||||
import Navbar from "@/components/Navbar";
|
import Navbar from "@/components/Navbar";
|
||||||
import NavbarSm from "@/components/NavbarSm";
|
import NavbarSm from "@/components/NavbarSm";
|
||||||
import Provider from "../utils/Provider";
|
import Provider from "../utils/Provider";
|
||||||
import { Toaster as SonnerToaster } from "@/components/ui/sonner";
|
|
||||||
const inter = Inter({ subsets: ["latin"] });
|
const inter = Inter({ subsets: ["latin"] });
|
||||||
|
|
||||||
export const metadata: Metadata = {
|
export const metadata: Metadata = {
|
||||||
|
|
@ -25,10 +25,9 @@ export default function RootLayout({
|
||||||
<Navbar />
|
<Navbar />
|
||||||
<NavbarSm />
|
<NavbarSm />
|
||||||
|
|
||||||
<div className="flex justify-center">{children}</div>
|
<div className="flex justify-center overflow-x-hidden">{children}</div>
|
||||||
|
|
||||||
<Toaster />
|
<Toaster />
|
||||||
<SonnerToaster />
|
|
||||||
</Provider>
|
</Provider>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -1,258 +1,86 @@
|
||||||
"use client";
|
import React from "react";
|
||||||
import React, { useEffect } from "react";
|
|
||||||
import greenIcon from "../public/img/greenPoint.svg";
|
import greenIcon from "../public/img/greenPoint.svg";
|
||||||
import blueIcon from "../public/img/bluepoint.svg";
|
import blueIcon from "../public/img/bluepoint.svg";
|
||||||
import Image from "next/image";
|
import Image from "next/image";
|
||||||
import { ComplainDetailsItems } from "@/constants";
|
import { ComplainDetailsItems } from "@/constants";
|
||||||
import { useMutation } from "@tanstack/react-query";
|
|
||||||
import { getComplaint } from "@/utils/inspectorApi";
|
|
||||||
import useData from "@/store/useData";
|
|
||||||
import { convertDate } from "@/lib/utils";
|
|
||||||
import { Badge } from "./ui/badge";
|
|
||||||
import InspectorOperations from "./InspectorOperations";
|
|
||||||
|
|
||||||
export default function ComplainsDetails({ id }: { id: number }) {
|
export default function ComplainsDetails({ id }: { id: number }) {
|
||||||
const complainData = useData((state) => state.data);
|
|
||||||
const getComplaintMutation = useMutation({
|
|
||||||
mutationKey: ["Complaint", id],
|
|
||||||
mutationFn: getComplaint,
|
|
||||||
onSuccess: (res) => {},
|
|
||||||
onError: (err) => {},
|
|
||||||
});
|
|
||||||
console.log(complainData);
|
|
||||||
useEffect(() => {
|
|
||||||
useData.persist.rehydrate();
|
|
||||||
}, []);
|
|
||||||
useEffect(() => {
|
|
||||||
if (complainData) {
|
|
||||||
getComplaintMutation.mutate(complainData);
|
|
||||||
}
|
|
||||||
}, [complainData]);
|
|
||||||
let data;
|
|
||||||
if (getComplaintMutation.isSuccess) {
|
|
||||||
console.log(getComplaintMutation.data);
|
|
||||||
data = getComplaintMutation.data;
|
|
||||||
console.log(data);
|
|
||||||
}
|
|
||||||
return (
|
return (
|
||||||
<div className="w-[95vw] lg:w-[82vw] xl:w-[70vw] 3xl:w-[65vw] mt-16 sm:mt-8 pt-9 mx-auto mb-10">
|
<div className="w-[95vw] lg:w-[82vw] xl:w-[70vw] 3xl:w-[65vw] mt-16 sm:mt-8 pt-9">
|
||||||
{data ? (
|
|
||||||
<div className="w-full flex gap-3 items-start">
|
<div className="w-full flex flex-col md:flex-row min-h-[60vh] gap-5">
|
||||||
<div className="flex flex-col w-1/3 order-2 gap-3 !sticky top-40 ">
|
{/* Right */}
|
||||||
<div className=" bg-[#E9E9E9] rounded-md py-4 px-10 flex flex-col">
|
<div className="w-full md:w-2/3 pb-20 md:pb-0 bg-[#E9E9E9] rounded-md pt-4 px-11 flex flex-col gap-7">
|
||||||
<p className="text-[#464646] text-base font-bold">گزارش شکایت</p>
|
<p className="text-[#464646] text-base font-bold">گزارش شکایات</p>
|
||||||
<div className="mt-2">
|
<div className="">
|
||||||
<p className="text-[#2e2a2a] text-sm font-medium">
|
<p className="text-[#464646] text-sm font-medium">
|
||||||
موضوع شکایت:{" "}
|
{" "}
|
||||||
<span className="text-[#7C838A] text-sm font-medium">
|
موضوع شکایت:{" "}
|
||||||
{data.title}
|
<span className="text-[#7C838A] text-sm font-medium">
|
||||||
</span>
|
متن تستی
|
||||||
</p>
|
</span>
|
||||||
<p className="text-[#464646] text-sm font-medium">
|
|
||||||
دستگاه مربوطه:{" "}
|
|
||||||
<span className="text-[#7C838A] text-sm font-medium">
|
|
||||||
{/* {data.title} */}
|
|
||||||
</span>
|
|
||||||
</p>
|
|
||||||
<p className="text-[#464646] text-sm font-medium">
|
|
||||||
پرسنل مربوطه:{" "}
|
|
||||||
<span className="text-[#7C838A] text-sm font-medium">
|
|
||||||
{/* {data.title} */}
|
|
||||||
</span>
|
|
||||||
</p>
|
|
||||||
<p className="text-[#464646] text-sm font-medium">
|
|
||||||
زمان ثبت:{" "}
|
|
||||||
<span className="text-[#7C838A] text-sm font-medium">
|
|
||||||
{convertDate(data.registeredAt)}
|
|
||||||
</span>
|
|
||||||
</p>
|
|
||||||
{/* <p className="text-[#464646] text-sm font-medium">
|
|
||||||
{" "}
|
|
||||||
موضوع شکایت:{" "}
|
|
||||||
<span className="text-[#7C838A] text-sm font-medium">
|
|
||||||
متن تستی
|
|
||||||
</span>
|
|
||||||
</p> */}
|
|
||||||
</div>
|
|
||||||
{/* <p className="text-[#464646] text-sm font-medium text-justify">
|
|
||||||
درخواست شما با کد رهگیری {data.trackingNumber} و رمز عبور 12422 در
|
|
||||||
دست بررسی و اقدام می باشد. در صورت تمایل می توانید با شماره تلفن
|
|
||||||
0353286545 جهت پشتیبانی تماس حاصل کنید.{" "}
|
|
||||||
</p> */}
|
|
||||||
</div>
|
|
||||||
<div className=" order-2 bg-[#E9E9E9] rounded-md py-4 px-10 flex flex-col">
|
|
||||||
<p className="text-[#464646] text-base font-bold">انجام عملیات</p>
|
|
||||||
<InspectorOperations />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className=" w-2/3 bg-[#E9E9E9] p-4 px-10 rounded-lg">
|
|
||||||
<p className="text-[#464646] text-base font-bold">روند شکایت</p>
|
|
||||||
<div className=" flex flex-col gap-y-4 mt-4">
|
|
||||||
{data.contents?.map((item: any) => {
|
|
||||||
return (
|
|
||||||
<div className=" bg-white p-4 rounded-lg shadow-md">
|
|
||||||
<div className=" flex gap-4 items-center">
|
|
||||||
<p className="">
|
|
||||||
<Badge>{item.sender == 0 ? "شهروند" : "بازرس"}</Badge>
|
|
||||||
</p>
|
|
||||||
<p className="">
|
|
||||||
تاریخ :
|
|
||||||
<span className="text-[#7C838A]">
|
|
||||||
{convertDate(item.dateTime)}
|
|
||||||
</span>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<div className=" text-[#7C838A] mt-2">
|
|
||||||
متن: {item.text ? item.text : "-"}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
{data.contents?.map((item: any) => {
|
|
||||||
return (
|
|
||||||
<div className=" bg-white p-4 rounded-lg shadow-md">
|
|
||||||
<div className=" flex gap-4 items-center">
|
|
||||||
<p className="">
|
|
||||||
<Badge>{item.sender == 0 ? "شهروند" : "بازرس"}</Badge>
|
|
||||||
</p>
|
|
||||||
<p className="">
|
|
||||||
تاریخ :
|
|
||||||
<span className="text-[#7C838A]">
|
|
||||||
{convertDate(item.dateTime)}
|
|
||||||
</span>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<div className=" text-[#7C838A] mt-2">
|
|
||||||
متن: {item.text ? item.text : "-"}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
{data.contents?.map((item: any) => {
|
|
||||||
return (
|
|
||||||
<div className=" bg-white p-4 rounded-lg shadow-md">
|
|
||||||
<div className=" flex gap-4 items-center">
|
|
||||||
<p className="">
|
|
||||||
<Badge>{item.sender == 0 ? "شهروند" : "بازرس"}</Badge>
|
|
||||||
</p>
|
|
||||||
<p className="">
|
|
||||||
تاریخ :
|
|
||||||
<span className="text-[#7C838A]">
|
|
||||||
{convertDate(item.dateTime)}
|
|
||||||
</span>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<div className=" text-[#7C838A] mt-2">
|
|
||||||
متن: {item.text ? item.text : "-"}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
{data.contents?.map((item: any) => {
|
|
||||||
return (
|
|
||||||
<div className=" bg-white p-4 rounded-lg shadow-md">
|
|
||||||
<div className=" flex gap-4 items-center">
|
|
||||||
<p className="">
|
|
||||||
<Badge>{item.sender == 0 ? "شهروند" : "بازرس"}</Badge>
|
|
||||||
</p>
|
|
||||||
<p className="">
|
|
||||||
تاریخ :
|
|
||||||
<span className="text-[#7C838A]">
|
|
||||||
{convertDate(item.dateTime)}
|
|
||||||
</span>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<div className=" text-[#7C838A] mt-2">
|
|
||||||
متن: {item.text ? item.text : "-"}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
{data.contents?.map((item: any) => {
|
|
||||||
return (
|
|
||||||
<div className=" bg-white p-4 rounded-lg shadow-md">
|
|
||||||
<div className=" flex gap-4 items-center">
|
|
||||||
<p className="">
|
|
||||||
<Badge>{item.sender == 0 ? "شهروند" : "بازرس"}</Badge>
|
|
||||||
</p>
|
|
||||||
<p className="">
|
|
||||||
تاریخ :
|
|
||||||
<span className="text-[#7C838A]">
|
|
||||||
{convertDate(item.dateTime)}
|
|
||||||
</span>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<div className=" text-[#7C838A] mt-2">
|
|
||||||
متن: {item.text ? item.text : "-"}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
{data.contents?.map((item: any) => {
|
|
||||||
return (
|
|
||||||
<div className=" bg-white p-4 rounded-lg shadow-md">
|
|
||||||
<div className=" flex gap-4 items-center">
|
|
||||||
<p className="">
|
|
||||||
<Badge>{item.sender == 0 ? "شهروند" : "بازرس"}</Badge>
|
|
||||||
</p>
|
|
||||||
<p className="">
|
|
||||||
تاریخ :
|
|
||||||
<span className="text-[#7C838A]">
|
|
||||||
{convertDate(item.dateTime)}
|
|
||||||
</span>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<div className=" text-[#7C838A] mt-2">
|
|
||||||
متن: {item.text ? item.text : "-"}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{/* Left */}
|
|
||||||
{/* <div className="w-full md:w-1/3 bg-white shadow-lg rounded-md pt-3 px-4 flex flex-row md:flex-col max-md:flex-wrap">
|
|
||||||
<p className="text-[#464646] text-base font-bold mb-3">
|
|
||||||
وضعیت درخواست
|
|
||||||
</p>
|
</p>
|
||||||
|
<p className="text-[#464646] text-sm font-medium">
|
||||||
|
{" "}
|
||||||
|
موضوع شکایت:{" "}
|
||||||
|
<span className="text-[#7C838A] text-sm font-medium">
|
||||||
|
متن تستی
|
||||||
|
</span>
|
||||||
|
</p>
|
||||||
|
<p className="text-[#464646] text-sm font-medium">
|
||||||
|
{" "}
|
||||||
|
موضوع شکایت:{" "}
|
||||||
|
<span className="text-[#7C838A] text-sm font-medium">
|
||||||
|
متن تستی
|
||||||
|
</span>
|
||||||
|
</p>
|
||||||
|
<p className="text-[#464646] text-sm font-medium"> موضوع شکایت:</p>
|
||||||
|
</div>
|
||||||
|
<p className="text-[#464646] text-sm font-medium text-justify">
|
||||||
|
درخواست شما با کد رهگیری 1243230783 و رمز عبور 12422 در دست بررسی و
|
||||||
|
اقدام می باشد. در صورت تمایل می توانید با شماره تلفن 0353286545 جهت
|
||||||
|
پشتیبانی تماس حاصل کنید.{" "}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
{ComplainDetailsItems.map((item, index, array) => {
|
{/* Left */}
|
||||||
return (
|
<div className="w-full md:w-1/3 bg-white shadow-lg rounded-md pt-3 px-4 flex flex-row md:flex-col max-md:flex-wrap">
|
||||||
<div
|
<p className="text-[#464646] text-base font-bold mb-3">
|
||||||
className="w-full justify-start items-start gap-4 inline-flex "
|
وضعیت درخواست
|
||||||
key={item.id}
|
</p>
|
||||||
>
|
|
||||||
<div className="grow shrink basis-0 pb-2 flex-col justify-start items-start gap-1 inline-flex">
|
{/* 1 */}
|
||||||
<div className="self-stretch text-right text-lime-800 text-lg font-semibold leading-[30px]">
|
{ComplainDetailsItems.map((item, index, array) => {
|
||||||
{item.title}
|
return (
|
||||||
</div>
|
<div className="w-full justify-start items-start gap-4 inline-flex " key={item.id}>
|
||||||
<div className="self-stretch text-right text-zinc-700 text-base font-normal uppercase">
|
<div className="grow shrink basis-0 pb-2 flex-col justify-start items-start gap-1 inline-flex">
|
||||||
{item.desc}
|
<div className="self-stretch text-right text-lime-800 text-lg font-semibold leading-[30px]">
|
||||||
</div>
|
{item.title}
|
||||||
<div className="self-stretch text-right text-zinc-700 text-base font-normal">
|
|
||||||
{item.date} <br /> {item.time}
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
<div className="self-stretch text-right text-zinc-700 text-base font-normal uppercase">
|
||||||
<div className="w-6 self-stretch flex-col justify-start items-center gap-1 inline-flex">
|
{item.desc}
|
||||||
<div className="py-0.5 justify-start items-start gap-2.5 inline-flex">
|
</div>
|
||||||
<Image
|
<div className="self-stretch text-right text-zinc-700 text-base font-normal">
|
||||||
src={greenIcon}
|
{item.date} <br /> {item.time}
|
||||||
alt="greenIcon"
|
|
||||||
width={100}
|
|
||||||
height={100}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div className="w-1 grow shrink basis-0 bg-lime-800 rounded-[1px]"></div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
|
||||||
})}
|
<div className="w-6 self-stretch flex-col justify-start items-center gap-1 inline-flex">
|
||||||
</div> */}
|
<div className="py-0.5 justify-start items-start gap-2.5 inline-flex">
|
||||||
|
<Image
|
||||||
|
src={greenIcon}
|
||||||
|
alt="greenIcon"
|
||||||
|
width={100}
|
||||||
|
height={100}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div className="w-1 grow shrink basis-0 bg-lime-800 rounded-[1px]"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
})}
|
||||||
</div>
|
</div>
|
||||||
) : (
|
</div>
|
||||||
""
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,28 +1,22 @@
|
||||||
"use client";
|
"use client"
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import BoxDashboard from "./BoxDashboard";
|
import BoxDashboard from "./BoxDashboard";
|
||||||
import LineChart from "./LineChart";
|
import LineChart from "./LineChart";
|
||||||
import { HorizontalChart } from "./HorizontalChart";
|
import { HorizontalChart } from "./HorizontalChart";
|
||||||
import { getComplaintsList } from "@/utils/inspectorApi";
|
import { getComplaintsList } from "@/utils/inspectorApi";
|
||||||
import { useQuery } from "@tanstack/react-query";
|
import { useQuery } from "@tanstack/react-query";
|
||||||
import useDecrypt from "@/hooks/useDecrypt";
|
|
||||||
|
|
||||||
export default function ControllerDashboard() {
|
export default function ControllerDashboard() {
|
||||||
const { data, isLoading, refetch } = useQuery({
|
const {
|
||||||
queryKey: ["ComplaintsList"],
|
data,
|
||||||
queryFn: () => getComplaintsList(),
|
isLoading,
|
||||||
refetchOnWindowFocus: false,
|
refetch,
|
||||||
});
|
} = useQuery({
|
||||||
|
queryKey: ["ComplaintsList"],
|
||||||
|
queryFn: () => getComplaintsList(),
|
||||||
|
refetchOnWindowFocus: false,
|
||||||
|
});
|
||||||
console.log(data);
|
console.log(data);
|
||||||
const [decryptedMessage, errorMessage] = useDecrypt(
|
|
||||||
"gJoT9AqK7wk1MZFSD04yXXfF36fzsOL+RYtJfySrEnQeJ7VoaL7pmOU6nB3+0+PQcaxIi3hf1AHjzIB0Cn5oHgKROeoI4XslhAezZk23QhtIU4HUF1wpeOJfA+4hWyRfbh4fI9774sa/KL47VaBbrNM/rvBxk6hjlKx5mTb3hqM="
|
|
||||||
);
|
|
||||||
console.log(decryptedMessage);
|
|
||||||
if (data) {
|
|
||||||
}
|
|
||||||
console.log(errorMessage);
|
|
||||||
if (data) {
|
|
||||||
}
|
|
||||||
return (
|
return (
|
||||||
<div className="w-[95vw] lg:w-[82vw] xl:w-[70vw] 3xl:w-[65vw] mt-8 max-sm:mt-16 pt-9">
|
<div className="w-[95vw] lg:w-[82vw] xl:w-[70vw] 3xl:w-[65vw] mt-8 max-sm:mt-16 pt-9">
|
||||||
{/* Lg Show */}
|
{/* Lg Show */}
|
||||||
|
|
@ -68,6 +62,7 @@ export default function ControllerDashboard() {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,114 +0,0 @@
|
||||||
"use client";
|
|
||||||
|
|
||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
|
||||||
import { useForm } from "react-hook-form";
|
|
||||||
import * as z from "zod";
|
|
||||||
|
|
||||||
import { Button } from "@/components/ui/button";
|
|
||||||
import {
|
|
||||||
Form,
|
|
||||||
FormControl,
|
|
||||||
FormDescription,
|
|
||||||
FormField,
|
|
||||||
FormItem,
|
|
||||||
FormLabel,
|
|
||||||
FormMessage,
|
|
||||||
} from "@/components/ui/form";
|
|
||||||
import { Textarea } from "@/components/ui/textarea";
|
|
||||||
import { toast } from "@/components/ui/use-toast";
|
|
||||||
import { Label } from "./ui/label";
|
|
||||||
import { Input } from "./ui/input";
|
|
||||||
import { RadioGroup, RadioGroupItem } from "./ui/radio-group";
|
|
||||||
|
|
||||||
const FormSchema = z.object({
|
|
||||||
bio: z
|
|
||||||
.string()
|
|
||||||
.min(10, {
|
|
||||||
message: "Bio must be at least 10 characters.",
|
|
||||||
})
|
|
||||||
.max(160, {
|
|
||||||
message: "Bio must not be longer than 30 characters.",
|
|
||||||
}),
|
|
||||||
});
|
|
||||||
|
|
||||||
export default function InspectorOperations() {
|
|
||||||
const form = useForm<z.infer<typeof FormSchema>>({
|
|
||||||
resolver: zodResolver(FormSchema),
|
|
||||||
});
|
|
||||||
|
|
||||||
function onSubmit(data: z.infer<typeof FormSchema>) {
|
|
||||||
toast({
|
|
||||||
title: "You submitted the following values:",
|
|
||||||
description: (
|
|
||||||
<pre className="mt-2 w-[340px] rounded-md bg-slate-950 p-4">
|
|
||||||
<code className="text-white">{JSON.stringify(data, null, 2)}</code>
|
|
||||||
</pre>
|
|
||||||
),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Form {...form}>
|
|
||||||
<form onSubmit={form.handleSubmit(onSubmit)} className="">
|
|
||||||
<FormField
|
|
||||||
control={form.control}
|
|
||||||
name="bio"
|
|
||||||
render={({ field }) => (
|
|
||||||
<FormItem>
|
|
||||||
<FormLabel className="">متن</FormLabel>
|
|
||||||
<FormControl>
|
|
||||||
<Textarea
|
|
||||||
placeholder="Tell us a little bit about yourself"
|
|
||||||
className="resize-none bg-white"
|
|
||||||
{...field}
|
|
||||||
/>
|
|
||||||
</FormControl>
|
|
||||||
{/* <FormDescription>
|
|
||||||
You can <span>@mention</span> other users and organizations.
|
|
||||||
</FormDescription> */}
|
|
||||||
<FormMessage />
|
|
||||||
</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
|
|
||||||
control={form.control}
|
|
||||||
name="type"
|
|
||||||
render={({ field }) => (
|
|
||||||
<FormItem className="space-y-3">
|
|
||||||
<FormControl dir="rtl">
|
|
||||||
<RadioGroup
|
|
||||||
onValueChange={field.onChange}
|
|
||||||
defaultValue={field.value}
|
|
||||||
className="flex space-y-1 text-sm"
|
|
||||||
>
|
|
||||||
<FormItem className="flex items-center space-x-3 space-y-0">
|
|
||||||
<FormControl>
|
|
||||||
<RadioGroupItem value="private" className=" ml-2" />
|
|
||||||
</FormControl>
|
|
||||||
<FormLabel className="font-normal">خصوصی</FormLabel>
|
|
||||||
</FormItem>
|
|
||||||
<FormItem className="flex items-center space-x-3 space-y-0">
|
|
||||||
<FormControl>
|
|
||||||
<RadioGroupItem value="public" className=" ml-2" />
|
|
||||||
</FormControl>
|
|
||||||
<FormLabel className="font-normal">عمومی</FormLabel>
|
|
||||||
</FormItem>
|
|
||||||
</RadioGroup>
|
|
||||||
</FormControl>
|
|
||||||
<FormMessage />
|
|
||||||
</FormItem>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
<div className=" flex justify-end mt-1">
|
|
||||||
<Button className=" bg-blue" type="submit">
|
|
||||||
ثبت
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</Form>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
@ -64,7 +64,7 @@ export default function RequestStep1() {
|
||||||
<p className="text-sm md:text-base font-bold leading-tight tracking-tight text-blue dark:text-white">
|
<p className="text-sm md:text-base font-bold leading-tight tracking-tight text-blue dark:text-white">
|
||||||
لطفا جهت ارسال درخواست فرم زیر را تکمیل نمایید.
|
لطفا جهت ارسال درخواست فرم زیر را تکمیل نمایید.
|
||||||
</p>
|
</p>
|
||||||
<p className="text-sm md:text-base font-bold leading-tight tracking-tight text-red-800 dark:text-white">
|
<p className="text-sm md:text-base font-bold leading-tight tracking-tight text-red dark:text-white">
|
||||||
در صورت عدم تمایل به ثبت مشخصات شخصی می توانید به صفحه ی بعد مراجعه کنید.
|
در صورت عدم تمایل به ثبت مشخصات شخصی می توانید به صفحه ی بعد مراجعه کنید.
|
||||||
</p>
|
</p>
|
||||||
<Form {...form}>
|
<Form {...form}>
|
||||||
|
|
|
||||||
|
|
@ -1,184 +1,45 @@
|
||||||
"use client";
|
import React from "react";
|
||||||
import React, { useState } from "react";
|
|
||||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
||||||
import TableController from "./TableController";
|
import TableController from "./TableController";
|
||||||
import Search from "./Search";
|
import Search from "./Search";
|
||||||
import { useQuery } from "@tanstack/react-query";
|
|
||||||
import { getComplaintsList } from "@/utils/inspectorApi";
|
|
||||||
import { Button } from "@/components/ui/button";
|
|
||||||
import {
|
|
||||||
Dialog,
|
|
||||||
DialogClose,
|
|
||||||
DialogContent,
|
|
||||||
DialogDescription,
|
|
||||||
DialogFooter,
|
|
||||||
DialogHeader,
|
|
||||||
DialogTitle,
|
|
||||||
DialogTrigger,
|
|
||||||
} from "@/components/ui/dialog";
|
|
||||||
import { Input } from "./ui/input";
|
|
||||||
import { useRouter } from "next/navigation";
|
|
||||||
import { Decrypt } from "@/lib/utils";
|
|
||||||
import useData from "@/store/useData";
|
|
||||||
import { toast } from "sonner";
|
|
||||||
export default function TabController() {
|
|
||||||
const saveData = useData((state) => state.saveData);
|
|
||||||
const [selectedFile, setSelectedFile] = useState<any>(null);
|
|
||||||
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);
|
|
||||||
console.log(contents);
|
|
||||||
};
|
|
||||||
|
|
||||||
reader.readAsText(file);
|
export default function TabController() {
|
||||||
};
|
|
||||||
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 { data, isLoading, refetch } = useQuery({
|
|
||||||
queryKey: ["ComplaintsList"],
|
|
||||||
queryFn: () => getComplaintsList(),
|
|
||||||
refetchOnWindowFocus: false,
|
|
||||||
});
|
|
||||||
console.log(data);
|
|
||||||
const newComplaints = data?.filter((item: any) => item.status == 0);
|
|
||||||
const inProgressComplaints = data?.filter((item: any) => item.status == 1);
|
|
||||||
const waitingForCitizenResponseComplaints = data?.filter(
|
|
||||||
(item: any) => item.status == 2
|
|
||||||
);
|
|
||||||
const citizenRepliedComplaints = data?.filter(
|
|
||||||
(item: any) => item.status == 3
|
|
||||||
);
|
|
||||||
const finishedComplaints = data?.filter((item: any) => item.status == 4);
|
|
||||||
console.log(newComplaints);
|
|
||||||
return (
|
return (
|
||||||
<div className="w-[95vw] lg:w-[82vw] xl:w-[70vw] 3xl:w-[65vw] mt-8 pt-9">
|
<div className="w-[95vw] lg:w-[82vw] xl:w-[70vw] 3xl:w-[65vw] mt-8 pt-9">
|
||||||
<Dialog>
|
<Tabs defaultValue="tab1" className="" dir="rtl">
|
||||||
<DialogTrigger className=" appearance-none" asChild>
|
|
||||||
<Button
|
|
||||||
// onClick={handelVerify}
|
|
||||||
type="submit"
|
|
||||||
className="bg-brown hover:bg-brown/90 text-white w-36 p-2 rounded-xl mt-6 md:mt-12 mb-2"
|
|
||||||
>
|
|
||||||
+ بارگذاری کلید جدید
|
|
||||||
</Button>
|
|
||||||
</DialogTrigger>
|
|
||||||
<Tabs defaultValue="tab1" className="" dir="rtl">
|
|
||||||
<div className="w-full flex flex-col-reverse lg:flex-row gap-4 lg:gap-12 justify-between items-center mb-10">
|
|
||||||
{/* Tab Title */}
|
|
||||||
<TabsList className="w-full lg:w-2/3 flex gap-1 md:gap-4 lg:gap-7">
|
|
||||||
<p className="3xl:ml-6 text-xs sm:text-sm font-bold">
|
|
||||||
لیست شکایت ها |
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<TabsTrigger
|
<div className="w-full flex flex-col-reverse lg:flex-row gap-4 lg:gap-12 justify-between items-center mt-6 md:mt-12 mb-10">
|
||||||
value="tab1"
|
{/* Tab Title */}
|
||||||
className="hover:border-b-2 border-b-blue"
|
<TabsList className="w-full lg:w-2/3 flex gap-1 md:gap-4 lg:gap-7">
|
||||||
>
|
<p className="3xl:ml-6 text-xs sm:text-sm font-bold">لیست شکایت ها |</p>
|
||||||
جدید (2)
|
|
||||||
</TabsTrigger>
|
|
||||||
<TabsTrigger
|
|
||||||
value="tab2"
|
|
||||||
className="hover:border-b-2 border-b-blue"
|
|
||||||
>
|
|
||||||
در انتظار پاسخ
|
|
||||||
</TabsTrigger>
|
|
||||||
<TabsTrigger
|
|
||||||
value="tab3"
|
|
||||||
className="hover:border-b-2 border-b-blue"
|
|
||||||
>
|
|
||||||
در حال بررسی
|
|
||||||
</TabsTrigger>
|
|
||||||
<TabsTrigger
|
|
||||||
value="tab4"
|
|
||||||
className="hover:border-b-2 border-b-blue"
|
|
||||||
>
|
|
||||||
پایان یافته
|
|
||||||
</TabsTrigger>
|
|
||||||
</TabsList>
|
|
||||||
|
|
||||||
{/* Search Box */}
|
<TabsTrigger value="tab1" className="hover:border-b-2 border-b-blue">جدید (2)</TabsTrigger>
|
||||||
<Search mode="controller" />
|
<TabsTrigger value="tab2" className="hover:border-b-2 border-b-blue">در انتظار پاسخ</TabsTrigger>
|
||||||
</div>
|
<TabsTrigger value="tab3" className="hover:border-b-2 border-b-blue">در حال بررسی</TabsTrigger>
|
||||||
|
<TabsTrigger value="tab4" className="hover:border-b-2 border-b-blue">پایان یافته </TabsTrigger>
|
||||||
|
</TabsList>
|
||||||
|
|
||||||
{/* Tab Content */}
|
{/* Search Box */}
|
||||||
<TabsContent value="tab1">
|
<Search mode='controller'/>
|
||||||
<TableController
|
</div>
|
||||||
checkKey={(item: any) => checkKey(item)}
|
|
||||||
data={newComplaints}
|
|
||||||
/>
|
|
||||||
</TabsContent>
|
|
||||||
|
|
||||||
<TabsContent value="tab2">
|
{/* Tab Content */}
|
||||||
<TableController
|
<TabsContent value="tab1" >
|
||||||
checkKey={(item: any) => checkKey(item)}
|
<TableController />
|
||||||
data={waitingForCitizenResponseComplaints}
|
</TabsContent>
|
||||||
/>
|
|
||||||
</TabsContent>
|
|
||||||
|
|
||||||
<TabsContent value="tab3">
|
<TabsContent value="tab2">
|
||||||
<TableController
|
<p>password2</p>
|
||||||
checkKey={(item: any) => checkKey(item)}
|
</TabsContent>
|
||||||
data={inProgressComplaints}
|
|
||||||
/>
|
|
||||||
</TabsContent>
|
|
||||||
|
|
||||||
<TabsContent value="tab4">
|
<TabsContent value="tab3">
|
||||||
<TableController
|
<p>password3</p>
|
||||||
checkKey={(item: any) => checkKey(item)}
|
</TabsContent>
|
||||||
data={finishedComplaints}
|
|
||||||
/>
|
<TabsContent value="tab4">
|
||||||
</TabsContent>
|
<p>password4</p>
|
||||||
</Tabs>
|
</TabsContent>
|
||||||
<DialogContent dir="rtl" className="sm:max-w-[425px]">
|
</Tabs>
|
||||||
<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>
|
|
||||||
<DialogFooter>
|
|
||||||
<DialogClose asChild>
|
|
||||||
<Button
|
|
||||||
onClick={() => {
|
|
||||||
toast("کلید شما با موفقیت ذخیره شد.", {
|
|
||||||
className: "!bg-green-500 !text-white",
|
|
||||||
});
|
|
||||||
}}
|
|
||||||
type="submit"
|
|
||||||
>
|
|
||||||
ذخیره
|
|
||||||
</Button>
|
|
||||||
</DialogClose>
|
|
||||||
</DialogFooter>
|
|
||||||
</DialogContent>
|
|
||||||
</Dialog>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import React, { useState } from "react";
|
import React from "react";
|
||||||
import {
|
import {
|
||||||
Table,
|
Table,
|
||||||
TableBody,
|
TableBody,
|
||||||
|
|
@ -8,167 +8,38 @@ import {
|
||||||
TableHeader,
|
TableHeader,
|
||||||
TableRow,
|
TableRow,
|
||||||
} from "@/components/ui/table";
|
} from "@/components/ui/table";
|
||||||
import { Button } from "@/components/ui/button";
|
|
||||||
import {
|
|
||||||
Dialog,
|
|
||||||
DialogClose,
|
|
||||||
DialogContent,
|
|
||||||
DialogDescription,
|
|
||||||
DialogFooter,
|
|
||||||
DialogHeader,
|
|
||||||
DialogTitle,
|
|
||||||
DialogTrigger,
|
|
||||||
} from "@/components/ui/dialog";
|
|
||||||
import { ControllerTableItems } from "@/constants";
|
import { ControllerTableItems } from "@/constants";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { Decrypt, convertDate } from "@/lib/utils";
|
|
||||||
import useData from "@/store/useData";
|
|
||||||
import { Label } from "./ui/label";
|
|
||||||
import { Input } from "./ui/input";
|
|
||||||
import { useRouter } from "next/navigation";
|
|
||||||
import { toast } from "sonner";
|
|
||||||
interface Complaint {
|
|
||||||
id: string;
|
|
||||||
trackingNumber: string;
|
|
||||||
title: string;
|
|
||||||
category: {
|
|
||||||
id: string;
|
|
||||||
title: string;
|
|
||||||
description: string;
|
|
||||||
};
|
|
||||||
status: number;
|
|
||||||
registeredAt: string;
|
|
||||||
lastChanged: string;
|
|
||||||
lastActor: number;
|
|
||||||
cipherKeyInspector: string;
|
|
||||||
}
|
|
||||||
export default function TableController({
|
|
||||||
data,
|
|
||||||
checkKey,
|
|
||||||
}: {
|
|
||||||
data: Complaint[];
|
|
||||||
checkKey: (item:any) => any;
|
|
||||||
}) {
|
|
||||||
console.log(data);
|
|
||||||
const saveData = useData((state) => state.saveData);
|
|
||||||
const [selectedFile, setSelectedFile] = useState<any>(null);
|
|
||||||
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);
|
|
||||||
console.log(contents);
|
|
||||||
};
|
|
||||||
|
|
||||||
reader.readAsText(file);
|
export default function TableController() {
|
||||||
};
|
|
||||||
// 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 {
|
|
||||||
// }
|
|
||||||
// };
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<Table className="border-[1px] border-solid border-muted rounded-md ">
|
||||||
<Dialog>
|
{/* <TableCaption>A list of your recent invoices.</TableCaption> */}
|
||||||
{/* <DialogTrigger className=" appearance-none" asChild>
|
<TableHeader>
|
||||||
<Button
|
<TableRow>
|
||||||
// onClick={handelVerify}
|
<TableHead>ردیف</TableHead>
|
||||||
type="submit"
|
<TableHead>تاریخ</TableHead>
|
||||||
className="bg-blue hover:bg-blue/90 text-white w-36 p-2 rounded-xl"
|
<TableHead>موضوع</TableHead>
|
||||||
>
|
<TableHead>دستگاه مربوطه</TableHead>
|
||||||
بارگذاری کلید جدید
|
</TableRow>
|
||||||
</Button>
|
</TableHeader>
|
||||||
</DialogTrigger> */}
|
<TableBody className="bg-[#F5F5F5]">
|
||||||
|
{ControllerTableItems.map((item) => {
|
||||||
<Table className="border-[1px] border-solid border-muted rounded-md ">
|
return (
|
||||||
{/* <TableCaption>A list of your recent invoices.</TableCaption> */}
|
<TableRow key={item.id}>
|
||||||
<TableHeader>
|
<Link
|
||||||
<TableRow>
|
href={`/UserPanel/ControllerDashboard/Complaints/${item.id}`}
|
||||||
<TableHead>ردیف</TableHead>
|
className="contents "
|
||||||
<TableHead>تاریخ</TableHead>
|
|
||||||
<TableHead>موضوع</TableHead>
|
|
||||||
<TableHead>دستگاه مربوطه</TableHead>
|
|
||||||
</TableRow>
|
|
||||||
</TableHeader>
|
|
||||||
<TableBody className="bg-[#F5F5F5]">
|
|
||||||
{data?.map((item: Complaint, index: number) => {
|
|
||||||
return (
|
|
||||||
<TableRow
|
|
||||||
onClick={
|
|
||||||
() => checkKey(item)
|
|
||||||
// saveData({
|
|
||||||
// trackingNumber: item.trackingNumber,
|
|
||||||
// password: Decrypt(item.cipherKeyInspector),
|
|
||||||
// })
|
|
||||||
}
|
|
||||||
className=" hover:bg-gray-200 cursor-pointer"
|
|
||||||
key={item.id}
|
|
||||||
>
|
|
||||||
{/* <Link
|
|
||||||
href={`/UserPanel/ControllerDashboard/Complaints/${item.id}`}
|
|
||||||
className="contents"
|
|
||||||
> */}
|
|
||||||
<TableCell className="w-1/12 font-medium ">
|
|
||||||
{index + 1}
|
|
||||||
</TableCell>
|
|
||||||
<TableCell className="w-2/12">
|
|
||||||
{convertDate(item.registeredAt)}
|
|
||||||
</TableCell>
|
|
||||||
<TableCell className="w-2/12">
|
|
||||||
{item?.category ? item.category.title : "-"}
|
|
||||||
</TableCell>
|
|
||||||
<TableCell className="w-7/12">-</TableCell>
|
|
||||||
{/* </Link> */}
|
|
||||||
</TableRow>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
</TableBody>
|
|
||||||
</Table>
|
|
||||||
{/* <DialogTrigger asChild>
|
|
||||||
<Button variant="outline">Edit Profile</Button>
|
|
||||||
</DialogTrigger> */}
|
|
||||||
<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>
|
|
||||||
<DialogFooter>
|
|
||||||
<DialogClose asChild>
|
|
||||||
<Button
|
|
||||||
onClick={() => {
|
|
||||||
if (selectedFile) {
|
|
||||||
toast("کلید شما با موفقیت بارگذاری شد.");
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
type="submit"
|
|
||||||
>
|
>
|
||||||
ذخیره
|
<TableCell className="w-1/12 font-medium ">{item.id}</TableCell>
|
||||||
</Button>
|
<TableCell className="w-2/12">{item.date}</TableCell>
|
||||||
</DialogClose>
|
<TableCell className="w-2/12">{item.title}</TableCell>
|
||||||
</DialogFooter>
|
<TableCell className="w-7/12">{item.content}</TableCell>
|
||||||
</DialogContent>
|
</Link>
|
||||||
</Dialog>
|
</TableRow>
|
||||||
</div>
|
);
|
||||||
|
})}
|
||||||
|
</TableBody>
|
||||||
|
</Table>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ export default function Verify() {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className="w-full my-12 sm:w-2/3 md:w-2/4 xl:w-1/3 bg-white rounded-lg dark:border xl:p-0 dark:bg-gray-800 dark:border-gray-700 shadow-[0px_0px_15px_0px_#00000040]
|
className="w-full mt-12 sm:w-2/3 md:w-2/4 xl:w-1/3 bg-white rounded-lg dark:border xl:p-0 dark:bg-gray-800 dark:border-gray-700 shadow-[0px_0px_15px_0px_#00000040]
|
||||||
h-full max-md:p-8 pt-12"
|
h-full max-md:p-8 pt-12"
|
||||||
>
|
>
|
||||||
<div className="space-y-3 md:space-y-4 flex flex-col md:py-12 md:px-20 h-full justify-center">
|
<div className="space-y-3 md:space-y-4 flex flex-col md:py-12 md:px-20 h-full justify-center">
|
||||||
|
|
|
||||||
|
|
@ -1,36 +0,0 @@
|
||||||
import * as React from "react"
|
|
||||||
import { cva, type VariantProps } from "class-variance-authority"
|
|
||||||
|
|
||||||
import { cn } from "@/lib/utils"
|
|
||||||
|
|
||||||
const badgeVariants = cva(
|
|
||||||
"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
||||||
{
|
|
||||||
variants: {
|
|
||||||
variant: {
|
|
||||||
default:
|
|
||||||
"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
|
|
||||||
secondary:
|
|
||||||
"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
||||||
destructive:
|
|
||||||
"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
|
|
||||||
outline: "text-foreground",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
defaultVariants: {
|
|
||||||
variant: "default",
|
|
||||||
},
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
export interface BadgeProps
|
|
||||||
extends React.HTMLAttributes<HTMLDivElement>,
|
|
||||||
VariantProps<typeof badgeVariants> {}
|
|
||||||
|
|
||||||
function Badge({ className, variant, ...props }: BadgeProps) {
|
|
||||||
return (
|
|
||||||
<div className={cn(badgeVariants({ variant }), className)} {...props} />
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
export { Badge, badgeVariants }
|
|
||||||
|
|
@ -1,122 +0,0 @@
|
||||||
"use client"
|
|
||||||
|
|
||||||
import * as React from "react"
|
|
||||||
import * as DialogPrimitive from "@radix-ui/react-dialog"
|
|
||||||
import { X } from "lucide-react"
|
|
||||||
|
|
||||||
import { cn } from "@/lib/utils"
|
|
||||||
|
|
||||||
const Dialog = DialogPrimitive.Root
|
|
||||||
|
|
||||||
const DialogTrigger = DialogPrimitive.Trigger
|
|
||||||
|
|
||||||
const DialogPortal = DialogPrimitive.Portal
|
|
||||||
|
|
||||||
const DialogClose = DialogPrimitive.Close
|
|
||||||
|
|
||||||
const DialogOverlay = React.forwardRef<
|
|
||||||
React.ElementRef<typeof DialogPrimitive.Overlay>,
|
|
||||||
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>
|
|
||||||
>(({ className, ...props }, ref) => (
|
|
||||||
<DialogPrimitive.Overlay
|
|
||||||
ref={ref}
|
|
||||||
className={cn(
|
|
||||||
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
||||||
className
|
|
||||||
)}
|
|
||||||
{...props}
|
|
||||||
/>
|
|
||||||
))
|
|
||||||
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName
|
|
||||||
|
|
||||||
const DialogContent = React.forwardRef<
|
|
||||||
React.ElementRef<typeof DialogPrimitive.Content>,
|
|
||||||
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>
|
|
||||||
>(({ className, children, ...props }, ref) => (
|
|
||||||
<DialogPortal>
|
|
||||||
<DialogOverlay />
|
|
||||||
<DialogPrimitive.Content
|
|
||||||
ref={ref}
|
|
||||||
className={cn(
|
|
||||||
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
|
|
||||||
className
|
|
||||||
)}
|
|
||||||
{...props}
|
|
||||||
>
|
|
||||||
{children}
|
|
||||||
<DialogPrimitive.Close className="absolute left-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground">
|
|
||||||
<X className="h-4 w-4" />
|
|
||||||
<span className="sr-only">Close</span>
|
|
||||||
</DialogPrimitive.Close>
|
|
||||||
</DialogPrimitive.Content>
|
|
||||||
</DialogPortal>
|
|
||||||
))
|
|
||||||
DialogContent.displayName = DialogPrimitive.Content.displayName
|
|
||||||
|
|
||||||
const DialogHeader = ({
|
|
||||||
className,
|
|
||||||
...props
|
|
||||||
}: React.HTMLAttributes<HTMLDivElement>) => (
|
|
||||||
<div
|
|
||||||
className={cn(
|
|
||||||
"flex flex-col space-y-1.5 text-center sm:text-right",
|
|
||||||
className
|
|
||||||
)}
|
|
||||||
{...props}
|
|
||||||
/>
|
|
||||||
)
|
|
||||||
DialogHeader.displayName = "DialogHeader"
|
|
||||||
|
|
||||||
const DialogFooter = ({
|
|
||||||
className,
|
|
||||||
...props
|
|
||||||
}: React.HTMLAttributes<HTMLDivElement>) => (
|
|
||||||
<div
|
|
||||||
className={cn(
|
|
||||||
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
|
|
||||||
className
|
|
||||||
)}
|
|
||||||
{...props}
|
|
||||||
/>
|
|
||||||
)
|
|
||||||
DialogFooter.displayName = "DialogFooter"
|
|
||||||
|
|
||||||
const DialogTitle = React.forwardRef<
|
|
||||||
React.ElementRef<typeof DialogPrimitive.Title>,
|
|
||||||
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>
|
|
||||||
>(({ className, ...props }, ref) => (
|
|
||||||
<DialogPrimitive.Title
|
|
||||||
ref={ref}
|
|
||||||
className={cn(
|
|
||||||
"text-lg font-semibold leading-none tracking-tight",
|
|
||||||
className
|
|
||||||
)}
|
|
||||||
{...props}
|
|
||||||
/>
|
|
||||||
))
|
|
||||||
DialogTitle.displayName = DialogPrimitive.Title.displayName
|
|
||||||
|
|
||||||
const DialogDescription = React.forwardRef<
|
|
||||||
React.ElementRef<typeof DialogPrimitive.Description>,
|
|
||||||
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>
|
|
||||||
>(({ className, ...props }, ref) => (
|
|
||||||
<DialogPrimitive.Description
|
|
||||||
ref={ref}
|
|
||||||
className={cn("text-sm text-muted-foreground", className)}
|
|
||||||
{...props}
|
|
||||||
/>
|
|
||||||
))
|
|
||||||
DialogDescription.displayName = DialogPrimitive.Description.displayName
|
|
||||||
|
|
||||||
export {
|
|
||||||
Dialog,
|
|
||||||
DialogPortal,
|
|
||||||
DialogOverlay,
|
|
||||||
DialogClose,
|
|
||||||
DialogTrigger,
|
|
||||||
DialogContent,
|
|
||||||
DialogHeader,
|
|
||||||
DialogFooter,
|
|
||||||
DialogTitle,
|
|
||||||
DialogDescription,
|
|
||||||
}
|
|
||||||
|
|
@ -1,44 +0,0 @@
|
||||||
"use client"
|
|
||||||
|
|
||||||
import * as React from "react"
|
|
||||||
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group"
|
|
||||||
import { Circle } from "lucide-react"
|
|
||||||
|
|
||||||
import { cn } from "@/lib/utils"
|
|
||||||
|
|
||||||
const RadioGroup = React.forwardRef<
|
|
||||||
React.ElementRef<typeof RadioGroupPrimitive.Root>,
|
|
||||||
React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>
|
|
||||||
>(({ className, ...props }, ref) => {
|
|
||||||
return (
|
|
||||||
<RadioGroupPrimitive.Root
|
|
||||||
className={cn("grid gap-2", className)}
|
|
||||||
{...props}
|
|
||||||
ref={ref}
|
|
||||||
/>
|
|
||||||
)
|
|
||||||
})
|
|
||||||
RadioGroup.displayName = RadioGroupPrimitive.Root.displayName
|
|
||||||
|
|
||||||
const RadioGroupItem = React.forwardRef<
|
|
||||||
React.ElementRef<typeof RadioGroupPrimitive.Item>,
|
|
||||||
React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>
|
|
||||||
>(({ className, ...props }, ref) => {
|
|
||||||
return (
|
|
||||||
<RadioGroupPrimitive.Item
|
|
||||||
ref={ref}
|
|
||||||
className={cn(
|
|
||||||
"aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
|
|
||||||
className
|
|
||||||
)}
|
|
||||||
{...props}
|
|
||||||
>
|
|
||||||
<RadioGroupPrimitive.Indicator className="flex items-center justify-center">
|
|
||||||
<Circle className="h-2.5 w-2.5 fill-current text-current" />
|
|
||||||
</RadioGroupPrimitive.Indicator>
|
|
||||||
</RadioGroupPrimitive.Item>
|
|
||||||
)
|
|
||||||
})
|
|
||||||
RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName
|
|
||||||
|
|
||||||
export { RadioGroup, RadioGroupItem }
|
|
||||||
|
|
@ -1,31 +0,0 @@
|
||||||
"use client"
|
|
||||||
|
|
||||||
import { useTheme } from "next-themes"
|
|
||||||
import { Toaster as Sonner } from "sonner"
|
|
||||||
|
|
||||||
type ToasterProps = React.ComponentProps<typeof Sonner>
|
|
||||||
|
|
||||||
const Toaster = ({ ...props }: ToasterProps) => {
|
|
||||||
const { theme = "system" } = useTheme()
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Sonner
|
|
||||||
theme={theme as ToasterProps["theme"]}
|
|
||||||
className="toaster group !font-[yekan]"
|
|
||||||
toastOptions={{
|
|
||||||
classNames: {
|
|
||||||
toast:
|
|
||||||
"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",
|
|
||||||
description: "group-[.toast]:text-muted-foreground",
|
|
||||||
actionButton:
|
|
||||||
"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",
|
|
||||||
cancelButton:
|
|
||||||
"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground",
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
{...props}
|
|
||||||
/>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
export { Toaster }
|
|
||||||
|
|
@ -1,47 +0,0 @@
|
||||||
"use client";
|
|
||||||
import React, { useState, useEffect } from "react";
|
|
||||||
import JSEncrypt from "jsencrypt";
|
|
||||||
|
|
||||||
interface UseDecryptWithPrivateKeyHookResult {
|
|
||||||
decryptedData: string;
|
|
||||||
error: Error | null;
|
|
||||||
}
|
|
||||||
export default function useDecrypt(encryptedData: any) {
|
|
||||||
const [decryptedData, setDecryptedData] = useState<any>("");
|
|
||||||
const [error, setError] = useState<any>(null);
|
|
||||||
const privateKey = `-----BEGIN RSA PRIVATE KEY-----
|
|
||||||
MIICXAIBAAKBgQCfmb1aGcWsqJPp+v6e72CPngE6P6FoCZCJESwDTXUXiJiAKshB
|
|
||||||
WZ9nlN+IIpQr6h8gmxi8SWbofPWmSKZgTyU2MddxUanneuywPTTUj4HQ6/DUaDwF
|
|
||||||
0Vr6Fk0x4yi1GKpBzhRFPyOYBWVXKIw23j0l+EWw6+JIpR9Kwu0TezHHFQIDAQAB
|
|
||||||
AoGBAIVxegy3t7vhR6s/HV2uMEJkjgox4banKJ4yKWapgNmocDnZi454bPuiUjP1
|
|
||||||
FYaSPmx4wXnMtap1sL7Tx6iHBEi10KB1AghDZP5wJHz6nm9ugcrGSSWhVJM74x6C
|
|
||||||
ThVztAV/rydaZ6/DLaqsBg5lHlo1DjMKq4sxnqrw/LUMGtOBAkEAzt8bnM1Ij/rF
|
|
||||||
i8oSP3gI0H914vf/0N2xxGGdQvMmJK0oijIm5j8dFDZf02Ft34SFeVJfXyVPapDE
|
|
||||||
vQ6TRw+1HQJBAMWAwvbypbtl65Dn4qCj3oJUmmnjjxm5080idF1S6ufo34p2gHMF
|
|
||||||
qLtWjmnGqjh2Shs7ahnfbLF+cxzgBg7yEFkCQFYGl1/0Sel9uepwpHf6PYgeiPJS
|
|
||||||
ePHtTwBAK3pszH7R9xrI0j5LHpeKKP0o9dzOKgcShxB03nqNKxMHXZ1eXc0CQFhD
|
|
||||||
Ot3xgm9FFQklF/qCQSYtePRpZcIxcZ3zD93E+IW7ZGsUmkLM/KL8A5jx15B0DJou
|
|
||||||
6zO0zXZk9DyrQQnc08ECQGy5ti89HmQ6I6Wqq5ADglCY6YPISsNwScVyvu/WxQsX
|
|
||||||
dEqG/38xFdYTFEekexcHnT/Vt1MW4/j76vBJHYWuAJU=
|
|
||||||
-----END RSA PRIVATE KEY-----`;
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
try {
|
|
||||||
const decryptor = new JSEncrypt();
|
|
||||||
decryptor.setPrivateKey(privateKey);
|
|
||||||
console.log(decryptor);
|
|
||||||
console.log(privateKey);
|
|
||||||
console.log(encryptedData);
|
|
||||||
const decrypted = decryptor.decrypt(
|
|
||||||
"FLjMFDdOUjeJDhBdTXjqkKDx81H6gWwXxvx0sQHTgDFiUoggMwCoJbn+eruMdjnppksh8zhm3rUPCIKeWe6SEuw1PX1MaKpDvZd7wNphKgWb6pLafTQTxsB0eLmTurYHkvtOyJkMHhdRravaEeoGSKmMeC9G2ahYpVYgobicBAU="
|
|
||||||
);
|
|
||||||
console.log(decrypted);
|
|
||||||
setDecryptedData(decrypted);
|
|
||||||
} catch (error) {
|
|
||||||
console.log(error);
|
|
||||||
setError(error);
|
|
||||||
}
|
|
||||||
}, [encryptedData]);
|
|
||||||
|
|
||||||
return [decryptedData, error];
|
|
||||||
}
|
|
||||||
43
lib/utils.ts
43
lib/utils.ts
|
|
@ -1,43 +1,6 @@
|
||||||
import { type ClassValue, clsx } from "clsx";
|
import { type ClassValue, clsx } from "clsx"
|
||||||
import { twMerge } from "tailwind-merge";
|
import { twMerge } from "tailwind-merge"
|
||||||
import dayjs from "dayjs";
|
|
||||||
import utc from "dayjs/plugin/utc";
|
|
||||||
import jalaliday from "jalaliday";
|
|
||||||
import JSEncrypt from "jsencrypt";
|
|
||||||
|
|
||||||
dayjs.extend(jalaliday);
|
|
||||||
dayjs.extend(utc);
|
|
||||||
export function cn(...inputs: ClassValue[]) {
|
export function cn(...inputs: ClassValue[]) {
|
||||||
return twMerge(clsx(inputs));
|
return twMerge(clsx(inputs))
|
||||||
}
|
|
||||||
|
|
||||||
export function convertDate(date: string) {
|
|
||||||
const convertedDate = dayjs(date)
|
|
||||||
.calendar("jalali")
|
|
||||||
.locale("fa")
|
|
||||||
.format("YYYY/M/DD");
|
|
||||||
console.log(convertDate);
|
|
||||||
return convertedDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function Decrypt(encryptedData: string , privateKey: string) {
|
|
||||||
const Key = `-----BEGIN RSA PRIVATE KEY-----
|
|
||||||
MIICXAIBAAKBgQCfmb1aGcWsqJPp+v6e72CPngE6P6FoCZCJESwDTXUXiJiAKshB
|
|
||||||
WZ9nlN+IIpQr6h8gmxi8SWbofPWmSKZgTyU2MddxUanneuywPTTUj4HQ6/DUaDwF
|
|
||||||
0Vr6Fk0x4yi1GKpBzhRFPyOYBWVXKIw23j0l+EWw6+JIpR9Kwu0TezHHFQIDAQAB
|
|
||||||
AoGBAIVxegy3t7vhR6s/HV2uMEJkjgox4banKJ4yKWapgNmocDnZi454bPuiUjP1
|
|
||||||
FYaSPmx4wXnMtap1sL7Tx6iHBEi10KB1AghDZP5wJHz6nm9ugcrGSSWhVJM74x6C
|
|
||||||
ThVztAV/rydaZ6/DLaqsBg5lHlo1DjMKq4sxnqrw/LUMGtOBAkEAzt8bnM1Ij/rF
|
|
||||||
i8oSP3gI0H914vf/0N2xxGGdQvMmJK0oijIm5j8dFDZf02Ft34SFeVJfXyVPapDE
|
|
||||||
vQ6TRw+1HQJBAMWAwvbypbtl65Dn4qCj3oJUmmnjjxm5080idF1S6ufo34p2gHMF
|
|
||||||
qLtWjmnGqjh2Shs7ahnfbLF+cxzgBg7yEFkCQFYGl1/0Sel9uepwpHf6PYgeiPJS
|
|
||||||
ePHtTwBAK3pszH7R9xrI0j5LHpeKKP0o9dzOKgcShxB03nqNKxMHXZ1eXc0CQFhD
|
|
||||||
Ot3xgm9FFQklF/qCQSYtePRpZcIxcZ3zD93E+IW7ZGsUmkLM/KL8A5jx15B0DJou
|
|
||||||
6zO0zXZk9DyrQQnc08ECQGy5ti89HmQ6I6Wqq5ADglCY6YPISsNwScVyvu/WxQsX
|
|
||||||
dEqG/38xFdYTFEekexcHnT/Vt1MW4/j76vBJHYWuAJU=
|
|
||||||
-----END RSA PRIVATE KEY-----`;
|
|
||||||
const decryptor = new JSEncrypt();
|
|
||||||
decryptor.setPrivateKey(privateKey);
|
|
||||||
const decrypted = decryptor.decrypt(encryptedData);
|
|
||||||
return decrypted;
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,11 +10,9 @@
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@hookform/resolvers": "^3.3.2",
|
"@hookform/resolvers": "^3.3.2",
|
||||||
"@radix-ui/react-alert-dialog": "^1.0.5",
|
"@radix-ui/react-alert-dialog": "^1.0.5",
|
||||||
"@radix-ui/react-dialog": "^1.0.5",
|
|
||||||
"@radix-ui/react-dropdown-menu": "^2.0.6",
|
"@radix-ui/react-dropdown-menu": "^2.0.6",
|
||||||
"@radix-ui/react-icons": "^1.3.0",
|
"@radix-ui/react-icons": "^1.3.0",
|
||||||
"@radix-ui/react-label": "^2.0.2",
|
"@radix-ui/react-label": "^2.0.2",
|
||||||
"@radix-ui/react-radio-group": "^1.1.3",
|
|
||||||
"@radix-ui/react-select": "^2.0.0",
|
"@radix-ui/react-select": "^2.0.0",
|
||||||
"@radix-ui/react-slot": "^1.0.2",
|
"@radix-ui/react-slot": "^1.0.2",
|
||||||
"@radix-ui/react-tabs": "^1.0.4",
|
"@radix-ui/react-tabs": "^1.0.4",
|
||||||
|
|
@ -27,18 +25,15 @@
|
||||||
"class-variance-authority": "^0.7.0",
|
"class-variance-authority": "^0.7.0",
|
||||||
"clsx": "^2.0.0",
|
"clsx": "^2.0.0",
|
||||||
"cookies-next": "^4.1.0",
|
"cookies-next": "^4.1.0",
|
||||||
"dayjs": "^1.11.10",
|
|
||||||
"framer-motion": "^10.16.16",
|
"framer-motion": "^10.16.16",
|
||||||
"hamburger-react": "^2.5.0",
|
"hamburger-react": "^2.5.0",
|
||||||
"i": "^0.3.7",
|
"i": "^0.3.7",
|
||||||
"jalaliday": "^2.3.0",
|
|
||||||
"jsencrypt": "^3.3.2",
|
"jsencrypt": "^3.3.2",
|
||||||
"jwt-decode": "^4.0.0",
|
"jwt-decode": "^4.0.0",
|
||||||
"leaflet": "^1.9.4",
|
"leaflet": "^1.9.4",
|
||||||
"leaflet-geosearch": "^3.11.0",
|
"leaflet-geosearch": "^3.11.0",
|
||||||
"lucide-react": "^0.292.0",
|
"lucide-react": "^0.292.0",
|
||||||
"next": "14.0.3",
|
"next": "14.0.3",
|
||||||
"next-themes": "^0.2.1",
|
|
||||||
"npm": "^10.2.5",
|
"npm": "^10.2.5",
|
||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
"react-chartjs-2": "^5.2.0",
|
"react-chartjs-2": "^5.2.0",
|
||||||
|
|
@ -52,7 +47,6 @@
|
||||||
"react-spinners": "^0.13.8",
|
"react-spinners": "^0.13.8",
|
||||||
"react-to-print": "^2.14.15",
|
"react-to-print": "^2.14.15",
|
||||||
"react-use": "^17.4.2",
|
"react-use": "^17.4.2",
|
||||||
"sonner": "^1.3.1",
|
|
||||||
"swiper": "^11.0.5",
|
"swiper": "^11.0.5",
|
||||||
"tailwind-merge": "^2.1.0",
|
"tailwind-merge": "^2.1.0",
|
||||||
"tailwindcss-animate": "^1.0.7",
|
"tailwindcss-animate": "^1.0.7",
|
||||||
|
|
@ -978,38 +972,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@radix-ui/react-radio-group": {
|
|
||||||
"version": "1.1.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/@radix-ui/react-radio-group/-/react-radio-group-1.1.3.tgz",
|
|
||||||
"integrity": "sha512-x+yELayyefNeKeTx4fjK6j99Fs6c4qKm3aY38G3swQVTN6xMpsrbigC0uHs2L//g8q4qR7qOcww8430jJmi2ag==",
|
|
||||||
"dependencies": {
|
|
||||||
"@babel/runtime": "^7.13.10",
|
|
||||||
"@radix-ui/primitive": "1.0.1",
|
|
||||||
"@radix-ui/react-compose-refs": "1.0.1",
|
|
||||||
"@radix-ui/react-context": "1.0.1",
|
|
||||||
"@radix-ui/react-direction": "1.0.1",
|
|
||||||
"@radix-ui/react-presence": "1.0.1",
|
|
||||||
"@radix-ui/react-primitive": "1.0.3",
|
|
||||||
"@radix-ui/react-roving-focus": "1.0.4",
|
|
||||||
"@radix-ui/react-use-controllable-state": "1.0.1",
|
|
||||||
"@radix-ui/react-use-previous": "1.0.1",
|
|
||||||
"@radix-ui/react-use-size": "1.0.1"
|
|
||||||
},
|
|
||||||
"peerDependencies": {
|
|
||||||
"@types/react": "*",
|
|
||||||
"@types/react-dom": "*",
|
|
||||||
"react": "^16.8 || ^17.0 || ^18.0",
|
|
||||||
"react-dom": "^16.8 || ^17.0 || ^18.0"
|
|
||||||
},
|
|
||||||
"peerDependenciesMeta": {
|
|
||||||
"@types/react": {
|
|
||||||
"optional": true
|
|
||||||
},
|
|
||||||
"@types/react-dom": {
|
|
||||||
"optional": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@radix-ui/react-roving-focus": {
|
"node_modules/@radix-ui/react-roving-focus": {
|
||||||
"version": "1.0.4",
|
"version": "1.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/@radix-ui/react-roving-focus/-/react-roving-focus-1.0.4.tgz",
|
"resolved": "https://registry.npmjs.org/@radix-ui/react-roving-focus/-/react-roving-focus-1.0.4.tgz",
|
||||||
|
|
@ -2305,11 +2267,6 @@
|
||||||
"integrity": "sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA==",
|
"integrity": "sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/dayjs": {
|
|
||||||
"version": "1.11.10",
|
|
||||||
"resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.10.tgz",
|
|
||||||
"integrity": "sha512-vjAczensTgRcqDERK0SR2XMwsF/tSvnvlv6VcF2GIhg6Sx4yOIt/irsr1RDJsKiIyBzJDpCoXiWWq28MqH2cnQ=="
|
|
||||||
},
|
|
||||||
"node_modules/debug": {
|
"node_modules/debug": {
|
||||||
"version": "4.3.4",
|
"version": "4.3.4",
|
||||||
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",
|
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",
|
||||||
|
|
@ -3940,11 +3897,6 @@
|
||||||
"set-function-name": "^2.0.1"
|
"set-function-name": "^2.0.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/jalaliday": {
|
|
||||||
"version": "2.3.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/jalaliday/-/jalaliday-2.3.0.tgz",
|
|
||||||
"integrity": "sha512-B/m3TqsRrTFED/HBDqON6rPKe0MpoLxNICZ5uZeZ/scHJUHKQNr1n+wdZSj8MxrY1Bmo05gllZeNEw4beXd2oQ=="
|
|
||||||
},
|
|
||||||
"node_modules/jiti": {
|
"node_modules/jiti": {
|
||||||
"version": "1.21.0",
|
"version": "1.21.0",
|
||||||
"resolved": "https://registry.npmjs.org/jiti/-/jiti-1.21.0.tgz",
|
"resolved": "https://registry.npmjs.org/jiti/-/jiti-1.21.0.tgz",
|
||||||
|
|
@ -4327,16 +4279,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/next-themes": {
|
|
||||||
"version": "0.2.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/next-themes/-/next-themes-0.2.1.tgz",
|
|
||||||
"integrity": "sha512-B+AKNfYNIzh0vqQQKqQItTS8evEouKD7H5Hj3kmuPERwddR2TxvDSFZuTj6T7Jfn1oyeUyJMydPl1Bkxkh0W7A==",
|
|
||||||
"peerDependencies": {
|
|
||||||
"next": "*",
|
|
||||||
"react": "*",
|
|
||||||
"react-dom": "*"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/node-releases": {
|
"node_modules/node-releases": {
|
||||||
"version": "2.0.13",
|
"version": "2.0.13",
|
||||||
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.13.tgz",
|
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.13.tgz",
|
||||||
|
|
@ -8095,15 +8037,6 @@
|
||||||
"node": ">=8"
|
"node": ">=8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/sonner": {
|
|
||||||
"version": "1.3.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/sonner/-/sonner-1.3.1.tgz",
|
|
||||||
"integrity": "sha512-+rOAO56b2eI3q5BtgljERSn2umRk63KFIvgb2ohbZ5X+Eb5u+a/7/0ZgswYqgBMg8dyl7n6OXd9KasA8QF9ToA==",
|
|
||||||
"peerDependencies": {
|
|
||||||
"react": "^18.0.0",
|
|
||||||
"react-dom": "^18.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/source-map": {
|
"node_modules/source-map": {
|
||||||
"version": "0.6.1",
|
"version": "0.6.1",
|
||||||
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
|
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
|
||||||
|
|
|
||||||
|
|
@ -11,11 +11,9 @@
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@hookform/resolvers": "^3.3.2",
|
"@hookform/resolvers": "^3.3.2",
|
||||||
"@radix-ui/react-alert-dialog": "^1.0.5",
|
"@radix-ui/react-alert-dialog": "^1.0.5",
|
||||||
"@radix-ui/react-dialog": "^1.0.5",
|
|
||||||
"@radix-ui/react-dropdown-menu": "^2.0.6",
|
"@radix-ui/react-dropdown-menu": "^2.0.6",
|
||||||
"@radix-ui/react-icons": "^1.3.0",
|
"@radix-ui/react-icons": "^1.3.0",
|
||||||
"@radix-ui/react-label": "^2.0.2",
|
"@radix-ui/react-label": "^2.0.2",
|
||||||
"@radix-ui/react-radio-group": "^1.1.3",
|
|
||||||
"@radix-ui/react-select": "^2.0.0",
|
"@radix-ui/react-select": "^2.0.0",
|
||||||
"@radix-ui/react-slot": "^1.0.2",
|
"@radix-ui/react-slot": "^1.0.2",
|
||||||
"@radix-ui/react-tabs": "^1.0.4",
|
"@radix-ui/react-tabs": "^1.0.4",
|
||||||
|
|
@ -28,18 +26,15 @@
|
||||||
"class-variance-authority": "^0.7.0",
|
"class-variance-authority": "^0.7.0",
|
||||||
"clsx": "^2.0.0",
|
"clsx": "^2.0.0",
|
||||||
"cookies-next": "^4.1.0",
|
"cookies-next": "^4.1.0",
|
||||||
"dayjs": "^1.11.10",
|
|
||||||
"framer-motion": "^10.16.16",
|
"framer-motion": "^10.16.16",
|
||||||
"hamburger-react": "^2.5.0",
|
"hamburger-react": "^2.5.0",
|
||||||
"i": "^0.3.7",
|
"i": "^0.3.7",
|
||||||
"jalaliday": "^2.3.0",
|
|
||||||
"jsencrypt": "^3.3.2",
|
"jsencrypt": "^3.3.2",
|
||||||
"jwt-decode": "^4.0.0",
|
"jwt-decode": "^4.0.0",
|
||||||
"leaflet": "^1.9.4",
|
"leaflet": "^1.9.4",
|
||||||
"leaflet-geosearch": "^3.11.0",
|
"leaflet-geosearch": "^3.11.0",
|
||||||
"lucide-react": "^0.292.0",
|
"lucide-react": "^0.292.0",
|
||||||
"next": "14.0.3",
|
"next": "14.0.3",
|
||||||
"next-themes": "^0.2.1",
|
|
||||||
"npm": "^10.2.5",
|
"npm": "^10.2.5",
|
||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
"react-chartjs-2": "^5.2.0",
|
"react-chartjs-2": "^5.2.0",
|
||||||
|
|
@ -53,7 +48,6 @@
|
||||||
"react-spinners": "^0.13.8",
|
"react-spinners": "^0.13.8",
|
||||||
"react-to-print": "^2.14.15",
|
"react-to-print": "^2.14.15",
|
||||||
"react-use": "^17.4.2",
|
"react-use": "^17.4.2",
|
||||||
"sonner": "^1.3.1",
|
|
||||||
"swiper": "^11.0.5",
|
"swiper": "^11.0.5",
|
||||||
"tailwind-merge": "^2.1.0",
|
"tailwind-merge": "^2.1.0",
|
||||||
"tailwindcss-animate": "^1.0.7",
|
"tailwindcss-animate": "^1.0.7",
|
||||||
|
|
|
||||||
|
|
@ -28,3 +28,12 @@ const useData = create<Store>()(
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
export default useData;
|
export default useData;
|
||||||
|
// function Counter() {
|
||||||
|
// const { count, inc } = useStore()
|
||||||
|
// return (
|
||||||
|
// <div>
|
||||||
|
// <span>{count}</span>
|
||||||
|
// <button onClick={inc}>one up</button>
|
||||||
|
// </div>
|
||||||
|
// )
|
||||||
|
// }
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,8 @@ module.exports = {
|
||||||
blue50: "#335F9380",
|
blue50: "#335F9380",
|
||||||
yellow: "#F7A600",
|
yellow: "#F7A600",
|
||||||
brown: "#D28249",
|
brown: "#D28249",
|
||||||
gray: "#BFBFBF",
|
gray:"#BFBFBF",
|
||||||
|
red:"#FF0000",
|
||||||
border: "hsl(var(--border))",
|
border: "hsl(var(--border))",
|
||||||
input: "hsl(var(--input))",
|
input: "hsl(var(--input))",
|
||||||
ring: "hsl(var(--ring))",
|
ring: "hsl(var(--ring))",
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,7 @@
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import { CookieValueTypes, getCookie } from "cookies-next";
|
import { CookieValueTypes, getCookie } from "cookies-next";
|
||||||
|
|
||||||
axios.defaults.baseURL = process.env.NEXT_PUBLIC_BASE_URL_APP;
|
axios.defaults.baseURL = "https://sootzaniapi.shetabdahi.ir/";
|
||||||
|
|
||||||
axios.interceptors.request.use(function (config) {
|
axios.interceptors.request.use(function (config) {
|
||||||
const token = getCookie("Sootzani_Token");
|
const token = getCookie("Sootzani_Token");
|
||||||
config.headers.Authorization = token ? `Bearer ${token}` : "";
|
config.headers.Authorization = token ? `Bearer ${token}` : "";
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue