'use client' import Link from 'next/link' import { usePathname } from 'next/navigation' import { cn } from '@/lib/utils' import { LayoutDashboard, Trophy, Megaphone, BarChart3, Wallet, Bot, Zap, Shield, ChevronLeft, ChevronRight, Settings } from 'lucide-react' import { useState, useEffect } from 'react' const nav = [ { label: 'Dashboard', href: '/', icon: LayoutDashboard }, { label: 'Leaderboard', href: '/leaderboard', icon: Trophy }, { label: 'Campaigns', href: '/campaigns', icon: Megaphone }, { label: 'Analytics', href: '/analytics', icon: BarChart3 }, { label: 'Wallets', href: '/wallets', icon: Wallet }, { label: 'AI Agent', href: '/agent', icon: Bot }, { label: 'Settings', href: '/settings', icon: Settings }, ] export function Sidebar() { const path = usePathname() const [col, setCol] = useState(false) const [eventCount, setEventCount] = useState(null) useEffect(() => { const fetchCount = async () => { try { const res = await fetch('/api/torque/events/recent?limit=1') if (res.ok) { const data = await res.json() setEventCount(data.total ?? 0) } } catch {} } fetchCount() const i = setInterval(fetchCount, 5000) return () => clearInterval(i) }, []) return ( ) }