import React from 'react'
import { Activity, Calendar, CheckCircle, AlertTriangle, LineChart, PieChart, FileText } from 'lucide-react'
import { Card, CardContent, CardHeader, CardTitle, CardDescription } from "@/app/_components/ui/card"
import { Separator } from "@/app/_components/ui/separator"
import { cn } from "@/app/_lib/utils"
import { getMonthName } from "@/app/_utils/common"
import { SidebarSection } from "../components/sidebar-section"
import { StatCard } from "../components/stat-card"
import { CrimeTypeCard } from "../components/crime-type-card"
interface SidebarStatisticsTabProps {
crimeStats: any
selectedMonth?: number | "all"
selectedYear: number
}
export function SidebarStatisticsTab({
crimeStats,
selectedMonth = "all",
selectedYear
}: SidebarStatisticsTabProps) {
const topCategories = crimeStats.categoryCounts ?
Object.entries(crimeStats.categoryCounts)
.sort((a: any, b: any) => (b[1] as number) - (a[1] as number))
.slice(0, 4)
.map(([type, count]: [string, unknown]) => {
const countAsNumber = count as number;
const percentage = Math.round(((countAsNumber) / crimeStats.totalIncidents) * 100) || 0
return { type, count: countAsNumber, percentage }
}) : []
return (
<>
No crime data available
Try selecting a different time period