the Controller section is done

Kahdooei
yasaman 2023-12-20 17:08:34 +03:30
parent 5bec94d2bd
commit 94b27dc7cc
31 changed files with 1161 additions and 288 deletions

View File

@ -1,5 +1,5 @@
import FollowUp from "@/components/FollowUp";
import React from "react"; import React from "react";
import FollowUp from "@/components/FollowUp";
export default function page() { export default function page() {
return ( return (

View File

@ -1,3 +1,4 @@
import NavbarPanel from "@/components/NavbarPanel";
export default function RootLayout({ export default function RootLayout({
children, children,
@ -6,7 +7,7 @@ export default function RootLayout({
}) { }) {
return ( return (
<> <>
{/* <Nav /> */} <NavbarPanel />
{children} {children}
</> </>
) )

View File

@ -1,7 +1,5 @@
import React from 'react' import React from "react";
export default function page() { export default function page() {
return ( return <></>;
<div>page</div>
)
} }

View File

@ -0,0 +1,13 @@
import ComplainsDetails from '@/components/ComplainsDetails'
import React from 'react'
export default function page({params}:{params:any}) {
const id = params.id;
{ console.log(params);}
{ console.log(id);}
return (
<ComplainsDetails id={id} />
)
}

View File

@ -0,0 +1,9 @@
import TabController from '@/components/TabController'
import React from 'react'
export default function page() {
return (
<TabController />
)
}

View File

@ -0,0 +1,8 @@
import ReportsController from '@/components/ReportsController'
import React from 'react'
export default function page() {
return (
<ReportsController />
)
}

View File

@ -1,13 +1,8 @@
import ControllerDashboard from "@/components/ControllerDashboard";
import React from "react"; import React from "react";
export default function page() { export default function page() {
return ( return (
<div className="flex w-full mt-11"> <ControllerDashboard />
<div className="w-[200px] h-[200px] px-[29px] pt-[117px] pb-[31px] bg-zinc-100 rounded-[10px] shadow justify-center items-center inline-flex">
<div className="w-[142px] h-[52px] text-center text-black text-sm font-medium font-['IRANYekanFN']">
تعداد درخواست ها 30 روز گذشته
</div>
</div>
</div>
); );
} }

View File

@ -0,0 +1,16 @@
import React from "react";
export default function BoxDashboard() {
return (
<div
className="w-full h-full px-7 py-8 bg-zinc-100 rounded-lg shadow flex flex-col justify-end items-center text-black
transition-all duration-300 hover:transition-all hover:duration-300
hover:text-white hover:bg-blue hover:pb-10
max-lg:min-h-[10em] max-lg:max-w-[10em]"
>
<p className="text-center text-sm font-medium ">
تعداد درخواست ها 30 روز گذشته
</p>
</div>
);
}

View File

@ -5,25 +5,7 @@ import mapImg from "../public/img/map.png";
import { callUsItems } from "@/constants"; import { callUsItems } from "@/constants";
import { cn } from "@/lib/utils"; import { cn } from "@/lib/utils";
import Map from "./Map";
// Map
// import { MapContainer } from "react-leaflet/MapContainer";
// import { TileLayer } from "react-leaflet/TileLayer";
// import { useMap } from "react-leaflet/hooks";
// import { Marker, Popup } from "leaflet";
// import { Map, TileLayer } from 'react-leaflet';
// import "leaflet/dist/leaflet.css";
// const defaultCenter = [38.9072, -77.0369];
// const defaultZoom = 8;
// const disneyWorldLatLng = [28.3852, -81.5639];
// const disneyLandLatLng = [33.8121, -117.919];
// src/components/Map.tsx
import { MapContainer, Marker, Popup, TileLayer, Tooltip } from "react-leaflet";
import "leaflet/dist/leaflet.css";
// import "leaflet-defaulticon-compatibility";
// import "leaflet-defaulticon-compatibility/dist/leaflet-defaulticon-compatibility.css";
export default function CallUs(props: any) { export default function CallUs(props: any) {
const { position, zoom } = props; const { position, zoom } = props;
@ -31,40 +13,16 @@ export default function CallUs(props: any) {
<div className="bg-white dark:bg-gray-900 w-screen"> <div className="bg-white dark:bg-gray-900 w-screen">
<div className="w-full"> <div className="w-full">
<div className="w-full h-[42vh]"> <div className="w-full h-[42vh]">
<Image {/* <Image
src={mapImg} src={mapImg}
className="object-cover w-full h-full " className="object-cover w-full h-full "
alt=" Logo1" alt=" Logo1"
quality={100} quality={100}
width={100} width={100}
height={100} height={100}
/> /> */}
{/* <MapContainer center={position} zoom={zoom} scrollWheelZoom={false}>
<TileLayer <Map />
attribution='&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
/>
<Marker position={position}>
<Popup>
A pretty CSS3 popup. <br /> Easily customizable.
</Popup>
</Marker>
</MapContainer> */}
{/* <MapContainer
center={[51.505, -0.09]}
zoom={13}
scrollWheelZoom={false}
>
<TileLayer
attribution='&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
/>
<Marker position={[51.505, -0.09]}>
<Popup>
A pretty CSS3 popup. <br /> Easily customizable.
</Popup>
</Marker>
</MapContainer> */}
</div> </div>
<div className="container"> <div className="container">

View File

@ -0,0 +1,86 @@
import React from "react";
import greenIcon from "../public/img/greenPoint.svg";
import blueIcon from "../public/img/bluepoint.svg";
import Image from "next/image";
import { ComplainDetailsItems } from "@/constants";
export default function ComplainsDetails({ id }: { id: number }) {
return (
<div className="w-[95vw] lg:w-[82vw] xl:w-[70vw] 3xl:w-[65vw] mt-16 sm:mt-8 pt-9">
<div className="w-full flex flex-col md:flex-row min-h-[60vh] gap-5">
{/* Right */}
<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">
<p className="text-[#464646] text-base font-bold">گزارش شکایات</p>
<div className="">
<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">
{" "}
موضوع شکایت:{" "}
<span className="text-[#7C838A] text-sm font-medium">
متن تستی
</span>
</p>
<p className="text-[#464646] text-sm font-medium"> موضوع شکایت:</p>
</div>
<p className="text-[#464646] text-sm font-medium text-justify">
درخواست شما با کد رهگیری 1243230783 و رمز عبور 12422 در دست بررسی و
اقدام می باشد. در صورت تمایل می توانید با شماره تلفن 0353286545 جهت
پشتیبانی تماس حاصل کنید.{" "}
</p>
</div>
{/* 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">
<p className="text-[#464646] text-base font-bold mb-3">
وضعیت درخواست
</p>
{/* 1 */}
{ComplainDetailsItems.map((item, index, array) => {
return (
<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="self-stretch text-right text-lime-800 text-lg font-semibold leading-[30px]">
{item.title}
</div>
<div className="self-stretch text-right text-zinc-700 text-base font-normal uppercase">
{item.desc}
</div>
<div className="self-stretch text-right text-zinc-700 text-base font-normal">
{item.date} <br /> {item.time}
</div>
</div>
<div className="w-6 self-stretch flex-col justify-start items-center gap-1 inline-flex">
<div className="py-0.5 justify-start items-start gap-2.5 inline-flex">
<Image
src={greenIcon}
alt="greenIcon"
width={100}
height={100}
/>
</div>
<div className="w-1 grow shrink basis-0 bg-lime-800 rounded-[1px]"></div>
</div>
</div>
);
})}
</div>
</div>
</div>
);
}

View File

@ -0,0 +1,54 @@
import React from "react";
import BoxDashboard from "./BoxDashboard";
import LineChart from "./LineChart";
import { HorizontalChart } from "./HorizontalChart";
export default function ControllerDashboard() {
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>
);
}

View File

@ -0,0 +1,68 @@
"use client"
import React from 'react';
import {
Chart as ChartJS,
CategoryScale,
LinearScale,
BarElement,
Title,
Tooltip,
Legend,
} from 'chart.js';
import { Bar } from 'react-chartjs-2';
import { faker } from "@faker-js/faker";
ChartJS.register(
CategoryScale,
LinearScale,
BarElement,
Title,
Tooltip,
Legend
);
export const options = {
indexAxis: 'y' as const,
elements: {
bar: {
borderWidth: 2,
},
},
responsive: true,
plugins: {
legend: {
position: 'right' as const,
},
title: {
display: true,
text: 'Chart.js Horizontal 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 })),
borderColor: 'rgb(255, 99, 132)',
backgroundColor: 'rgba(255, 99, 132, 0.5)',
},
{
label: 'Dataset 2',
data: labels.map(() => faker.datatype.number({ min: 0, max: 1000 })),
borderColor: 'rgb(53, 162, 235)',
backgroundColor: 'rgba(53, 162, 235, 0.5)',
},
],
};
export function HorizontalChart() {
return (
<Bar options={options} data={data} className='!w-full !h-full'/>
)
}

64
components/LineChart.tsx Normal file
View File

@ -0,0 +1,64 @@
"use client";
import React from "react";
import {
Chart as ChartJS,
CategoryScale,
LinearScale,
PointElement,
LineElement,
Title,
Tooltip,
Legend,
} from "chart.js";
import { Line } from "react-chartjs-2";
import { faker } from "@faker-js/faker";
ChartJS.register(
CategoryScale,
LinearScale,
PointElement,
LineElement,
Title,
Tooltip,
Legend
);
export const options = {
responsive: true,
plugins: {
legend: {
position: "top" as const,
},
title: {
display: true,
text: "Chart.js Line 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: -1000, max: 1000 })),
borderColor: "rgb(255, 99, 132)",
backgroundColor: "rgba(255, 99, 132, 0.5)",
},
{
label: "Dataset 2",
data: labels.map(() => faker.datatype.number({ min: -1000, max: 1000 })),
borderColor: "rgb(53, 162, 235)",
backgroundColor: "rgba(53, 162, 235, 0.5)",
},
],
};
export default function LineChart() {
return (
<Line options={options} data={data} className=' '/>
);
}

View File

@ -1,109 +1,48 @@
import React, { Component, createRef } from 'react'; "use client";
import { Map, TileLayer, Marker, Popup, MapControl, withLeaflet } from 'react-leaflet'; import React, { useEffect, useRef } from "react";
import { GeoSearchControl, OpenStreetMapProvider } from 'leaflet-geosearch'; import { MapContainer, TileLayer, Marker, Popup } from "react-leaflet";
import L from "leaflet";
// import MarkerIcon from "../../node_modules/leaflet/dist/images/marker-icon.png";
// import MarkerShadow from "../../node_modules/leaflet/dist/images/marker-shadow.png";
import "leaflet/dist/leaflet.css";
import { any } from "zod";
const Map = () => {
const markerRef = useRef<any>(null);
class SearchBox extends MapControl { useEffect(() => {
constructor(props) { if (markerRef.current) {
super(props); markerRef.current.openPopup()
props.leaflet.map.on('geosearch/showlocation', (e) => props.updateMarker(e));
} }
}, []);
createLeafletElement() {
const searchEl = GeoSearchControl({
provider: new OpenStreetMapProvider(),
style: 'bar',
showMarker: true,
showPopup: false,
autoClose: true,
retainZoomLevel: false,
animateZoom: true,
keepResult: false,
searchLabel: 'search'
});
return searchEl;
}
}
export default class MyMap extends Component {
state = {
center: {
lat: 31.698956,
lng: 76.732407,
},
marker: {
lat: 31.698956,
lng: 76.732407,
},
zoom: 13,
draggable: true,
}
refmarker = createRef(this.state.marker)
toggleDraggable = () => {
this.setState({ draggable: !this.state.draggable });
}
updateMarker = (e) => {
// const marker = e.marker;
this.setState({
marker: e.marker.getLatLng(),
});
console.log(e.marker.getLatLng());
}
updatePosition = () => {
const marker = this.refmarker.current;
if (marker != null) {
this.setState({
marker: marker.leafletElement.getLatLng(),
});
}
console.log(marker.leafletElement.getLatLng());
}
render() {
const position = [this.state.center.lat, this.state.center.lng];
const markerPosition = [this.state.marker.lat, this.state.marker.lng];
const SearchBar = withLeaflet(SearchBox);
return ( return (
<div className="map-root"> <MapContainer
<Map center={position} zoom={this.state.zoom} style={{ center={[31.8974, 54.3569]}
height:"700px" zoom={13}
}}> style={{ height: "300px" }}
<TileLayer className=" rounded-lg max-w-full"
attribution='&amp;copy <a href="http://osm.org/copyright">OpenStreetMap</a> contributors' >
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png" <TileLayer url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png" />
/>
<Marker <Marker
draggable={true} position={[31.8974, 54.3569]}
onDragend={this.updatePosition} // icon={
position={markerPosition} // new L.Icon({
animate={true} // iconUrl: MarkerIcon.src,
ref={this.refmarker}> // iconRetinaUrl: MarkerIcon.src,
<Popup minWidth={90}> // iconSize: [25, 41],
<span onClick={this.toggleDraggable}> // iconAnchor: [12.5, 41],
{this.state.draggable ? 'DRAG MARKER' : 'MARKER FIXED'} // popupAnchor: [0, -41],
</span> // shadowUrl: MarkerShadow.src,
</Popup> // shadowSize: [41, 41],
// })
// }
ref={markerRef}
>
<Popup className=" font-[Yekan] font-bold">داروخانه چمران</Popup>
</Marker> </Marker>
<SearchBar updateMarker={this.updateMarker} /> </MapContainer>
</Map>
<style jsx>{`
.map-root {
height: 100%;
}
.leaflet-container {
height: 400px !important;
width: 80%;
margin: 0 auto;
}
`}
</style>
</div>
); );
} };
}
export default Map;

View File

@ -4,30 +4,37 @@ import { ControllerMenuItems } from "@/constants";
export default function NavbarPanel() { export default function NavbarPanel() {
return ( return (
<div className="absolute flex justify-between items-center w-full px-8 py-2 z-10 bg-blue max-md:px-0 max-md:justify-end "> <div className="fixed flex flex-col-reverse justify-between items-start gap-3
sm:flex-row sm:items-center sm:gap-0
w-full px-8 py-2 z-10 bg-blue max-md:px-4
">
{/* <p>Current pathname: {pathname}</p> */} {/* <p>Current pathname: {pathname}</p> */}
<div className="flex items-center gap-10">
<div className=" flex items-center gap-3 md:ml-4"> <div className=" flex items-center gap-8 max-md:gap-4">
<p className="text-white inline-block bg-clip-text text-lg max-md:text-base">
<p className="text-white inline-block bg-clip-text text-lg font-bold max-md:text-base max-md:font-medium">
پنل کاربری | پنل کاربری |
</p> </p>
<div className="flex flex-row gap-7 max-md:gap-3">
{ControllerMenuItems.map((item) => { {ControllerMenuItems.map((item) => {
return ( return (
<Link key={item.id} href={item.href}> <Link key={item.id} href={item.href}>
<p className="text-white text-sm font-normal ">{item.name}</p> <p className="text-white font-normal text-sm max-md:text-xs
hover:bg-white/50 rounded-sm p-1
animate-out duration-300 ">{item.name}</p>
</Link> </Link>
); );
})} })}
</div> </div>
</div> </div>
<h1
className="text-white inline-block bg-clip-text before:max-md:hidden" <h1 className="text-white inline-block bg-clip-text before:max-md:hidden text-sm font-bold max-md:text-xs max-md:font-medium">
>
نام و نام خانوادگی (بازرس) نام و نام خانوادگی (بازرس)
</h1> </h1>
</div> </div>
); );
} }

View File

@ -2,7 +2,7 @@
import React from "react"; import React from "react";
import { useRef } from "react"; import { useRef } from "react";
import { useState ,useEffect } from "react"; import { useState, useEffect } from "react";
// import { useClickAway } from "react-use/lib/useClickAway"; // import { useClickAway } from "react-use/lib/useClickAway";
import { AnimatePresence, motion } from "framer-motion"; import { AnimatePresence, motion } from "framer-motion";
import { Squash as Hamburger } from "hamburger-react"; import { Squash as Hamburger } from "hamburger-react";
@ -10,12 +10,12 @@ import { menuItems } from "@/constants";
import Link from "next/link"; import Link from "next/link";
import { Button } from "./ui/button"; import { Button } from "./ui/button";
import TopNav from "./TopNav"; import TopNav from "./TopNav";
import { usePathname } from 'next/navigation' import { usePathname } from "next/navigation";
// import { routes } from "../routes"; // import { routes } from "../routes";
export default function NavbarSm() { export default function NavbarSm() {
const pathname = usePathname() const pathname = usePathname();
// useClickAway(ref, () => setOpen(false)); // useClickAway(ref, () => setOpen(false));
@ -25,7 +25,7 @@ export default function NavbarSm() {
// resize // resize
function getSize() { function getSize() {
return { return {
width: window.innerWidth width: window.innerWidth,
}; };
} }
const [windowSize, setWindowSize] = useState(getSize); const [windowSize, setWindowSize] = useState(getSize);
@ -39,12 +39,12 @@ export default function NavbarSm() {
return () => window.removeEventListener("resize", handleResize); return () => window.removeEventListener("resize", handleResize);
}, [windowSize]); }, [windowSize]);
return ( return (
<> <>
<div <div
ref={ref} ref={ref}
className={`md:hidden w-full bg-white z-[100] flex flex-row justify-between items-center px-4 ${pathname === "/" ? "fixed" : "relative"} className={`md:hidden w-full bg-white z-[100] flex flex-row justify-between items-center px-4
sticky top-0
shadow-md`} shadow-md`}
> >
<Hamburger toggled={isOpen} size={20} toggle={setOpen} /> <Hamburger toggled={isOpen} size={20} toggle={setOpen} />
@ -54,8 +54,7 @@ export default function NavbarSm() {
ورود به پنل کاربری ورود به پنل کاربری
</Button> </Button>
</Link> */} </Link> */}
{window.innerWidth <= 768 ? <TopNav /> : <></>} {window.innerWidth <= 768 ? <TopNav /> : <></>}
<AnimatePresence> <AnimatePresence>
{isOpen && ( {isOpen && (
@ -67,9 +66,9 @@ export default function NavbarSm() {
className="fixed z-[100] left-0 shadow-4xl right-0 top-[3rem] p-5 bg-gradient-to-b from-blue to-white border-b border-b-white/20" className="fixed z-[100] left-0 shadow-4xl right-0 top-[3rem] p-5 bg-gradient-to-b from-blue to-white border-b border-b-white/20"
> >
<ul className="grid gap-2 "> <ul className="grid gap-2 ">
{menuItems.map((item, idx , array) => { {menuItems.map((item, idx, array) => {
// const { Icon } = item; // const { Icon } = item;
const lastItem = (array.length - 1); const lastItem = array.length - 1;
return ( return (
<motion.li <motion.li
initial={{ scale: 0, opacity: 0 }} initial={{ scale: 0, opacity: 0 }}
@ -85,10 +84,8 @@ export default function NavbarSm() {
> >
<Link <Link
onClick={() => setOpen((prev) => !prev)} onClick={() => setOpen((prev) => !prev)}
className={ className={`flex items-center justify-between w-full p-3 rounded-xl text-white
`flex items-center justify-between w-full p-3 rounded-xl text-white ${lastItem === idx ? "bg-yellow" : "bg-blue"} `}
${lastItem === idx ? 'bg-yellow': 'bg-blue'} `
}
href={item.href} href={item.href}
> >
<span className="flex gap-1 text-sm">{item.name}</span> <span className="flex gap-1 text-sm">{item.name}</span>
@ -101,13 +98,7 @@ export default function NavbarSm() {
</motion.div> </motion.div>
)} )}
</AnimatePresence> </AnimatePresence>
</div> </div>
</> </>
); );
} }

View File

@ -0,0 +1,106 @@
"use client"
import React from "react";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
import LineChart from "./LineChart";
import { BsBarChartLineFill } from "react-icons/bs";
import { BsBarChartLine } from "react-icons/bs";
import { VerticalChart } from "./VerticalChart";
import { HorizontalChart } from "./HorizontalChart";
export default function ReportsController() {
return (
<div className="w-[95vw] lg:w-[85vw] 3xl:w-[70vw] mt-8 max-sm:mt-16 pt-9">
<Tabs
defaultValue="tab1"
className="w-full flex flex-col md:flex-row gap-16"
dir="rtl"
>
<div className="w-full md:w-1/4 flex flex-col justify-between items-center ">
{/* Tab Title */}
<TabsList className="w-full h-full flex flex-row md:flex-col max-md:flex-wrap max-md:justify-between bg-transparent gap-4">
<TabsTrigger
className="w-[45%] md:w-full h-12 bg-muted text-[#555353] shadow-md hover:shadow-none text-sm md:text-lg font-bold py-3 gap-2 justify-start"
value="tab1"
>
{" "}
<BsBarChartLineFill /> نمودار شماره یک
</TabsTrigger>
<TabsTrigger
className="w-[45%] md:w-full h-12 bg-muted text-[#555353] shadow-md hover:shadow-none text-sm md:text-lg font-bold py-3 gap-2 justify-start"
value="tab2"
>
{" "}
<BsBarChartLineFill /> نمودار شماره 2
</TabsTrigger>
<TabsTrigger
className="w-[45%] md:w-full h-12 bg-muted text-[#555353] shadow-md hover:shadow-none text-sm md:text-lg font-bold py-3 gap-2 justify-start"
value="tab3"
>
{" "}
<BsBarChartLineFill /> نمودار شماره 3
</TabsTrigger>
<TabsTrigger
className="w-[45%] md:w-full h-12 bg-muted text-[#555353] shadow-md hover:shadow-none text-sm md:text-lg font-bold py-3 gap-2 justify-start"
value="tab4"
>
{" "}
<BsBarChartLineFill /> نمودار شماره 4
</TabsTrigger>
<TabsTrigger
className="w-[45%] md:w-full h-12 bg-muted text-[#555353] shadow-md hover:shadow-none text-sm md:text-lg font-bold py-3 gap-2 justify-start"
value="tab5"
>
{" "}
<BsBarChartLineFill /> نمودار شماره 5
</TabsTrigger>
<TabsTrigger
className="w-[45%] md:w-full h-12 bg-muted text-[#555353] shadow-md hover:shadow-none text-sm md:text-lg font-bold py-3 gap-2 justify-start"
value="tab6"
>
{" "}
<BsBarChartLineFill /> نمودار شماره 6
</TabsTrigger>
<TabsTrigger
className="w-[45%] md:w-full h-12 bg-muted text-[#555353] shadow-md hover:shadow-none text-sm md:text-lg font-bold py-3 gap-2 justify-start"
value="tab7"
>
{" "}
<BsBarChartLineFill /> نمودار شماره 7
</TabsTrigger>
<TabsTrigger
className="w-[45%] md:w-full h-12 bg-muted text-[#555353] shadow-md hover:shadow-none text-sm md:text-lg font-bold py-3 gap-2 justify-start"
value="tab8"
>
{" "}
<BsBarChartLineFill /> نمودار شماره 8
</TabsTrigger>
</TabsList>
</div>
<div className="w-full md:w-3/4 flex justify-between items-center ">
{/* Tab Content */}
<TabsContent value="tab1" className="w-full h-full ">
<VerticalChart />
</TabsContent>
<TabsContent value="tab2" className="w-full h-full ">
<HorizontalChart />
</TabsContent>
<TabsContent value="tab3" className="w-full h-full ">
<LineChart />
</TabsContent>
<TabsContent value="tab4" className="w-full h-full ">
<HorizontalChart />
</TabsContent>
</div>
</Tabs>
</div>
);
}

View File

@ -18,7 +18,7 @@ import {
} from "@/components/ui/alert-dialog"; } from "@/components/ui/alert-dialog";
import { IoMdClose } from "react-icons/io"; import { IoMdClose } from "react-icons/io";
export default function Search() { export default function Search({mode}:{mode:string}) {
// resize // resize
function getSize() { function getSize() {
return { return {
@ -38,13 +38,16 @@ export default function Search() {
return ( return (
<div> <div>
{window.innerWidth >= 768 ? ( {window.innerWidth >= 768 || mode === 'controller'? (
<div className=" relative flex bg-gray-300 rounded-xl items-center"> <div className=" relative flex bg-gray-300 rounded-xl items-center">
<Input <Input
// type="search" // type="search"
id="default-search" id="default-search"
className="mb-0 h-8 bg-[#D6D8DE66] border-none focus-visible:none rounded-lg className={`mb-0 h-8 bg-[#D6D8DE66] border-none focus-visible:none rounded-lg
block w-full min-w-[13rem] lg:min-w-[16rem] text-xs text-black text-opacity-60 dark:text-white " block w-full min-w-[13rem] lg:min-w-[16rem] text-xs text-black
text-opacity-60 dark:text-white
${mode === 'controller' && 'h-12 max-lg:min-w-[95vw]'}`}
placeholder="جستجو..." placeholder="جستجو..."
required required
/> />
@ -64,7 +67,7 @@ export default function Search() {
<button <button
// variant="outline" // variant="outline"
// type="submit" // type="submit"
className=" bg-gradient2 text-black rounded-md p-1" className=" bg-gradient2 text-white font-bold rounded-md p-1"
> >
<CiSearch /> <CiSearch />
</button> </button>

View File

@ -0,0 +1,45 @@
import React from "react";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
import TableController from "./TableController";
import Search from "./Search";
export default function TabController() {
return (
<div className="w-[95vw] lg:w-[82vw] xl:w-[70vw] 3xl:w-[65vw] mt-8 pt-9">
<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 mt-6 md:mt-12 mb-10">
{/* Tab Title */}
<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>
<TabsTrigger value="tab1" className="hover:border-b-2 border-b-blue">جدید (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>
{/* Search Box */}
<Search mode='controller'/>
</div>
{/* Tab Content */}
<TabsContent value="tab1" >
<TableController />
</TabsContent>
<TabsContent value="tab2">
<p>password2</p>
</TabsContent>
<TabsContent value="tab3">
<p>password3</p>
</TabsContent>
<TabsContent value="tab4">
<p>password4</p>
</TabsContent>
</Tabs>
</div>
);
}

View File

@ -0,0 +1,45 @@
import React from "react";
import {
Table,
TableBody,
TableCaption,
TableCell,
TableHead,
TableHeader,
TableRow,
} from "@/components/ui/table";
import { ControllerTableItems } from "@/constants";
import Link from "next/link";
export default function TableController() {
return (
<Table className="border-[1px] border-solid border-muted rounded-md ">
{/* <TableCaption>A list of your recent invoices.</TableCaption> */}
<TableHeader>
<TableRow>
<TableHead>ردیف</TableHead>
<TableHead>تاریخ</TableHead>
<TableHead>موضوع</TableHead>
<TableHead>دستگاه مربوطه</TableHead>
</TableRow>
</TableHeader>
<TableBody className="bg-[#F5F5F5]">
{ControllerTableItems.map((item) => {
return (
<TableRow key={item.id}>
<Link
href={`/UserPanel/ControllerDashboard/Complaints/${item.id}`}
className="contents "
>
<TableCell className="w-1/12 font-medium ">{item.id}</TableCell>
<TableCell className="w-2/12">{item.date}</TableCell>
<TableCell className="w-2/12">{item.title}</TableCell>
<TableCell className="w-7/12">{item.content}</TableCell>
</Link>
</TableRow>
);
})}
</TableBody>
</Table>
);
}

View File

@ -1,20 +1,25 @@
"use client";
import React from "react"; import React from "react";
import { Input } from "./ui/input"; import { Input } from "./ui/input";
import Link from "next/link"; import Link from "next/link";
import Search from "./Search"; import Search from "./Search";
import { usePathname } from 'next/navigation'
export default function TopNav() { export default function TopNav() {
const pathname = usePathname()
return ( return (
<div className="flex justify-between items-center w-full px-8 py-2 z-10 border-b-[#C9CFD7] border-b-[1px] border-solid <div className={`flex justify-between items-center w-full px-8 py-2 z-10 border-b-[#C9CFD7] border-b-[1px] border-solid
max-md:bg-gray max-md:bg-gray max-md:bg-transparent max-md:px-0 max-md:justify-end max-md:border-b-0
max-md:bg-transparent max-md:px-0 max-md:justify-end max-md:border-b-0"> ${pathname === "/" ? "bg-transparent" : "bg-white"} `}>
<h1 className="bg-gradient-to-r from-gradient1 to-gradient2 inline-block text-transparent bg-clip-text <h1 className="bg-gradient-to-r from-gradient1 to-gradient2 inline-block text-transparent bg-clip-text
max-md:hidden"> max-md:hidden">
سال 1402 | مهارم تورم، رشد تولید سال 1402 | مهارم تورم، رشد تولید
</h1> </h1>
{/* <p>Current pathname: {pathname}</p> */} {/* <p>Current pathname: {pathname}</p> */}
<div className="flex items-center gap-10"> <div className="flex items-center gap-10">
<Search/>
<div className=" flex items-center gap-3 md:ml-4"> <div className=" flex items-center gap-3 md:ml-4">
@ -51,6 +56,9 @@ export default function TopNav() {
</defs> </defs>
</svg> </svg>
</div> </div>
<Search/>
</div> </div>
</div> </div>
); );

View File

@ -0,0 +1,58 @@
import React from 'react';
import {
Chart as ChartJS,
CategoryScale,
LinearScale,
BarElement,
Title,
Tooltip,
Legend,
} from 'chart.js';
import { Bar } from 'react-chartjs-2';
import { faker } from "@faker-js/faker";
ChartJS.register(
CategoryScale,
LinearScale,
BarElement,
Title,
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 (
<Bar options={options} data={data} className='!w-full !h-full'/>
)
}

120
components/ui/table.tsx Normal file
View File

@ -0,0 +1,120 @@
import * as React from "react"
import { cn } from "@/lib/utils"
const Table = React.forwardRef<
HTMLTableElement,
React.HTMLAttributes<HTMLTableElement>
>(({ className, ...props }, ref) => (
<div className="relative w-full overflow-auto">
<table
ref={ref}
className={cn("w-full caption-bottom text-sm", className)}
{...props}
/>
</div>
))
Table.displayName = "Table"
const TableHeader = React.forwardRef<
HTMLTableSectionElement,
React.HTMLAttributes<HTMLTableSectionElement>
>(({ className, ...props }, ref) => (
<thead ref={ref} className={cn("[&_tr]:border-b border-b-2", className)} {...props} />
))
TableHeader.displayName = "TableHeader"
const TableBody = React.forwardRef<
HTMLTableSectionElement,
React.HTMLAttributes<HTMLTableSectionElement>
>(({ className, ...props }, ref) => (
<tbody
ref={ref}
className={cn("[&_tr:last-child]:border-0", className)}
{...props}
/>
))
TableBody.displayName = "TableBody"
const TableFooter = React.forwardRef<
HTMLTableSectionElement,
React.HTMLAttributes<HTMLTableSectionElement>
>(({ className, ...props }, ref) => (
<tfoot
ref={ref}
className={cn(
"border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",
className
)}
{...props}
/>
))
TableFooter.displayName = "TableFooter"
const TableRow = React.forwardRef<
HTMLTableRowElement,
React.HTMLAttributes<HTMLTableRowElement>
>(({ className, ...props }, ref) => (
<tr
ref={ref}
className={cn(
"border-b transition-colors data-[state=selected]:bg-muted h-12",
className
)}
{...props}
/>
))
TableRow.displayName = "TableRow"
const TableHead = React.forwardRef<
HTMLTableCellElement,
React.ThHTMLAttributes<HTMLTableCellElement>
>(({ className, ...props }, ref) => (
<th
ref={ref}
className={cn(
"h-10 px-2 text-center align-middle font-medium text-black [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
className
)}
{...props}
/>
))
TableHead.displayName = "TableHead"
const TableCell = React.forwardRef<
HTMLTableCellElement,
React.TdHTMLAttributes<HTMLTableCellElement>
>(({ className, ...props }, ref) => (
<td
ref={ref}
className={cn(
"p-2 text-center text-muted-foreground align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
className
)}
{...props}
/>
))
TableCell.displayName = "TableCell"
const TableCaption = React.forwardRef<
HTMLTableCaptionElement,
React.HTMLAttributes<HTMLTableCaptionElement>
>(({ className, ...props }, ref) => (
<caption
ref={ref}
className={cn("mt-4 text-sm text-muted-foreground", className)}
{...props}
/>
))
TableCaption.displayName = "TableCaption"
export {
Table,
TableHeader,
TableBody,
TableFooter,
TableHead,
TableRow,
TableCell,
TableCaption,
}

55
components/ui/tabs.tsx Normal file
View File

@ -0,0 +1,55 @@
"use client"
import * as React from "react"
import * as TabsPrimitive from "@radix-ui/react-tabs"
import { cn } from "@/lib/utils"
const Tabs = TabsPrimitive.Root
const TabsList = React.forwardRef<
React.ElementRef<typeof TabsPrimitive.List>,
React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>
>(({ className, ...props }, ref) => (
<TabsPrimitive.List
ref={ref}
className={cn(
"inline-flex h-14 items-center justify-start rounded-md bg-[#E9E9E9] p-2 text-muted-foreground",
className
)}
{...props}
/>
))
TabsList.displayName = TabsPrimitive.List.displayName
const TabsTrigger = React.forwardRef<
React.ElementRef<typeof TabsPrimitive.Trigger>,
React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>
>(({ className, ...props }, ref) => (
<TabsPrimitive.Trigger
ref={ref}
className={cn(
"inline-flex items-center justify-center h-full whitespace-nowrap rounded-sm px-1 sm:px-3 py-1.5 text-xs sm:text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-blue data-[state=active]:text-white data-[state=active]:shadow-sm",
className
)}
{...props}
/>
))
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName
const TabsContent = React.forwardRef<
React.ElementRef<typeof TabsPrimitive.Content>,
React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>
>(({ className, ...props }, ref) => (
<TabsPrimitive.Content
ref={ref}
className={cn(
"mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
className
)}
{...props}
/>
))
TabsContent.displayName = TabsPrimitive.Content.displayName
export { Tabs, TabsList, TabsTrigger, TabsContent }

View File

@ -1,21 +1,41 @@
import { LuMapPin } from "react-icons/lu"; import { LuMapPin } from "react-icons/lu";
import { HiOutlineMail } from "react-icons/hi"; import { HiOutlineMail } from "react-icons/hi";
import { FiPhone } from "react-icons/fi"; import { FiPhone } from "react-icons/fi";
export const menuItems = [ export const menuItems = [
{ id: 1, name: "صفحه اصلی" , href:"/" }, { id: 1, name: "صفحه اصلی", href: "/" },
{ id: 2, name: "اخبار" , href:"/" }, { id: 2, name: "اخبار", href: "/" },
{ id: 3, name: "درباره ما" , href:"/" }, { id: 3, name: "درباره ما", href: "/" },
{ id: 4, name: "تماس با ما" , href:"/CallUs" }, { id: 4, name: "تماس با ما", href: "/CallUs" },
{ id: 5, name: "پیگیری" , href:"/" }, { id: 5, name: "پیگیری", href: "/" },
{ id: 6, name: "ورود به پنل کاربری" , href:"/Login" }, { id: 6, name: "ورود به پنل کاربری", href: "/Login" },
]; ];
export const boxItems = [ export const boxItems = [
{ id: 1, name: "ثبت شکایت", icon: "/img/box1.svg" , icon2: "/img/box1-hover.svg" , description:"ارسال درخواست نارضایتی از پرسنل", link:"/RequestStep1"}, {
{ id: 2, name: "پیگیری شکایت", icon: "/img/box2.svg" , icon2: "/img/box2-hover.svg" , description:"پیگیری درخواست ارسال شده" , link:"/FollowUp"}, id: 1,
{ id: 3, name: "مشاهده آمار", icon: "/img/box3.svg" , icon2: "/img/box3-hover.svg" , description:"مشاهده آمار و گزارشات درخواست ها" , link:"/"}, name: "ثبت شکایت",
icon: "/img/box1.svg",
icon2: "/img/box1-hover.svg",
description: "ارسال درخواست نارضایتی از پرسنل",
link: "/RequestStep1",
},
{
id: 2,
name: "پیگیری شکایت",
icon: "/img/box2.svg",
icon2: "/img/box2-hover.svg",
description: "پیگیری درخواست ارسال شده",
link: "/FollowUp",
},
{
id: 3,
name: "مشاهده آمار",
icon: "/img/box3.svg",
icon2: "/img/box3-hover.svg",
description: "مشاهده آمار و گزارشات درخواست ها",
link: "/",
},
]; ];
export const newsItems = [ export const newsItems = [
@ -57,34 +77,107 @@ export const requestItems = [
{ id: 4, name: " اعلام نتیجه درخواست" }, { id: 4, name: " اعلام نتیجه درخواست" },
]; ];
export const aboutFooterItems = [ export const aboutFooterItems = [
{ id: 1, name: "لورم ایپسوم متن ساختگی با تولید سادگی نامفهوم از صنعت چاپ و بااستفاده از طراحان گرافیک است. چاپگرها و متون بلکه روزنامه و مجلهدر ستون و سطرآنچنان که لازم است لورم ایپسوم متن ساختگی با تولید سادگی نامفهوم از صنعت چاپ " }, {
id: 1,
name: "لورم ایپسوم متن ساختگی با تولید سادگی نامفهوم از صنعت چاپ و بااستفاده از طراحان گرافیک است. چاپگرها و متون بلکه روزنامه و مجلهدر ستون و سطرآنچنان که لازم است لورم ایپسوم متن ساختگی با تولید سادگی نامفهوم از صنعت چاپ ",
},
]; ];
export const footerItems = [ export const footerItems = [
{ id: 1, name: "قوانین مربوط به سوت زنی" , href:"/"}, { id: 1, name: "قوانین مربوط به سوت زنی", href: "/" },
{ id: 2, name: "ارسال گزارش در سامانه سوت زنی قوه قضاییه", href:"/" }, { id: 2, name: "ارسال گزارش در سامانه سوت زنی قوه قضاییه", href: "/" },
{ id: 3, name: "وب سایت قوه قضاییه" , href:"/"}, { id: 3, name: "وب سایت قوه قضاییه", href: "/" },
{ id: 4, name: " وب سایت ریاست جمهوری" , href:"/"}, { id: 4, name: " وب سایت ریاست جمهوری", href: "/" },
]; ];
export const callUsItems = [ export const callUsItems = [
{ id: 1, title: "نشانی", icon: <LuMapPin size="full"/> , description:" نشانی ما جهت ارتباط ", description2:"google map"}, {
{ id: 2, title: "نشانی الکترونیک", icon:<HiOutlineMail size="full"/> , description:"جهت ارتباط ما با باا شماره" , description2:"sotzani@gamil.com"}, id: 1,
{ id: 3, title: "تماس با ما ", icon: <FiPhone size="full"/> , description:"جهت ارتباط ما با باا شماره" , description2:"03531234567"}, title: "نشانی",
icon: <LuMapPin size="full" />,
description: " نشانی ما جهت ارتباط ",
description2: "google map",
},
{
id: 2,
title: "نشانی الکترونیک",
icon: <HiOutlineMail size="full" />,
description: "جهت ارتباط ما با باا شماره",
description2: "sotzani@gamil.com",
},
{
id: 3,
title: "تماس با ما ",
icon: <FiPhone size="full" />,
description: "جهت ارتباط ما با باا شماره",
description2: "03531234567",
},
]; ];
export const ControllerMenuItems = [ export const ControllerMenuItems = [
{ id: 1, name: "داشبورد" , href:"/" }, { id: 1, name: "داشبورد", href: "/UserPanel/ControllerDashboard" },
{ id: 2, name: "شکایات" , href:"/" }, { id: 2, name: "شکایات", href: "/UserPanel/ControllerDashboard/Complaints" },
{ id: 3, name: "گزارشات و آمار" , href:"/" }, {
id: 3,
name: "گزارشات و آمار",
href: "/UserPanel/ControllerDashboard/Reports",
},
]; ];
export const AdminMenuItems = [ export const AdminMenuItems = [
{ id: 1, name: "داشبورد" , href:"/" }, { id: 1, name: "داشبورد", href: "/" },
{ id: 2, name: "شکایات" , href:"/" }, { id: 2, name: "شکایات", href: "/" },
{ id: 3, name: "گزارشات و آمار" , href:"/" }, { id: 3, name: "گزارشات و آمار", href: "/" },
];
export const ControllerTableItems = [
{
id: 1,
date: "1402/09/05",
title: "درخواست رشوه ",
content: "واحد روابط عمومی شهرداری",
},
{
id: 2,
date: "1402/09/05",
title: "درخواست رشوه ",
content: "واحد روابط عمومی شهرداری",
},
{
id: 3,
date: "1402/09/05",
title: "درخواست رشوه ",
content: "واحد روابط عمومی شهرداری",
},
];
export const ComplainDetailsItems = [
{
id: 1,
title: "ثبت شکایت",
desc: "سند 54841",
date: "1402/09/05",
time: " 12:58 ",
},
{
id: 2,
title: "تایید توسط بازرس ...",
desc: "سند 54841",
date: "1402/09/05",
time: " 12:58 ",
},
{
id: 3,
title: "ارجاع به واحد...",
desc: "سند 54841",
date: "1402/09/05",
time: " 12:58 ",
},
{
id: 4,
title: "پاسخ",
desc: "سند 54841",
date: "1402/09/05",
time: " 12:58 ",
},
]; ];

123
package-lock.json generated
View File

@ -12,9 +12,11 @@
"@radix-ui/react-alert-dialog": "^1.0.5", "@radix-ui/react-alert-dialog": "^1.0.5",
"@radix-ui/react-label": "^2.0.2", "@radix-ui/react-label": "^2.0.2",
"@radix-ui/react-slot": "^1.0.2", "@radix-ui/react-slot": "^1.0.2",
"@radix-ui/react-tabs": "^1.0.4",
"@radix-ui/react-toast": "^1.1.5", "@radix-ui/react-toast": "^1.1.5",
"@tanstack/react-query": "^5.8.7", "@tanstack/react-query": "^5.8.7",
"@uidotdev/usehooks": "^2.4.1", "@uidotdev/usehooks": "^2.4.1",
"chart.js": "^4.4.1",
"class-variance-authority": "^0.7.0", "class-variance-authority": "^0.7.0",
"clsx": "^2.0.0", "clsx": "^2.0.0",
"framer-motion": "^10.16.16", "framer-motion": "^10.16.16",
@ -24,6 +26,7 @@
"lucide-react": "^0.292.0", "lucide-react": "^0.292.0",
"next": "14.0.3", "next": "14.0.3",
"react": "^18.2.0", "react": "^18.2.0",
"react-chartjs-2": "^5.2.0",
"react-dom": "^18.2.0", "react-dom": "^18.2.0",
"react-hook-form": "^7.48.2", "react-hook-form": "^7.48.2",
"react-icons": "^4.12.0", "react-icons": "^4.12.0",
@ -35,6 +38,7 @@
"zod": "^3.22.4" "zod": "^3.22.4"
}, },
"devDependencies": { "devDependencies": {
"@faker-js/faker": "^8.3.1",
"@types/leaflet": "^1.9.8", "@types/leaflet": "^1.9.8",
"@types/node": "^20", "@types/node": "^20",
"@types/react": "^18.2.43", "@types/react": "^18.2.43",
@ -149,6 +153,22 @@
"node": "^12.22.0 || ^14.17.0 || >=16.0.0" "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
} }
}, },
"node_modules/@faker-js/faker": {
"version": "8.3.1",
"resolved": "https://registry.npmjs.org/@faker-js/faker/-/faker-8.3.1.tgz",
"integrity": "sha512-FdgpFxY6V6rLZE9mmIBb9hM0xpfvQOSNOLnzolzKwsE1DH+gC7lEKV1p1IbR0lAYyvYd5a4u3qWJzowUkw1bIw==",
"dev": true,
"funding": [
{
"type": "opencollective",
"url": "https://opencollective.com/fakerjs"
}
],
"engines": {
"node": "^14.17.0 || ^16.13.0 || >=18.0.0",
"npm": ">=6.14.13"
}
},
"node_modules/@googlemaps/js-api-loader": { "node_modules/@googlemaps/js-api-loader": {
"version": "1.16.2", "version": "1.16.2",
"resolved": "https://registry.npmjs.org/@googlemaps/js-api-loader/-/js-api-loader-1.16.2.tgz", "resolved": "https://registry.npmjs.org/@googlemaps/js-api-loader/-/js-api-loader-1.16.2.tgz",
@ -242,6 +262,11 @@
"@jridgewell/sourcemap-codec": "^1.4.14" "@jridgewell/sourcemap-codec": "^1.4.14"
} }
}, },
"node_modules/@kurkle/color": {
"version": "0.3.2",
"resolved": "https://registry.npmjs.org/@kurkle/color/-/color-0.3.2.tgz",
"integrity": "sha512-fuscdXJ9G1qb7W8VdHi+IwRqij3lBkosAm4ydQtEmbY58OzHXqQhvlxqEkoz0yssNVn38bcpRWgA9PP+OGoisw=="
},
"node_modules/@next/env": { "node_modules/@next/env": {
"version": "14.0.3", "version": "14.0.3",
"resolved": "https://registry.npmjs.org/@next/env/-/env-14.0.3.tgz", "resolved": "https://registry.npmjs.org/@next/env/-/env-14.0.3.tgz",
@ -555,6 +580,23 @@
} }
} }
}, },
"node_modules/@radix-ui/react-direction": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@radix-ui/react-direction/-/react-direction-1.0.1.tgz",
"integrity": "sha512-RXcvnXgyvYvBEOhCBuddKecVkoMiI10Jcm5cTI7abJRAHYfFxeu+FBQs/DvdxSYucxR5mna0dNsL6QFlds5TMA==",
"dependencies": {
"@babel/runtime": "^7.13.10"
},
"peerDependencies": {
"@types/react": "*",
"react": "^16.8 || ^17.0 || ^18.0"
},
"peerDependenciesMeta": {
"@types/react": {
"optional": true
}
}
},
"node_modules/@radix-ui/react-dismissable-layer": { "node_modules/@radix-ui/react-dismissable-layer": {
"version": "1.0.5", "version": "1.0.5",
"resolved": "https://registry.npmjs.org/@radix-ui/react-dismissable-layer/-/react-dismissable-layer-1.0.5.tgz", "resolved": "https://registry.npmjs.org/@radix-ui/react-dismissable-layer/-/react-dismissable-layer-1.0.5.tgz",
@ -735,6 +777,37 @@
} }
} }
}, },
"node_modules/@radix-ui/react-roving-focus": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/@radix-ui/react-roving-focus/-/react-roving-focus-1.0.4.tgz",
"integrity": "sha512-2mUg5Mgcu001VkGy+FfzZyzbmuUWzgWkj3rvv4yu+mLw03+mTzbxZHvfcGyFp2b8EkQeMkpRQ5FiA2Vr2O6TeQ==",
"dependencies": {
"@babel/runtime": "^7.13.10",
"@radix-ui/primitive": "1.0.1",
"@radix-ui/react-collection": "1.0.3",
"@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-id": "1.0.1",
"@radix-ui/react-primitive": "1.0.3",
"@radix-ui/react-use-callback-ref": "1.0.1",
"@radix-ui/react-use-controllable-state": "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-slot": { "node_modules/@radix-ui/react-slot": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.0.2.tgz", "resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.0.2.tgz",
@ -753,6 +826,36 @@
} }
} }
}, },
"node_modules/@radix-ui/react-tabs": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/@radix-ui/react-tabs/-/react-tabs-1.0.4.tgz",
"integrity": "sha512-egZfYY/+wRNCflXNHx+dePvnz9FbmssDTJBtgRfDY7e8SE5oIo3Py2eCB1ckAbh1Q7cQ/6yJZThJ++sgbxibog==",
"dependencies": {
"@babel/runtime": "^7.13.10",
"@radix-ui/primitive": "1.0.1",
"@radix-ui/react-context": "1.0.1",
"@radix-ui/react-direction": "1.0.1",
"@radix-ui/react-id": "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"
},
"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-toast": { "node_modules/@radix-ui/react-toast": {
"version": "1.1.5", "version": "1.1.5",
"resolved": "https://registry.npmjs.org/@radix-ui/react-toast/-/react-toast-1.1.5.tgz", "resolved": "https://registry.npmjs.org/@radix-ui/react-toast/-/react-toast-1.1.5.tgz",
@ -1593,6 +1696,17 @@
"url": "https://github.com/chalk/chalk?sponsor=1" "url": "https://github.com/chalk/chalk?sponsor=1"
} }
}, },
"node_modules/chart.js": {
"version": "4.4.1",
"resolved": "https://registry.npmjs.org/chart.js/-/chart.js-4.4.1.tgz",
"integrity": "sha512-C74QN1bxwV1v2PEujhmKjOZ7iUM4w6BWs23Md/6aOZZSlwMzeCIDGuZay++rBgChYru7/+QFeoQW0fQoP534Dg==",
"dependencies": {
"@kurkle/color": "^0.3.0"
},
"engines": {
"pnpm": ">=7"
}
},
"node_modules/chokidar": { "node_modules/chokidar": {
"version": "3.5.3", "version": "3.5.3",
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz",
@ -4157,6 +4271,15 @@
"node": ">=0.10.0" "node": ">=0.10.0"
} }
}, },
"node_modules/react-chartjs-2": {
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/react-chartjs-2/-/react-chartjs-2-5.2.0.tgz",
"integrity": "sha512-98iN5aguJyVSxp5U3CblRLH67J8gkfyGNbiK3c+l1QI/G4irHMPQw44aEPmjVag+YKTyQ260NcF82GTQ3bdscA==",
"peerDependencies": {
"chart.js": "^4.1.1",
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
}
},
"node_modules/react-dom": { "node_modules/react-dom": {
"version": "18.2.0", "version": "18.2.0",
"resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.2.0.tgz", "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.2.0.tgz",

View File

@ -13,9 +13,11 @@
"@radix-ui/react-alert-dialog": "^1.0.5", "@radix-ui/react-alert-dialog": "^1.0.5",
"@radix-ui/react-label": "^2.0.2", "@radix-ui/react-label": "^2.0.2",
"@radix-ui/react-slot": "^1.0.2", "@radix-ui/react-slot": "^1.0.2",
"@radix-ui/react-tabs": "^1.0.4",
"@radix-ui/react-toast": "^1.1.5", "@radix-ui/react-toast": "^1.1.5",
"@tanstack/react-query": "^5.8.7", "@tanstack/react-query": "^5.8.7",
"@uidotdev/usehooks": "^2.4.1", "@uidotdev/usehooks": "^2.4.1",
"chart.js": "^4.4.1",
"class-variance-authority": "^0.7.0", "class-variance-authority": "^0.7.0",
"clsx": "^2.0.0", "clsx": "^2.0.0",
"framer-motion": "^10.16.16", "framer-motion": "^10.16.16",
@ -25,6 +27,7 @@
"lucide-react": "^0.292.0", "lucide-react": "^0.292.0",
"next": "14.0.3", "next": "14.0.3",
"react": "^18.2.0", "react": "^18.2.0",
"react-chartjs-2": "^5.2.0",
"react-dom": "^18.2.0", "react-dom": "^18.2.0",
"react-hook-form": "^7.48.2", "react-hook-form": "^7.48.2",
"react-icons": "^4.12.0", "react-icons": "^4.12.0",
@ -36,6 +39,7 @@
"zod": "^3.22.4" "zod": "^3.22.4"
}, },
"devDependencies": { "devDependencies": {
"@faker-js/faker": "^8.3.1",
"@types/leaflet": "^1.9.8", "@types/leaflet": "^1.9.8",
"@types/node": "^20", "@types/node": "^20",
"@types/react": "^18.2.43", "@types/react": "^18.2.43",

3
public/img/bluepoint.svg Normal file
View File

@ -0,0 +1,3 @@
<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="6" cy="6" r="6" fill="#126DA0"/>
</svg>

After

Width:  |  Height:  |  Size: 148 B

BIN
public/img/greenPoint.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 647 B

View File

@ -0,0 +1,3 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M12 0C9.62663 0 7.30655 0.703788 5.33316 2.02236C3.35977 3.34094 1.8217 5.21508 0.913451 7.4078C0.00519941 9.60051 -0.232441 12.0133 0.230582 14.3411C0.693605 16.6689 1.83649 18.807 3.51472 20.4853C5.19295 22.1635 7.33115 23.3064 9.65892 23.7694C11.9867 24.2324 14.3995 23.9948 16.5922 23.0865C18.7849 22.1783 20.6591 20.6402 21.9776 18.6668C23.2962 16.6934 24 14.3734 24 12C23.9966 8.81843 22.7313 5.76814 20.4816 3.51843C18.2319 1.26872 15.1816 0.00335979 12 0ZM17.2685 9.88384L10.8069 16.3454C10.7212 16.4312 10.6194 16.4993 10.5073 16.5457C10.3953 16.5922 10.2752 16.6161 10.1538 16.6161C10.0325 16.6161 9.91243 16.5922 9.80037 16.5457C9.68831 16.4993 9.5865 16.4312 9.50077 16.3454L6.73154 13.5762C6.55834 13.4029 6.46103 13.168 6.46103 12.9231C6.46103 12.6781 6.55834 12.4432 6.73154 12.27C6.90475 12.0968 7.13967 11.9995 7.38462 11.9995C7.62957 11.9995 7.86449 12.0968 8.0377 12.27L10.1538 14.3873L15.9623 8.57769C16.0481 8.49193 16.1499 8.4239 16.2619 8.37748C16.374 8.33107 16.4941 8.30718 16.6154 8.30718C16.7367 8.30718 16.8568 8.33107 16.9688 8.37748C17.0809 8.4239 17.1827 8.49193 17.2685 8.57769C17.3542 8.66345 17.4223 8.76527 17.4687 8.87733C17.5151 8.98938 17.539 9.10948 17.539 9.23077C17.539 9.35205 17.5151 9.47216 17.4687 9.58421C17.4223 9.69627 17.3542 9.79808 17.2685 9.88384Z" fill="#2F6926"/>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB