"use client" import { Button } from "@/app/_components/ui/button" import { ChevronLeft, Filter, Map, BarChart3, Info } from "lucide-react" import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/app/_components/ui/tabs" import { ScrollArea } from "@/app/_components/ui/scroll-area" import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/app/_components/ui/card" import { Separator } from "@/app/_components/ui/separator" interface MapSidebarProps { isOpen: boolean onToggle: () => void crimes?: Array<{ id: string district_name: string distrcit_id?: string number_of_crime?: number level?: "low" | "medium" | "high" | "critical" incidents: any[] }> selectedYear?: number | string selectedMonth?: number | string } export default function MapSidebar({ isOpen, onToggle, crimes = [], selectedYear, selectedMonth }: MapSidebarProps) { // Calculate some statistics for the sidebar const totalIncidents = crimes.reduce((total, district) => total + (district.number_of_crime || 0), 0) const highRiskDistricts = crimes.filter( (district) => district.level === "high" || district.level === "critical", ).length const districtCount = crimes.length return (
District | Incidents | Level |
---|---|---|
{district.district_name} | {district.number_of_crime || 0} | {district.level || "N/A"} |
This interactive crime map visualizes crime data across different districts. Use the controls to explore different aspects of the data.
Crime data is collected from official police reports and updated monthly. District boundaries are based on administrative regions.
For questions or support regarding this map, please contact the system administrator.