-
-
- {/* Tab Title */}
-
-
- {" "}
- نمودار شماره یک
-
-
- {" "}
- نمودار شماره 2
-
-
- {" "}
- نمودار شماره 3
-
-
- {" "}
- نمودار شماره 4
-
-
- {" "}
- نمودار شماره 5
-
-
- {" "}
- نمودار شماره 6
-
-
-
- {" "}
- نمودار شماره 7
-
-
-
- {" "}
- نمودار شماره 8
-
-
-
-
-
-
-
- {/* Tab Content */}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+ {data && }
);
}
diff --git a/components/RequestResult.tsx b/components/RequestResult.tsx
deleted file mode 100644
index 81e994c..0000000
--- a/components/RequestResult.tsx
+++ /dev/null
@@ -1,52 +0,0 @@
-"use client";
-
-import React, { useEffect } from "react";
-import Image from "next/image";
-import Resultimg from "../public/img/result.png";
-import { useQuery, useQueryClient } from "@tanstack/react-query";
-import { useRouter } from "next/navigation";
-
-export default function Result() {
- const trackingNumber = localStorage.getItem("trackingNumber");
- const password = localStorage.getItem("password");
- const router = useRouter();
-
-
- useEffect(() => {
- localStorage.removeItem("trackingNumber")
- localStorage.removeItem("password")
-}, [router]);
-
- return (
-
-
-
- با تشکر از شما
-
-
-
- درخواست شما با کد پیگیری
-
- {`${trackingNumber}`}
-
- و رمز عبور
-
- {`${password}`}
-
- در سامانه سوت زنی ثبت شده و شما می توانید نتیجه درخواست خود را از صفحه
- پیگیری درخواست، با استفاده از کد رهگیری و رمز عبور مشاهده کنید.
-
-
-
-
-
- );
-}
diff --git a/components/RequestStep1.tsx b/components/RequestStep1.tsx
deleted file mode 100644
index 5f99518..0000000
--- a/components/RequestStep1.tsx
+++ /dev/null
@@ -1,166 +0,0 @@
-"use client";
-import React from "react";
-
-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 { Input } from "@/components/ui/input";
-import { toast } from "@/components/ui/use-toast";
-import Link from "next/link";
-import RequestStep2 from "./RequestStep2";
-
-const FormSchema = z.object({
- firstName: z.string().min(2, {
- message: "firstName must be at least 2 characters.",
- }),
- lastName: z.string().min(2, {
- message: "lastName must be at least 2 characters.",
- }),
- nationalCode: z.number().min(10, {
- message: "nationalCode must be at least 10 characters.",
- }),
- phoneNumber: z.number().min(11, {
- message: "phoneNumber must be at least 11 characters.",
- }),
-});
-
-export default function RequestStep1() {
- const form = useForm
>({
- resolver: zodResolver(FormSchema),
- defaultValues: {
- firstName: "",
- lastName: "",
- // nationalCode: ,
- // phoneNumber: ,
- },
- });
-
- function onSubmit(data: z.infer) {
- toast({
- title: "You submitted the following values:",
- description: (
-
- {JSON.stringify(data, null, 2)}
-
- ),
- });
- console.log(data);
- }
-
- return (
-
-
-
- لطفا جهت ارسال درخواست فرم زیر را تکمیل نمایید.
-
-
- در صورت عدم تمایل به ثبت مشخصات شخصی می توانید به صفحه ی بعد مراجعه کنید.
-
-
-
-
-
- );
-}
diff --git a/components/RequestStep2.tsx b/components/RequestStep2.tsx
deleted file mode 100644
index 1789dea..0000000
--- a/components/RequestStep2.tsx
+++ /dev/null
@@ -1,421 +0,0 @@
-"use client";
-import React, { useState } from "react";
-
-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 {
- Select,
- SelectContent,
- SelectGroup,
- SelectItem,
- SelectLabel,
- SelectTrigger,
- SelectValue,
-} from "@/components/ui/select";
-
-import { Input } from "@/components/ui/input";
-import { toast } from "@/components/ui/use-toast";
-import { Textarea } from "@/components/ui/textarea";
-import { Label } from "@/components/ui/label";
-import Link from "next/link";
-import RequestResult from "./RequestResult";
-import Image from "next/image";
-import Img1 from "../public/img/logo.png";
-
-import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
-import { postComplaintSubmit } from "@/utils/citizenApi";
-import { useRouter } from "next/navigation";
-import { getCaptcha, getCategory } from "@/utils/commonApi";
-
-const MAX_IMAGE_SIZE = 5242880; // 5 MB
-const ALLOWED_IMAGE_TYPES = [
- "image/jpeg",
- "image/png",
- "image/webp",
- "image/jpg",
-];
-
-const FormSchema = z.object({
- subject: z.string().min(2, {
- message: "subject must be at least 2 characters.",
- }),
- organisation: z.string().min(2, {
- message: "organisation must be at least 2 characters.",
- }),
- person: z.string().min(2, {
- message: "personName must be at least 2 characters.",
- }),
- description: z
- .string()
- .min(5, {
- message: "description must be at least 5 characters.",
- })
- .max(200, {
- message: "description must not be longer than 200 characters.",
- }),
- uploadFile: z
- .custom((val) => val instanceof FileList, "Required")
- // .refine((files) => files.length > 0, `Required`)
- .refine((files) => files.length <= 5, `Maximum of 5 File are allowed.`)
- .refine(
- (files) => Array.from(files).every((file) => file.size <= MAX_IMAGE_SIZE),
- `Each file size should be less than 5 MB.`
- ),
- // .refine(
- // (files) =>
- // Array.from(files).every((file) =>
- // ALLOWED_IMAGE_TYPES.includes(file.type)
- // ),
- // "Only these types are allowed .jpg, .jpeg, .png and .webp"
- // ),
- categoryId: z.string({
- required_error: "Please select an category to display.",
- }),
- captchaValue: z.string().min(4, {
- message: "captcha must be at least 4 characters.",
- }),
-});
-
-// Form Hook
-export default function RequestStep2() {
- // const [trackingComplaint, setTrackingComplaint] = useState({});
-
- const router = useRouter();
-
- const complaintSubmitMutation = useMutation({
- mutationKey: ["complaintSubmit"],
- mutationFn: postComplaintSubmit,
-
- onSuccess: (res) => {
- console.log(res);
- localStorage.setItem("trackingNumber", res.trackingNumber);
- localStorage.setItem("password", res.password);
-
- // alert("Success");
- console.log("Success Step2");
- router.push("/RequestResult");
- // router.push("/RequestResult", { data: trackingComplaint });
- // return (res)
- },
- onError: (error) => {
- console.log(error);
- console.log(error?.message);
- },
- });
-
- // All Category
- const { data: categoryData } = useQuery({
- queryKey: ["Category"],
- queryFn: () => getCategory(),
- });
-
- // Captcha
- const { data: CaptchaData, isLoading } = useQuery({
- queryKey: ["Captcha"],
- queryFn: () => getCaptcha(),
- });
- // console.log(captchaData);
-
- const srcForImage = CaptchaData
- ? URL.createObjectURL(CaptchaData.data)
- : null;
-
- const form = useForm>({
- resolver: zodResolver(FormSchema),
- defaultValues: {
- subject: "",
- organisation: "",
- person: "",
- description: "",
- captchaValue: "",
- // uploadFile: null,
- },
- });
-
- function onSubmit(data: z.infer) {
- // toast({
- // title: "You submitted the following values:",
- // description: (
- //
- // {JSON.stringify(data, null, 2)}
- //
- // ),
- // });
-
- const formData = new FormData();
- formData.append("Title", data.subject);
- formData.append("Text", data.description);
- formData.append("CategoryId", data.categoryId);
- formData.append("Medias", data.uploadFile[0]);
- formData.append("Captcha.Value", data.captchaValue);
- formData.append("Captcha.Key", CaptchaData?.headers["captcha-key"]);
-
- complaintSubmitMutation.mutate({
- Data: formData,
- });
- resetField("Title");
- resetField("Text");
- resetField("Medias");
- resetField("CategoryId");
- resetField("Captcha.Value");
-
- console.log("submited");
- console.log(data);
- }
-
- const { resetField } = useForm();
-
- return (
-
-
-
- لطفا جهت ارسال درخواست فرم زیر را تکمیل نمایید.
-
-
-
-
-
-
- );
-}
diff --git a/components/SubmitRequest.tsx b/components/SubmitRequest.tsx
deleted file mode 100644
index 65ad4c7..0000000
--- a/components/SubmitRequest.tsx
+++ /dev/null
@@ -1,59 +0,0 @@
-"use client"
-import React from 'react'
-import Link from 'next/link'
-import { requestItems } from '@/constants'
-import Image from 'next/image'
-import svg1 from '../public/img/Connector line.svg'
-import { cn } from '@/lib/utils'
-import { IoArrowDown } from "react-icons/io5";
-
-export default function SubmitRequest() {
- return (
-
-
-
-
- درباره سامانه سوت زنی
-
-
-
-
-
-
-
- این سامانه با هدف بررسی درخواست های مردمی و شکایت های ایشان از پرسنل شهرداری و رسیدگی به آن ایجاد شده است.
- فلوچارت روبرو نحوه ارسال درخواست و پیگیری آن را مشاهده می کنید.
-
-
- برای شروع ارسال درخواست کلیک کنید.
-
-
-
- {requestItems.map((item) => {
- return (
- <>
-
-
-
-
-
- >
- )
- })}
-
-
-
-
- )
-}
diff --git a/components/TabController.tsx b/components/TabController.tsx
index 7498749..5abc336 100644
--- a/components/TabController.tsx
+++ b/components/TabController.tsx
@@ -91,7 +91,7 @@ export default function TabController() {
value="tab1"
className="hover:border-b-2 border-b-blue"
>
- جدید (2)
+ جدید
any;
+ checkKey: (item: any) => any;
}) {
- console.log(data);
const saveData = useData((state) => state.saveData);
const [selectedFile, setSelectedFile] = useState(null);
+ const [open, setOpen] = useState(false);
+ const [roData, setRowData] = useState(false);
+
const router = useRouter();
+
const handleFileChange = (event: any) => {
const file = event.target.files[0];
const reader = new FileReader();
@@ -65,77 +69,65 @@ 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 {
- // }
- // };
+ const checkKey2 = (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 (
-
- {/*
-
- بارگذاری کلید جدید
-
- */}
-
-
- {/* A list of your recent invoices. */}
-
-
- ردیف
- تاریخ
- موضوع
- دستگاه مربوطه
-
-
-
- {data?.map((item: Complaint, index: number) => {
- return (
- checkKey(item)
- // saveData({
- // trackingNumber: item.trackingNumber,
- // password: Decrypt(item.cipherKeyInspector),
- // })
- }
- className=" hover:bg-gray-200 cursor-pointer"
- key={item.id}
- >
- {/*
+ {/* A list of your recent invoices. */}
+
+
+ ردیف
+ تاریخ
+ موضوع
+ دستگاه مربوطه
+
+
+
+ {data?.map((item: Complaint, index: number) => {
+ return (
+ checkKey(item)
+ // saveData({
+ // trackingNumber: item.trackingNumber,
+ // password: Decrypt(item.cipherKeyInspector),
+ // })
+ }
+ className=" hover:bg-gray-200 cursor-pointer"
+ key={item.id}
+ >
+ {/* */}
-
- {index + 1}
-
-
- {convertDate(item.registeredAt)}
-
-
- {item?.category ? item.category.title : "-"}
-
- -
- {/* */}
-
- );
- })}
-
-
- {/*
- Edit Profile
- */}
+
+ {index + 1}
+
+
+ {convertDate(item.registeredAt)}
+
+
+ {item?.title ? item.title : "-"}
+
+ -
+ {/* */}
+
+ );
+ })}
+
+
+
بارگذاری کلید خصوصی
diff --git a/components/VerticalChart.tsx b/components/VerticalChart.tsx
index 4010da7..53be2f3 100644
--- a/components/VerticalChart.tsx
+++ b/components/VerticalChart.tsx
@@ -1,6 +1,5 @@
-"use client"
-
-import React from 'react';
+"use client";
+import React, { useState } from "react";
import {
Chart as ChartJS,
CategoryScale,
@@ -9,10 +8,19 @@ import {
Title,
Tooltip,
Legend,
-} from 'chart.js';
-import { Bar } from 'react-chartjs-2';
-import { faker } from "@faker-js/faker";
-
+ ChartOptions,
+ ScaleChartOptions,
+} from "chart.js";
+import { Bar, Line } from "react-chartjs-2";
+import { useQuery } from "@tanstack/react-query";
+import { getCookie } from "cookies-next";
+import dayjs from "dayjs";
+import utc from "dayjs/plugin/utc";
+import jalaliday from "jalaliday";
+import { backgroundColor, borderColor } from "@/constants/colors";
+dayjs.extend(jalaliday);
+dayjs.extend(utc);
+// import faker from "faker";
ChartJS.register(
CategoryScale,
LinearScale,
@@ -21,40 +29,119 @@ ChartJS.register(
Tooltip,
Legend
);
-
-export const options = {
- responsive: true,
- plugins: {
- legend: {
- position: 'top' as const,
- },
- title: {
- display: true,
- text: 'Chart.js Bar Chart',
- },
- },
-};
-
-const labels = ['January', 'February', 'March', 'April', 'May', 'June', 'July'];
-
-export const data = {
- labels,
- datasets: [
- {
- label: 'Dataset 1',
- data: labels.map(() => faker.datatype.number({ min: 0, max: 1000 })),
- backgroundColor: 'rgba(255, 99, 132, 0.5)',
- },
- {
- label: 'Dataset 2',
- data: labels.map(() => faker.datatype.number({ min: 0, max: 1000 })),
- backgroundColor: 'rgba(53, 162, 235, 0.5)',
- },
- ],
-};
-
-export function VerticalChart() {
- return (
-
- )
+ChartJS.defaults.font.family = "Yekan";
+interface Values {
+ displayValue: string;
+ parameters: string;
+ title: string;
+ value: string;
}
+function getRandomColor(n) {
+ var letters = "0123456789ABCDEF".split("");
+ var color = "#";
+ var colors = [];
+ for (var j = 0; j < n; j++) {
+ for (var i = 0; i < 6; i++) {
+ color += letters[Math.floor(Math.random() * 16)];
+ }
+ colors.push(color);
+ color = "#";
+ }
+ return colors;
+}
+function BarChart({
+ chartData,
+ chart,
+ chartTitle,
+}: {
+ chartData: { title: string; icon: string; values: Values[] }[];
+ chart?: number;
+ chartTitle: string;
+}) {
+ const DataSets = [];
+ // if (chartTitle == "درخواست های سی روز گذشته") {
+ // var labels = chartData[1].values.map((item) => {
+ // return item.title;
+ // });
+
+ // var label1 = chartData[0].title;
+ // var label2 = chartData[1].title;
+ // var value1 = chartData[0].values.map((item) => Number(item.value));
+ // var value2 = chartData[1].values.map((item) => Number(item.value));
+ // DataSets.push({ label: label1, data: value1 });
+ // DataSets.push({ label: label2, data: value2 });
+ // // console.log(labels);
+ // // console.log(value1);
+ // } else if ("گزارش تعداد درخواست ها بر اساس نوع بیمه") {
+ // var labels = chartData[0].values.map((item) => {
+ // return item.title;
+ // });
+ // var label1 = "";
+ // var value1 = chartData[0].values.map((item) => Number(item.value));
+ // DataSets.push({ label: label1, data: value1 });
+ // console.log(value1);
+ // }
+ console.log(chartData);
+ const options: ChartOptions<"bar"> = {
+ scales: { x: { ticks: { autoSkip: false } }, y: { stacked: false } },
+ responsive: true,
+ maintainAspectRatio: false,
+ plugins: {
+ title: {
+ display: true,
+ text: chartTitle,
+ position: "bottom",
+ },
+ tooltip: {
+ textDirection: "rtl",
+ },
+ datalabels: {
+ display: true,
+ color: "black",
+ align: "end",
+ anchor: "end",
+ font: { size: 12 },
+ formatter: function (value, context) {
+ return value == 0 ? "" : value;
+ },
+ },
+ // scales: {
+ // x: { ticks: { autoSkip: false } },
+ // y: {
+ // stacked: false,
+ // // suggestedMax:
+ // // Math.max(
+ // // ...chartData.map((l, j) => {
+ // // console.log(l);
+ // // const a = l.values.map((v) => {
+ // // return Number(v.value);
+ // // });
+ // // const b = Math.max(...a);
+ // // console.log(b);
+ // // return l.values.map((v) => Number(v.value));
+ // // })
+ // // ) * 1.2,
+ // },
+ // },
+ },
+ };
+
+ const data = {
+ labels: chartData[0]?.values?.map((item) => {
+ return item.title;
+ }),
+ datasets: chartData.map((item: any, index: number) => {
+ return {
+ label: item.title,
+ data: item.values.map((item) => item.value),
+ backgroundColor: backgroundColor[index],
+ borderColor: borderColor[index],
+ borderWidth: 1,
+ };
+ }),
+ };
+ // console.log(data);
+ return ;
+}
+
+export default BarChart;
diff --git a/components/ui/scroll-area.tsx b/components/ui/scroll-area.tsx
new file mode 100644
index 0000000..0b4a48d
--- /dev/null
+++ b/components/ui/scroll-area.tsx
@@ -0,0 +1,48 @@
+"use client"
+
+import * as React from "react"
+import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area"
+
+import { cn } from "@/lib/utils"
+
+const ScrollArea = React.forwardRef<
+ React.ElementRef,
+ React.ComponentPropsWithoutRef
+>(({ className, children, ...props }, ref) => (
+
+
+ {children}
+
+
+
+
+))
+ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName
+
+const ScrollBar = React.forwardRef<
+ React.ElementRef,
+ React.ComponentPropsWithoutRef
+>(({ className, orientation = "vertical", ...props }, ref) => (
+
+
+
+))
+ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName
+
+export { ScrollArea, ScrollBar }
diff --git a/components/ui/separator.tsx b/components/ui/separator.tsx
new file mode 100644
index 0000000..12d81c4
--- /dev/null
+++ b/components/ui/separator.tsx
@@ -0,0 +1,31 @@
+"use client"
+
+import * as React from "react"
+import * as SeparatorPrimitive from "@radix-ui/react-separator"
+
+import { cn } from "@/lib/utils"
+
+const Separator = React.forwardRef<
+ React.ElementRef,
+ React.ComponentPropsWithoutRef
+>(
+ (
+ { className, orientation = "horizontal", decorative = true, ...props },
+ ref
+ ) => (
+
+ )
+)
+Separator.displayName = SeparatorPrimitive.Root.displayName
+
+export { Separator }
diff --git a/constants/colors.tsx b/constants/colors.tsx
new file mode 100644
index 0000000..770d302
--- /dev/null
+++ b/constants/colors.tsx
@@ -0,0 +1,65 @@
+export const backgroundColor = [
+ "rgba(255, 99, 132, 0.2)",
+ "rgba(54, 162, 235, 0.2)",
+ "rgba(255, 206, 86, 0.2)",
+ "rgba(75, 192, 192, 0.2)",
+ "rgba(153, 102, 255, 0.2)",
+ "rgba(255, 159, 64, 0.2)",
+ "rgba(255, 0, 0, 0.2)",
+ "rgba(0, 255, 0, 0.2)",
+ "rgba(0, 0, 255, 0.2)",
+ "rgba(255, 255, 0, 0.2)",
+ "rgba(255, 0, 255, 0.2)",
+ "rgba(0, 255, 255, 0.2)",
+ "rgba(128, 0, 0, 0.2)",
+ "rgba(0, 128, 0, 0.2)",
+ "rgba(0, 0, 128, 0.2)",
+ "rgba(128, 128, 0, 0.2)",
+ "rgba(128, 0, 128, 0.2)",
+ "rgba(0, 128, 128, 0.2)",
+ "rgba(255, 128, 0, 0.2)",
+ "rgba(128, 255, 0, 0.2)",
+ "rgba(0, 255, 128, 0.2)",
+ "rgba(0, 128, 255, 0.2)",
+ "rgba(128, 0, 255, 0.2)",
+ "rgba(255, 0, 128, 0.2)",
+ "rgba(255, 128, 128, 0.2)",
+ "rgba(128, 255, 128, 0.2)",
+ "rgba(128, 128, 255, 0.2)",
+ "rgba(192, 192, 192, 0.2)",
+ "rgba(128, 128, 128, 0.2)",
+ "rgba(0, 0, 0, 0.2)",
+];
+
+export const borderColor = [
+ "rgba(255, 99, 132, 1)",
+ "rgba(54, 162, 235, 1)",
+ "rgba(255, 206, 86, 1)",
+ "rgba(75, 192, 192, 1)",
+ "rgba(153, 102, 255, 1)",
+ "rgba(255, 159, 64, 1)",
+ "rgba(255, 0, 0, 1)",
+ "rgba(0, 255, 0, 1)",
+ "rgba(0, 0, 255, 1)",
+ "rgba(255, 255, 0, 1)",
+ "rgba(255, 0, 255, 1)",
+ "rgba(0, 255, 255, 1)",
+ "rgba(128, 0, 0, 1)",
+ "rgba(0, 128, 0, 1)",
+ "rgba(0, 0, 128, 1)",
+ "rgba(128, 128, 0, 1)",
+ "rgba(128, 0, 128, 1)",
+ "rgba(0, 128, 128, 1)",
+ "rgba(255, 128, 0, 1)",
+ "rgba(128, 255, 0, 1)",
+ "rgba(0, 255, 128, 1)",
+ "rgba(0, 128, 255, 1)",
+ "rgba(128, 0, 255, 1)",
+ "rgba(255, 0, 128, 1)",
+ "rgba(255, 128, 128, 1)",
+ "rgba(128, 255, 128, 1)",
+ "rgba(128, 128, 255, 1)",
+ "rgba(192, 192, 192, 1)",
+ "rgba(128, 128, 128, 1)",
+ "rgba(0, 0, 0, 1)",
+];
diff --git a/package-lock.json b/package-lock.json
index d607247..0546aa3 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -15,7 +15,9 @@
"@radix-ui/react-icons": "^1.3.0",
"@radix-ui/react-label": "^2.0.2",
"@radix-ui/react-radio-group": "^1.1.3",
+ "@radix-ui/react-scroll-area": "^1.0.5",
"@radix-ui/react-select": "^2.0.0",
+ "@radix-ui/react-separator": "^1.0.3",
"@radix-ui/react-slot": "^1.0.2",
"@radix-ui/react-tabs": "^1.0.4",
"@radix-ui/react-toast": "^1.1.5",
@@ -24,6 +26,7 @@
"@uidotdev/usehooks": "^2.4.1",
"axios": "^1.6.2",
"chart.js": "^4.4.1",
+ "chartjs-plugin-datalabels": "^2.2.0",
"class-variance-authority": "^0.7.0",
"clsx": "^2.0.0",
"cookies-next": "^4.1.0",
@@ -39,6 +42,7 @@
"lucide-react": "^0.292.0",
"next": "14.0.3",
"next-themes": "^0.2.1",
+ "nextjs-toploader": "^1.6.4",
"npm": "^10.2.5",
"react": "^18.2.0",
"react-chartjs-2": "^5.2.0",
@@ -69,6 +73,7 @@
"eslint": "^8",
"eslint-config-next": "14.0.3",
"postcss": "^8",
+ "tailwind-scrollbar": "^3.0.5",
"tailwindcss": "^3.3.0",
"typescript": "^5"
}
@@ -1041,6 +1046,37 @@
}
}
},
+ "node_modules/@radix-ui/react-scroll-area": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-scroll-area/-/react-scroll-area-1.0.5.tgz",
+ "integrity": "sha512-b6PAgH4GQf9QEn8zbT2XUHpW5z8BzqEc7Kl11TwDrvuTrxlkcjTD5qa/bxgKr+nmuXKu4L/W5UZ4mlP/VG/5Gw==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/number": "1.0.1",
+ "@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-use-callback-ref": "1.0.1",
+ "@radix-ui/react-use-layout-effect": "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-select": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/@radix-ui/react-select/-/react-select-2.0.0.tgz",
@@ -1084,6 +1120,29 @@
}
}
},
+ "node_modules/@radix-ui/react-separator": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-separator/-/react-separator-1.0.3.tgz",
+ "integrity": "sha512-itYmTy/kokS21aiV5+Z56MZB54KrhPgn6eHDKkFeOLR34HMN2s8PaN47qZZAGnvupcjxHaFZnW4pQEh0BvvVuw==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/react-primitive": "1.0.3"
+ },
+ "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-slot": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.0.2.tgz",
@@ -1433,6 +1492,11 @@
"undici-types": "~5.26.4"
}
},
+ "node_modules/@types/nprogress": {
+ "version": "0.2.3",
+ "resolved": "https://registry.npmjs.org/@types/nprogress/-/nprogress-0.2.3.tgz",
+ "integrity": "sha512-k7kRA033QNtC+gLc4VPlfnue58CM1iQLgn1IMAU8VPHGOj7oIHPp9UlhedEnD/Gl8evoCjwkZjlBORtZ3JByUA=="
+ },
"node_modules/@types/prop-types": {
"version": "15.7.11",
"resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.11.tgz",
@@ -2092,6 +2156,14 @@
"pnpm": ">=7"
}
},
+ "node_modules/chartjs-plugin-datalabels": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/chartjs-plugin-datalabels/-/chartjs-plugin-datalabels-2.2.0.tgz",
+ "integrity": "sha512-14ZU30lH7n89oq+A4bWaJPnAG8a7ZTk7dKf48YAzMvJjQtjrgg5Dpk9f+LbjCF6bpx3RAGTeL13IXpKQYyRvlw==",
+ "peerDependencies": {
+ "chart.js": ">=3.0.0"
+ }
+ },
"node_modules/chokidar": {
"version": "3.5.3",
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz",
@@ -4337,6 +4409,21 @@
"react-dom": "*"
}
},
+ "node_modules/nextjs-toploader": {
+ "version": "1.6.4",
+ "resolved": "https://registry.npmjs.org/nextjs-toploader/-/nextjs-toploader-1.6.4.tgz",
+ "integrity": "sha512-KYLQ+0MvGdFk9JwOQfRtaYBAsyuX67Ca5QTa51RGNO4gQx64KLSE+ryHjUQ5LcDczHotp0l32GgksQW9vucUkw==",
+ "dependencies": {
+ "@types/nprogress": "^0.2.1",
+ "nprogress": "^0.2.0",
+ "prop-types": "^15.8.1"
+ },
+ "peerDependencies": {
+ "next": ">= 6.0.0",
+ "react": ">= 16.0.0",
+ "react-dom": ">= 16.0.0"
+ }
+ },
"node_modules/node-releases": {
"version": "2.0.13",
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.13.tgz",
@@ -7091,6 +7178,11 @@
"inBundle": true,
"license": "ISC"
},
+ "node_modules/nprogress": {
+ "version": "0.2.0",
+ "resolved": "https://registry.npmjs.org/nprogress/-/nprogress-0.2.0.tgz",
+ "integrity": "sha512-I19aIingLgR1fmhftnbWWO3dXc0hSxqHQHQb3H8m+K3TnEn/iSeTZZOyvKXWqQESMwuUVnatlCnZdLBZZt2VSA=="
+ },
"node_modules/object-assign": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
@@ -8431,6 +8523,18 @@
"url": "https://github.com/sponsors/dcastil"
}
},
+ "node_modules/tailwind-scrollbar": {
+ "version": "3.0.5",
+ "resolved": "https://registry.npmjs.org/tailwind-scrollbar/-/tailwind-scrollbar-3.0.5.tgz",
+ "integrity": "sha512-0ZwxTivevqq9BY9fRP9zDjHl7Tu+J5giBGbln+0O1R/7nHtBUKnjQcA1aTIhK7Oyjp6Uc/Dj6/dn8Dq58k5Uww==",
+ "dev": true,
+ "engines": {
+ "node": ">=12.13.0"
+ },
+ "peerDependencies": {
+ "tailwindcss": "3.x"
+ }
+ },
"node_modules/tailwindcss": {
"version": "3.3.5",
"resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.3.5.tgz",
diff --git a/package.json b/package.json
index 63427a8..588cf87 100644
--- a/package.json
+++ b/package.json
@@ -16,7 +16,9 @@
"@radix-ui/react-icons": "^1.3.0",
"@radix-ui/react-label": "^2.0.2",
"@radix-ui/react-radio-group": "^1.1.3",
+ "@radix-ui/react-scroll-area": "^1.0.5",
"@radix-ui/react-select": "^2.0.0",
+ "@radix-ui/react-separator": "^1.0.3",
"@radix-ui/react-slot": "^1.0.2",
"@radix-ui/react-tabs": "^1.0.4",
"@radix-ui/react-toast": "^1.1.5",
@@ -25,6 +27,7 @@
"@uidotdev/usehooks": "^2.4.1",
"axios": "^1.6.2",
"chart.js": "^4.4.1",
+ "chartjs-plugin-datalabels": "^2.2.0",
"class-variance-authority": "^0.7.0",
"clsx": "^2.0.0",
"cookies-next": "^4.1.0",
@@ -40,6 +43,7 @@
"lucide-react": "^0.292.0",
"next": "14.0.3",
"next-themes": "^0.2.1",
+ "nextjs-toploader": "^1.6.4",
"npm": "^10.2.5",
"react": "^18.2.0",
"react-chartjs-2": "^5.2.0",
@@ -70,6 +74,7 @@
"eslint": "^8",
"eslint-config-next": "14.0.3",
"postcss": "^8",
+ "tailwind-scrollbar": "^3.0.5",
"tailwindcss": "^3.3.0",
"typescript": "^5"
}
diff --git a/tailwind.config.js b/tailwind.config.js
index 9b22b90..8d400e6 100644
--- a/tailwind.config.js
+++ b/tailwind.config.js
@@ -85,5 +85,5 @@ module.exports = {
},
},
},
- plugins: [require("tailwindcss-animate")],
+ plugins: [require("tailwindcss-animate"), require("tailwind-scrollbar")],
};
diff --git a/utils/infoApi.ts b/utils/infoApi.ts
new file mode 100644
index 0000000..66fca4f
--- /dev/null
+++ b/utils/infoApi.ts
@@ -0,0 +1,19 @@
+import axios from "axios";
+import { CookieValueTypes, getCookie } from "cookies-next";
+
+axios.defaults.baseURL = process.env.NEXT_PUBLIC_BASE_URL_APP;
+
+axios.interceptors.request.use(function (config) {
+ const token = getCookie("Sootzani_Token");
+ config.headers.Authorization = token ? `Bearer ${token}` : "";
+ return config;
+});
+
+export async function getInfoList() {
+ const data = await axios.get("api/Info/List");
+ return data.data;
+}
+export async function getInfo(id: string = "0") {
+ const data = await axios.get(`api/Info/${id}`);
+ return data.data;
+}