69 lines
1.9 KiB
TypeScript
69 lines
1.9 KiB
TypeScript
"use client"
|
|
import React from "react";
|
|
import BoxDashboard from "./BoxDashboard";
|
|
import LineChart from "./LineChart";
|
|
import { HorizontalChart } from "./HorizontalChart";
|
|
import { getComplaintsList } from "@/utils/inspectorApi";
|
|
import { useQuery } from "@tanstack/react-query";
|
|
|
|
export default function ControllerDashboard() {
|
|
const {
|
|
data,
|
|
isLoading,
|
|
refetch,
|
|
} = useQuery({
|
|
queryKey: ["ComplaintsList"],
|
|
queryFn: () => getComplaintsList(),
|
|
refetchOnWindowFocus: false,
|
|
});
|
|
console.log(data);
|
|
return (
|
|
<div className="w-[95vw] lg:w-[82vw] xl:w-[70vw] 3xl:w-[65vw] mt-8 max-sm:mt-16 pt-9">
|
|
{/* Lg Show */}
|
|
<div className="w-full h-[45vh] mb-6 flex-row gap-0 hidden lg:flex">
|
|
<div className="w-1/5 flex flex-col gap-8 pl-6">
|
|
<BoxDashboard />
|
|
<BoxDashboard />
|
|
</div>
|
|
|
|
<div className="w-4/5 bg-[#EFEFEF80] rounded-lg flex justify-center">
|
|
<LineChart />
|
|
</div>
|
|
</div>
|
|
|
|
<div className="w-full flex-row gap-6 h-[20vh] hidden lg:flex">
|
|
<div className="w-3/5 flex flex-row gap-7">
|
|
<BoxDashboard />
|
|
<BoxDashboard />
|
|
<BoxDashboard />
|
|
</div>
|
|
<div className="w-2/5 flex justify-end">
|
|
<HorizontalChart />
|
|
</div>
|
|
</div>
|
|
|
|
{/* max Lg show */}
|
|
<div className="w-full mb-6 flex-col gap-12 flex lg:hidden">
|
|
<div className="w-full flex flex-row flex-wrap justify-center gap-4 ">
|
|
<BoxDashboard />
|
|
<BoxDashboard />
|
|
<BoxDashboard />
|
|
<BoxDashboard />
|
|
<BoxDashboard />
|
|
</div>
|
|
|
|
<div className="w-full flex flex-col gap-12 ">
|
|
<div className="h-1/2">
|
|
<LineChart />
|
|
</div>
|
|
<hr />
|
|
<div className="h-1/2">
|
|
<HorizontalChart />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
);
|
|
}
|