import { Info, LogOut, Plus, Settings, ShieldCheck, X } from 'lucide-react' import { NavLink, useNavigate } from 'react-router-dom' import { useI18n } from '../i18n' import { outbox } from '../lib/outbox' import { initials } from '../lib/initials' import { roleLabel } from '../lib/labels' import { primaryNav } from '../lib/navigation' import { useLogout, type Me } from '../lib/queries' import { Eyebrow } from './Eyebrow' import { LanguageToggle } from './LanguageToggle' import { iconButton } from './styles' const navLink = ({ isActive }: { isActive: boolean }) => `flex h-[42px] items-center gap-3 rounded-md px-3 text-[13px] hover:bg-forest-800 hover:text-white ${isActive ? 'bg-forest-800 text-white' : 'text-forest-200'}` const navSection = 'mb-6 border-b border-forest-700 pb-[23px]' interface SidebarProps { me: Me open: boolean onClose: () => void badges: Partial> } export function Sidebar({ me, open, onClose, badges }: SidebarProps) { const logout = useLogout() const navigate = useNavigate() const { t } = useI18n() const signOut = () => { const unsent = outbox.getState().items.filter((item) => item.kind === 'report' && item.userId === me.user.id).length if (unsent && !confirm(t.outbox.signOutWarning(unsent))) return logout.mutate(undefined, { onSuccess: () => navigate('/login') }) } return ( ) }