import { useEffect, useState } from 'react' import { useLocation, useNavigate } from 'react-router-dom' import { ChevronLeft, ChevronRight, Code2, Cpu, Camera, LayoutDashboard, LogOut, Moon, Package, Route, ScrollText, Server, ShieldAlert, Sun, UserCog, } from 'lucide-react' import { useAuth } from '../contexts/AuthContext' import { useLanguage } from '../contexts/LanguageContext' import { useTheme } from '../contexts/ThemeContext' import { getVersion } from '../services/api' import AppIcon from './AppIcon' interface SidebarProps { collapsed: boolean onToggle: () => void } function GitHubIcon({ className = '' }: { className?: string }) { return ( ) } function LanguageIcon({ className = '' }: { className?: string }) { return ( ) } export default function Sidebar({ collapsed, onToggle }: SidebarProps) { const navigate = useNavigate() const location = useLocation() const { logout, isSubUser } = useAuth() const { theme, toggleTheme } = useTheme() const { toggleLanguage, t } = useLanguage() const [version, setVersion] = useState('') useEffect(() => { getVersion() .then(res => { if (res.data?.data?.version) { setVersion(res.data.data.version) } }) .catch(() => {}) }, []) const isContainerPage = location.pathname.startsWith('/containers') || location.pathname.startsWith('/container') const isImagesPage = location.pathname.startsWith('/images') const isSnapshotsPage = location.pathname.startsWith('/snapshots') const isRoutingPage = location.pathname.startsWith('/routing') const isAuditLogsPage = location.pathname.startsWith('/audit-logs') const isApiIntegrationPage = location.pathname.startsWith('/api-integration') const isHostReportPage = location.pathname.startsWith('/host-report') const isSecurityPage = location.pathname.startsWith('/security') const isSettingsPage = location.pathname.startsWith('/settings') return ( ) }