Compare commits
2 Commits
fc5c0a4f76
...
c92dd8140c
| Author | SHA1 | Date |
|---|---|---|
|
|
c92dd8140c | |
|
|
fb16a96ac4 |
|
|
@ -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,9 +25,10 @@ export default function RootLayout({
|
||||||
<Navbar />
|
<Navbar />
|
||||||
<NavbarSm />
|
<NavbarSm />
|
||||||
|
|
||||||
<div className="flex justify-center overflow-x-hidden">{children}</div>
|
<div className="flex justify-center">{children}</div>
|
||||||
|
|
||||||
<Toaster />
|
<Toaster />
|
||||||
|
<SonnerToaster />
|
||||||
</Provider>
|
</Provider>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -1,58 +1,227 @@
|
||||||
import React from "react";
|
"use client";
|
||||||
|
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">
|
<div className="w-[95vw] lg:w-[82vw] xl:w-[70vw] 3xl:w-[65vw] mt-16 sm:mt-8 pt-9 mx-auto mb-10">
|
||||||
|
{data ? (
|
||||||
<div className="w-full flex flex-col md:flex-row min-h-[60vh] gap-5">
|
<div className="w-full flex gap-3 items-start">
|
||||||
{/* Right */}
|
<div className="flex flex-col w-1/3 order-2 gap-3 !sticky top-48 ">
|
||||||
<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">
|
<div className=" bg-[#E9E9E9] rounded-md py-4 px-10 flex flex-col">
|
||||||
<p className="text-[#464646] text-base font-bold">گزارش شکایات</p>
|
<p className="text-[#464646] text-base font-bold">گزارش شکایت</p>
|
||||||
<div className="">
|
<div className="mt-2">
|
||||||
|
<p className="text-[#2e2a2a] text-sm font-medium">
|
||||||
|
موضوع شکایت:{" "}
|
||||||
|
<span className="text-[#7C838A] text-sm font-medium">
|
||||||
|
{data.title}
|
||||||
|
</span>
|
||||||
|
</p>
|
||||||
<p className="text-[#464646] text-sm font-medium">
|
<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 className="text-[#7C838A] text-sm font-medium">
|
||||||
متن تستی
|
متن تستی
|
||||||
</span>
|
</span>
|
||||||
</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>
|
</div>
|
||||||
<p className="text-[#464646] text-sm font-medium text-justify">
|
{/* <p className="text-[#464646] text-sm font-medium text-justify">
|
||||||
درخواست شما با کد رهگیری 1243230783 و رمز عبور 12422 در دست بررسی و
|
درخواست شما با کد رهگیری {data.trackingNumber} و رمز عبور 12422 در
|
||||||
اقدام می باشد. در صورت تمایل می توانید با شماره تلفن 0353286545 جهت
|
دست بررسی و اقدام می باشد. در صورت تمایل می توانید با شماره تلفن
|
||||||
پشتیبانی تماس حاصل کنید.{" "}
|
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>
|
</p>
|
||||||
</div>
|
</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 */}
|
{/* 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">
|
{/* <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 className="text-[#464646] text-base font-bold mb-3">
|
||||||
وضعیت درخواست
|
وضعیت درخواست
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
{/* 1 */}
|
|
||||||
{ComplainDetailsItems.map((item, index, array) => {
|
{ComplainDetailsItems.map((item, index, array) => {
|
||||||
return (
|
return (
|
||||||
<div className="w-full justify-start items-start gap-4 inline-flex " key={item.id}>
|
<div
|
||||||
|
className="w-full justify-start items-start gap-4 inline-flex "
|
||||||
|
key={item.id}
|
||||||
|
>
|
||||||
<div className="grow shrink basis-0 pb-2 flex-col justify-start items-start gap-1 inline-flex">
|
<div className="grow shrink basis-0 pb-2 flex-col justify-start items-start gap-1 inline-flex">
|
||||||
<div className="self-stretch text-right text-lime-800 text-lg font-semibold leading-[30px]">
|
<div className="self-stretch text-right text-lime-800 text-lg font-semibold leading-[30px]">
|
||||||
{item.title}
|
{item.title}
|
||||||
|
|
@ -79,8 +248,11 @@ export default function ComplainsDetails({ id }: { id: number }) {
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
|
</div> */}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
) : (
|
||||||
|
""
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,22 +1,28 @@
|
||||||
"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 {
|
const { data, isLoading, refetch } = useQuery({
|
||||||
data,
|
|
||||||
isLoading,
|
|
||||||
refetch,
|
|
||||||
} = useQuery({
|
|
||||||
queryKey: ["ComplaintsList"],
|
queryKey: ["ComplaintsList"],
|
||||||
queryFn: () => getComplaintsList(),
|
queryFn: () => getComplaintsList(),
|
||||||
refetchOnWindowFocus: false,
|
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 */}
|
||||||
|
|
@ -62,7 +68,6 @@ export default function ControllerDashboard() {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,114 @@
|
||||||
|
"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>متن</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">
|
||||||
|
<Button className="" type="submit">
|
||||||
|
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 dark:text-white">
|
<p className="text-sm md:text-base font-bold leading-tight tracking-tight text-red-800 dark:text-white">
|
||||||
در صورت عدم تمایل به ثبت مشخصات شخصی می توانید به صفحه ی بعد مراجعه کنید.
|
در صورت عدم تمایل به ثبت مشخصات شخصی می توانید به صفحه ی بعد مراجعه کنید.
|
||||||
</p>
|
</p>
|
||||||
<Form {...form}>
|
<Form {...form}>
|
||||||
|
|
|
||||||
|
|
@ -1,45 +1,184 @@
|
||||||
import React from "react";
|
"use client";
|
||||||
|
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() {
|
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);
|
||||||
|
};
|
||||||
|
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>
|
||||||
|
<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">
|
<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">
|
||||||
<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">
|
|
||||||
{/* Tab Title */}
|
{/* Tab Title */}
|
||||||
<TabsList className="w-full lg:w-2/3 flex gap-1 md:gap-4 lg:gap-7">
|
<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>
|
<p className="3xl:ml-6 text-xs sm:text-sm font-bold">
|
||||||
|
لیست شکایت ها |
|
||||||
|
</p>
|
||||||
|
|
||||||
<TabsTrigger value="tab1" className="hover:border-b-2 border-b-blue">جدید (2)</TabsTrigger>
|
<TabsTrigger
|
||||||
<TabsTrigger value="tab2" className="hover:border-b-2 border-b-blue">در انتظار پاسخ</TabsTrigger>
|
value="tab1"
|
||||||
<TabsTrigger value="tab3" className="hover:border-b-2 border-b-blue">در حال بررسی</TabsTrigger>
|
className="hover:border-b-2 border-b-blue"
|
||||||
<TabsTrigger value="tab4" className="hover:border-b-2 border-b-blue">پایان یافته </TabsTrigger>
|
>
|
||||||
|
جدید (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>
|
</TabsList>
|
||||||
|
|
||||||
{/* Search Box */}
|
{/* Search Box */}
|
||||||
<Search mode='controller'/>
|
<Search mode="controller" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Tab Content */}
|
{/* Tab Content */}
|
||||||
<TabsContent value="tab1" >
|
<TabsContent value="tab1">
|
||||||
<TableController />
|
<TableController
|
||||||
|
checkKey={(item: any) => checkKey(item)}
|
||||||
|
data={newComplaints}
|
||||||
|
/>
|
||||||
</TabsContent>
|
</TabsContent>
|
||||||
|
|
||||||
<TabsContent value="tab2">
|
<TabsContent value="tab2">
|
||||||
<p>password2</p>
|
<TableController
|
||||||
|
checkKey={(item: any) => checkKey(item)}
|
||||||
|
data={waitingForCitizenResponseComplaints}
|
||||||
|
/>
|
||||||
</TabsContent>
|
</TabsContent>
|
||||||
|
|
||||||
<TabsContent value="tab3">
|
<TabsContent value="tab3">
|
||||||
<p>password3</p>
|
<TableController
|
||||||
|
checkKey={(item: any) => checkKey(item)}
|
||||||
|
data={inProgressComplaints}
|
||||||
|
/>
|
||||||
</TabsContent>
|
</TabsContent>
|
||||||
|
|
||||||
<TabsContent value="tab4">
|
<TabsContent value="tab4">
|
||||||
<p>password4</p>
|
<TableController
|
||||||
|
checkKey={(item: any) => checkKey(item)}
|
||||||
|
data={finishedComplaints}
|
||||||
|
/>
|
||||||
</TabsContent>
|
</TabsContent>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
|
<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={() => {
|
||||||
|
toast("کلید شما با موفقیت ذخیره شد.", {
|
||||||
|
className: "!bg-green-500 !text-white",
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
type="submit"
|
||||||
|
>
|
||||||
|
ذخیره
|
||||||
|
</Button>
|
||||||
|
</DialogClose>
|
||||||
|
</DialogFooter>
|
||||||
|
</DialogContent>
|
||||||
|
</Dialog>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import React from "react";
|
import React, { useState } from "react";
|
||||||
import {
|
import {
|
||||||
Table,
|
Table,
|
||||||
TableBody,
|
TableBody,
|
||||||
|
|
@ -8,11 +8,87 @@ 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);
|
||||||
|
};
|
||||||
|
|
||||||
export default function TableController() {
|
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 {
|
||||||
|
// }
|
||||||
|
// };
|
||||||
return (
|
return (
|
||||||
|
<div>
|
||||||
|
<Dialog>
|
||||||
|
{/* <DialogTrigger className=" appearance-none" asChild>
|
||||||
|
<Button
|
||||||
|
// onClick={handelVerify}
|
||||||
|
type="submit"
|
||||||
|
className="bg-blue hover:bg-blue/90 text-white w-36 p-2 rounded-xl"
|
||||||
|
>
|
||||||
|
بارگذاری کلید جدید
|
||||||
|
</Button>
|
||||||
|
</DialogTrigger> */}
|
||||||
|
|
||||||
<Table className="border-[1px] border-solid border-muted rounded-md ">
|
<Table className="border-[1px] border-solid border-muted rounded-md ">
|
||||||
{/* <TableCaption>A list of your recent invoices.</TableCaption> */}
|
{/* <TableCaption>A list of your recent invoices.</TableCaption> */}
|
||||||
<TableHeader>
|
<TableHeader>
|
||||||
|
|
@ -24,22 +100,75 @@ export default function TableController() {
|
||||||
</TableRow>
|
</TableRow>
|
||||||
</TableHeader>
|
</TableHeader>
|
||||||
<TableBody className="bg-[#F5F5F5]">
|
<TableBody className="bg-[#F5F5F5]">
|
||||||
{ControllerTableItems.map((item) => {
|
{data?.map((item: Complaint, index: number) => {
|
||||||
return (
|
return (
|
||||||
<TableRow key={item.id}>
|
<TableRow
|
||||||
<Link
|
onClick={
|
||||||
href={`/UserPanel/ControllerDashboard/Complaints/${item.id}`}
|
() => checkKey(item)
|
||||||
className="contents "
|
// saveData({
|
||||||
|
// trackingNumber: item.trackingNumber,
|
||||||
|
// password: Decrypt(item.cipherKeyInspector),
|
||||||
|
// })
|
||||||
|
}
|
||||||
|
className=" hover:bg-gray-200 cursor-pointer"
|
||||||
|
key={item.id}
|
||||||
>
|
>
|
||||||
<TableCell className="w-1/12 font-medium ">{item.id}</TableCell>
|
{/* <Link
|
||||||
<TableCell className="w-2/12">{item.date}</TableCell>
|
href={`/UserPanel/ControllerDashboard/Complaints/${item.id}`}
|
||||||
<TableCell className="w-2/12">{item.title}</TableCell>
|
className="contents"
|
||||||
<TableCell className="w-7/12">{item.content}</TableCell>
|
> */}
|
||||||
</Link>
|
<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>
|
</TableRow>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</TableBody>
|
</TableBody>
|
||||||
</Table>
|
</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"
|
||||||
|
>
|
||||||
|
ذخیره
|
||||||
|
</Button>
|
||||||
|
</DialogClose>
|
||||||
|
</DialogFooter>
|
||||||
|
</DialogContent>
|
||||||
|
</Dialog>
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ export default function Verify() {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
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]
|
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]
|
||||||
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">
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,36 @@
|
||||||
|
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 }
|
||||||
|
|
@ -0,0 +1,122 @@
|
||||||
|
"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,
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,44 @@
|
||||||
|
"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 }
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
"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 }
|
||||||
|
|
@ -0,0 +1,47 @@
|
||||||
|
"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,6 +1,43 @@
|
||||||
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,9 +10,11 @@
|
||||||
"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",
|
||||||
|
|
@ -25,15 +27,18 @@
|
||||||
"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",
|
||||||
|
|
@ -46,6 +51,7 @@
|
||||||
"react-responsive": "^9.0.2",
|
"react-responsive": "^9.0.2",
|
||||||
"react-spinners": "^0.13.8",
|
"react-spinners": "^0.13.8",
|
||||||
"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",
|
||||||
|
|
@ -971,6 +977,38 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"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",
|
||||||
|
|
@ -2217,6 +2255,21 @@
|
||||||
"hyphenate-style-name": "^1.0.3"
|
"hyphenate-style-name": "^1.0.3"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/css-mediaquery": {
|
||||||
|
"version": "0.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/css-mediaquery/-/css-mediaquery-0.1.2.tgz",
|
||||||
|
"integrity": "sha512-COtn4EROW5dBGlE/4PiKnh6rZpAPxDeFLaEEwt4i10jpDMFt2EhQGS79QmmrO+iKCHv0PU/HrOWEhijFd1x99Q=="
|
||||||
|
},
|
||||||
|
"node_modules/css-to-react-native": {
|
||||||
|
"version": "3.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/css-to-react-native/-/css-to-react-native-3.2.0.tgz",
|
||||||
|
"integrity": "sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==",
|
||||||
|
"dependencies": {
|
||||||
|
"camelize": "^1.0.0",
|
||||||
|
"css-color-keywords": "^1.0.0",
|
||||||
|
"postcss-value-parser": "^4.0.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/css-tree": {
|
"node_modules/css-tree": {
|
||||||
"version": "1.1.3",
|
"version": "1.1.3",
|
||||||
"resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.1.3.tgz",
|
"resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.1.3.tgz",
|
||||||
|
|
@ -2251,6 +2304,11 @@
|
||||||
"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",
|
||||||
|
|
@ -3881,6 +3939,11 @@
|
||||||
"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",
|
||||||
|
|
@ -4263,6 +4326,16 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"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",
|
||||||
|
|
@ -7958,6 +8031,16 @@
|
||||||
"node": ">=6.9"
|
"node": ">=6.9"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/shallow-equal": {
|
||||||
|
"version": "1.2.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/shallow-equal/-/shallow-equal-1.2.1.tgz",
|
||||||
|
"integrity": "sha512-S4vJDjHHMBaiZuT9NPb616CSmLf618jawtv3sufLl6ivK8WocjAo58cXwbRV1cgqxH0Qbv+iUt6m05eqEa2IRA=="
|
||||||
|
},
|
||||||
|
"node_modules/shallowequal": {
|
||||||
|
"version": "1.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/shallowequal/-/shallowequal-1.1.0.tgz",
|
||||||
|
"integrity": "sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ=="
|
||||||
|
},
|
||||||
"node_modules/shebang-command": {
|
"node_modules/shebang-command": {
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
|
||||||
|
|
@ -8002,6 +8085,15 @@
|
||||||
"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",
|
||||||
|
|
@ -8164,6 +8256,51 @@
|
||||||
"url": "https://github.com/sponsors/sindresorhus"
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/styled-components": {
|
||||||
|
"version": "6.1.6",
|
||||||
|
"resolved": "https://registry.npmjs.org/styled-components/-/styled-components-6.1.6.tgz",
|
||||||
|
"integrity": "sha512-DgTLULSC29xpabJ24bbn1+hulU6vvGFQf4RPwBOJrm8WJFnN42yXpo5voBt3jDSJBa5tBd1L6PqswJjQ0wRKdg==",
|
||||||
|
"dependencies": {
|
||||||
|
"@emotion/is-prop-valid": "1.2.1",
|
||||||
|
"@emotion/unitless": "0.8.0",
|
||||||
|
"@types/stylis": "4.2.0",
|
||||||
|
"css-to-react-native": "3.2.0",
|
||||||
|
"csstype": "3.1.2",
|
||||||
|
"postcss": "8.4.31",
|
||||||
|
"shallowequal": "1.1.0",
|
||||||
|
"stylis": "4.3.1",
|
||||||
|
"tslib": "2.5.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 16"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/styled-components"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"react": ">= 16.8.0",
|
||||||
|
"react-dom": ">= 16.8.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/styled-components/node_modules/@emotion/is-prop-valid": {
|
||||||
|
"version": "1.2.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/@emotion/is-prop-valid/-/is-prop-valid-1.2.1.tgz",
|
||||||
|
"integrity": "sha512-61Mf7Ufx4aDxx1xlDeOm8aFFigGHE4z+0sKCa+IHCeZKiyP9RLD0Mmx7m8b9/Cf37f7NAvQOOJAbQQGVr5uERw==",
|
||||||
|
"dependencies": {
|
||||||
|
"@emotion/memoize": "^0.8.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/styled-components/node_modules/@emotion/memoize": {
|
||||||
|
"version": "0.8.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.8.1.tgz",
|
||||||
|
"integrity": "sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA=="
|
||||||
|
},
|
||||||
|
"node_modules/styled-components/node_modules/tslib": {
|
||||||
|
"version": "2.5.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz",
|
||||||
|
"integrity": "sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg=="
|
||||||
|
},
|
||||||
"node_modules/styled-jsx": {
|
"node_modules/styled-jsx": {
|
||||||
"version": "5.1.1",
|
"version": "5.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/styled-jsx/-/styled-jsx-5.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/styled-jsx/-/styled-jsx-5.1.1.tgz",
|
||||||
|
|
|
||||||
|
|
@ -11,9 +11,11 @@
|
||||||
"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",
|
||||||
|
|
@ -26,15 +28,18 @@
|
||||||
"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",
|
||||||
|
|
@ -47,6 +52,7 @@
|
||||||
"react-responsive": "^9.0.2",
|
"react-responsive": "^9.0.2",
|
||||||
"react-spinners": "^0.13.8",
|
"react-spinners": "^0.13.8",
|
||||||
"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,12 +28,3 @@ 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,8 +29,7 @@ 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,7 +3,8 @@
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import { CookieValueTypes, getCookie } from "cookies-next";
|
import { CookieValueTypes, getCookie } from "cookies-next";
|
||||||
|
|
||||||
axios.defaults.baseURL = "https://sootzaniapi.shetabdahi.ir/";
|
axios.defaults.baseURL = process.env.NEXT_PUBLIC_BASE_URL_APP;
|
||||||
|
|
||||||
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