'use client'; import { ArrowLeftCircle, BarChart3, FileSignature, Megaphone, MessageSquare } from 'lucide-react'; import Link from 'next/link'; import { usePathname } from 'next/navigation'; import { useEffect, useState } from 'react'; import { ACENTE_SESSION_EVENT, getCurrentAgency } from '@/lib/acente-session'; import { cn } from '@/lib/utils'; const ITEMS = [ { title: 'Performansım', href: '/acente', icon: BarChart3 }, { title: 'Sözleşmelerim', href: '/acente/sozlesmeler', icon: FileSignature }, { title: 'Duyurular', href: '/acente/duyurular', icon: Megaphone }, { title: 'Geri Bildirim', href: '/acente/geri-bildirim', icon: MessageSquare }, ]; export function AcenteSidebar() { const pathname = usePathname(); const [agency, setAgency] = useState(() => getCurrentAgency()); useEffect(() => { function sync() { setAgency(getCurrentAgency()); } sync(); window.addEventListener(ACENTE_SESSION_EVENT, sync); window.addEventListener('storage', sync); return () => { window.removeEventListener(ACENTE_SESSION_EVENT, sync); window.removeEventListener('storage', sync); }; }, []); const initials = agency.name .split(' ') .map((p) => p[0]) .slice(0, 2) .join('') .toUpperCase(); return ( ); }