import React, { useState } from 'react'; import { NavLink, Outlet } from 'react-router-dom'; import { useUIStore } from '@/store/uiStore'; import { ChevronRight, ChevronDown, ScrollText, FileText, AlertTriangle, ArrowLeft } from 'lucide-react'; import { useTranslation } from 'react-i18next'; interface LogNode { title: string; path?: string; icon?: React.ReactNode; children?: LogNode[]; } const LOG_TREE: LogNode[] = [ { title: 'Audit-Log', icon: , children: [ { title: 'Übersicht', path: '/logs/overview' }, { title: 'Filter', path: '/logs/filter' }, { title: 'Export', path: '/logs/export' }, ], }, { title: 'System-Logs', icon: , children: [ { title: 'Container', path: '/logs/container' }, { title: 'Worker', path: '/logs/worker' }, { title: 'Datenbank', path: '/logs/database' }, ], }, { title: 'Fehler', icon: , children: [ { title: 'API-Fehler', path: '/logs/api-errors' }, { title: 'Plugin-Fehler', path: '/logs/plugin-errors' }, ], }, ]; function TreeItem({ node, depth }: { node: LogNode; depth: number }) { const { t } = useTranslation(); const [expanded, setExpanded] = useState(depth < 1); const hasChildren = node.children && node.children.length > 0; const paddingLeft = depth * 16 + 12; if (hasChildren) { return (
{expanded && (
{node.children!.map((child) => ( ))}
)}
); } return ( `flex items-center gap-2 px-3 py-2 rounded-lg text-sm transition-colors min-h-touch ${ isActive ? 'bg-primary-100 text-primary-700 font-medium' : 'text-secondary-600 hover:bg-secondary-100 hover:text-secondary-900' }` } style={{ paddingLeft: paddingLeft + 20 }} > {node.icon} {node.title} ); } export function LogsPage() { const { t } = useTranslation(); const sidebarOpen = useUIStore((state) => state.sidebarOpen); return (
); }