'use client'; import Link from 'next/link'; import { usePathname } from 'next/navigation'; import { useAuth } from '@/lib/auth'; import { useTranslation } from 'react-i18next'; import { LanguageDropdown } from './LanguageDropdown'; interface NavItem { label: string; href: string; icon: React.ReactNode; } interface NavSection { title: string; items: NavItem[]; } interface SidebarProps { isOpen: boolean; onClose: () => void; } export default function Sidebar({ isOpen, onClose }: SidebarProps) { const pathname = usePathname(); const { user, logout } = useAuth(); const { t } = useTranslation(); const sections: NavSection[] = [ { title: t('sidebar.overview'), items: [ { label: t('common.dashboard'), href: '/', icon: ( ), }, ], }, { title: t('sidebar.management'), items: [ { label: t('common.agents'), href: '/agents', icon: ( ), }, { label: t('common.operations'), href: '/operations', icon: ( ), }, ], }, { title: t('sidebar.compliance'), items: [ { label: t('common.auditTrail'), href: '/audit', icon: ( ), }, { label: t('common.epochs'), href: '/epochs', icon: ( ), }, { label: t('common.exports'), href: '/exports', icon: ( ), }, ], }, { title: t('sidebar.system'), items: [ { label: t('common.jwks'), href: '/jwks', icon: ( ), }, { label: t('common.settings'), href: '/settings', icon: ( ), }, ], }, ]; function isActive(href: string): boolean { if (href === '/') return pathname === '/'; return pathname.startsWith(href); } return ( <> {/* Mobile backdrop overlay */} {isOpen && (
)} ); }