Compare commits

..

3 Commits

2 changed files with 75 additions and 66 deletions

View File

@ -4,7 +4,7 @@ import React from "react";
export default function page({ params }: { params: any }) { export default function page({ params }: { params: any }) {
const id = params.id; const id = params.id;
return ( return (
<div className="w-[90vw] sm:w-[90vw] lg:w-[85vw] xl:w-[75vw] 3xl:w-[70vw] mt-3 sm:mt-6 mx-auto mb-10"> <div className="w-[90vw] sm:w-[90vw] lg:w-[85vw] xl:w-[75vw] 3xl:w-[70vw] mt-3 sm:mt-6 mx-auto mb-6">
<ComplainsDetails role="Inspector" id={id} /> <ComplainsDetails role="Inspector" id={id} />
</div> </div>
); );

View File

@ -6,11 +6,11 @@ import Image from "next/image";
import { ComplainDetailsItems } from "@/constants"; import { ComplainDetailsItems } from "@/constants";
import { useMutation } from "@tanstack/react-query"; import { useMutation } from "@tanstack/react-query";
import useData from "@/store/useData"; import useData from "@/store/useData";
import { convertDate , convertFullTime } from "@/lib/utils"; import { convertDate, convertFullTime } from "@/lib/utils";
import { Badge } from "./ui/badge"; import { Badge } from "./ui/badge";
import InspectorOperations from "./InspectorOperations"; import InspectorOperations from "./InspectorOperations";
import { postComplaintTracking } from "@/utils/citizenApi"; import { postComplaintTracking } from "@/utils/citizenApi";
import { Button } from "@/components/ui/button"; import { Button } from "@/components/ui/button";
import { import {
AlertDialog, AlertDialog,
@ -148,7 +148,7 @@ export default function ComplainsDetails({
<AlertDialogContent dir="rtl" className=""> <AlertDialogContent dir="rtl" className="">
<AlertDialogHeader dir="rtl"> <AlertDialogHeader dir="rtl">
<AlertDialogTitle dir="rtl">رمز عبور</AlertDialogTitle> <AlertDialogTitle dir="rtl">رمز عبور</AlertDialogTitle>
<AlertDialogDescription> <AlertDialogDescription>
برای مشاهده درخواست پسورد خود را وارد نمایید. برای مشاهده درخواست پسورد خود را وارد نمایید.
</AlertDialogDescription> </AlertDialogDescription>
</AlertDialogHeader> </AlertDialogHeader>
@ -195,7 +195,7 @@ export default function ComplainsDetails({
{/* Editt */} {/* Editt */}
<div className="flex items-start w-full gap-2 mt-2 max-lg:flex-col"> <div className="flex items-start w-full gap-2 mt-2 max-lg:flex-col">
{/* 1 */} {/* 1 */}
<div className="flex flex-col w-full lg:w-1/3 gap-3 lg:sticky top-28 lg:h-[78vh]"> <div className="flex flex-col w-full lg:w-1/3 gap-3 lg:sticky top-28 lg:h-[80vh]">
{/* ***** */} {/* ***** */}
<div className="max-lg:hidden bg-[#E9E9E9] rounded-md p-4 px-10 flex flex-col lg:h-full"> <div className="max-lg:hidden bg-[#E9E9E9] rounded-md p-4 px-10 flex flex-col lg:h-full">
<p className="text-[#464646] text-base font-bold mb-1"> <p className="text-[#464646] text-base font-bold mb-1">
@ -314,74 +314,83 @@ export default function ComplainsDetails({
)} )}
</div> </div>
<div className="bg-[#E9E9E9] rounded-md py-4 px-10 flex flex-col max-h-[50vh] lg:max-h-[39.5vh] 2xl:max-h-[43.5vh] 3xl:max-h-[41vh] min-[1920px]:max-h-[48.5vh] overflow-auto <div className="h-[calc(80vh-11.5em)] max-h-[calc(80vh-11.5em)] overflow-hidden">
scrollbar-thin scrollbar-thumb-gray-500 scrollbar-track-gray-100"> <div className="bg-[#E9E9E9] rounded-md py-4 px-10 flex flex-col h-full ">
<p className="text-[#464646] text-base font-bold">روند شکایت</p> <p className="text-[#464646] text-base font-bold">
<div className="flex flex-col mt-4 gap-y-4"> روند شکایت
{data.contents?.map((item: any) => { </p>
return ( <div
<div className="flex flex-col mt-4 gap-y-4 overflow-auto
key={item.id} scrollbar-thin scrollbar-thumb-gray-500 scrollbar-track-gray-100 "
className="p-4 bg-white rounded-lg shadow-md " >
> {data.contents?.map((item: any) => {
<div className="flex items-center gap-4 "> return (
<p className=""> <div
<Badge> key={item.id}
{item.sender == 0 ? "شهروند" : "بازرس"} className="p-4 bg-white rounded-lg shadow-md "
</Badge> >
</p> <div className="flex items-center gap-4 ">
<p className=""> <p className="">
تاریخ : <Badge>
{item.sender == 0 ? "شهروند" : "بازرس"}
</Badge>
</p>
<p className="">
تاریخ :
<span className="text-[#7C838A]">
{convertDate(item.dateTime)}
</span>
</p>
</div>
<div className=" text-[#464646] mt-2">
<span className="text-[#7C838A]"> <span className="text-[#7C838A]">
{convertDate(item.dateTime)} {item.text ? item.text : "-"}
</span> </span>
</p> </div>
</div> {/* {item.media.length !== 0 && (
<div className=" text-[#464646] mt-2">
<span className="text-[#7C838A]">
{item.text ? item.text : "-"}
</span>
</div>
{/* {item.media.length !== 0 && (
<Separator className="mt-2 mb-1 " /> <Separator className="mt-2 mb-1 " />
)} */} )} */}
<div className=" text-[#464646] mt-2"> <div className=" text-[#464646] mt-2">
<div className="flex flex-wrap items-center w-full gap-2 mt-2 text-xs max-md:flex-col"> <div className="flex flex-wrap items-center w-full gap-2 mt-2 text-xs max-md:flex-col">
{item?.media.map((item: any, index: number) => { {item?.media.map((item: any, index: number) => {
return ( return (
<div <div
key={index} key={index}
className=" bg-gray-100 text-[#7C838A] w-full md:w-[30%] rounded-md h-12 p-2 flex justify-between gap-3 items-center" className=" bg-gray-100 text-[#7C838A] w-full md:w-[30%] rounded-md h-12 p-2 flex justify-between gap-3 items-center"
>
<a
onClick={() =>
openFileInNewTab(item.data, item.mimeType)
}
className="flex items-center gap-2 truncate cursor-pointer "
> >
<File className="w-6 h-6 " /> <a
<p className=" max-w-[5rem] truncate"> onClick={() =>
{item.title} openFileInNewTab(
</p> item.data,
</a> item.mimeType
<ArrowDownToLine )
className="cursor-pointer " }
onClick={() => className="flex items-center gap-2 truncate cursor-pointer "
downloadFile( >
item.data, <File className="w-6 h-6 " />
item.title, <p className=" max-w-[5rem] truncate">
item.mimeType {item.title}
) </p>
} </a>
/> <ArrowDownToLine
</div> className="cursor-pointer "
); onClick={() =>
})} downloadFile(
item.data,
item.title,
item.mimeType
)
}
/>
</div>
);
})}
</div>
</div> </div>
</div> </div>
</div> );
); })}
})} </div>
</div> </div>
</div> </div>
</div> </div>