"use client" import { BarChart, Bar, XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContainer, Legend } from "recharts" import { Loader2 } from "lucide-react" interface LocationData { name: string potholes: number signboards: number total: number } interface LocationBarChartProps { data: LocationData[] isLoading: boolean } const COLORS = { pothole: "#ef4444", signboard: "#3b82f6" } export function LocationBarChart({ data, isLoading }: LocationBarChartProps) { if (isLoading) { return (
) } if (data.length === 0) { return (

No location data available

Process videos to see detections by location

) } return (
{ if (active && payload && payload.length) { return (

{label}

{payload.map((entry, index) => (
{entry.name}: {entry.value}
))}
) } return null }} /> (
{payload?.map((entry, index) => (
{entry.value}
))}
)} />
) }