ComplaintDetails Modified

Kahdooei
yasaman 2024-01-26 16:45:38 +03:30
parent 5b06bfb943
commit daa2eb2084
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 }) {
const id = params.id;
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} />
</div>
);

View File

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