"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 (

Crime Map Explorer

Overview Filters Stats Info Crime Summary {selectedYear} {selectedMonth !== "all" ? ` - Month ${selectedMonth}` : ""}
Total Incidents {totalIncidents}
High Risk Areas {highRiskDistricts}
Districts {districtCount}
Data Points {crimes.reduce((total, district) => total + district.incidents.length, 0)}
District Overview
{crimes .sort((a, b) => (b.number_of_crime || 0) - (a.number_of_crime || 0)) .map((district) => ( ))}
District Incidents Level
{district.district_name} {district.number_of_crime || 0} {district.level || "N/A"}
Filter Options Customize what you see on the map

Crime Types

Severity Levels

Display Options

Crime Statistics Analysis of crime data

Crime by Type

Chart Placeholder

Crime by Time of Day

Chart Placeholder

Monthly Trend

Chart Placeholder
About This Map

This interactive crime map visualizes crime data across different districts. Use the controls to explore different aspects of the data.

Legend

Low Crime Rate
Medium Crime Rate
High Crime Rate
Critical Crime Rate

Data Sources

Crime data is collected from official police reports and updated monthly. District boundaries are based on administrative regions.

Help & Support

For questions or support regarding this map, please contact the system administrator.

) }