import { useState } from 'react' import Link from 'next/link' import { useRouter } from 'next/router' import { ChevronDownIcon, HomeIcon, ShieldExclamationIcon, DocumentTextIcon, UsersIcon, Cog6ToothIcon, ChartBarIcon, KeyIcon, BellIcon, EyeIcon, ExclamationTriangleIcon, CloudArrowUpIcon, ServerStackIcon, CpuChipIcon, ClockIcon, CircleStackIcon, FolderIcon, TagIcon, DocumentDuplicateIcon, ArrowTrendingUpIcon, ShieldCheckIcon, GlobeAltIcon, MagnifyingGlassIcon, AdjustmentsHorizontalIcon, BugAntIcon } from '@heroicons/react/24/outline' interface AdminLayoutProps { children: React.ReactNode title?: string } const navigation = [ { name: 'Dashboard', href: '/admin', icon: HomeIcon, current: false, }, { name: 'Správa zdrojov', icon: ShieldExclamationIcon, current: false, children: [ { name: 'Všetky zdroje', href: '/admin/sources' }, { name: 'Bulk import', href: '/admin/bulk-import' }, ], }, { name: 'Hlásenia', icon: DocumentTextIcon, current: false, children: [ { name: 'Všetky hlásenia', href: '/admin/reports' }, ], }, { name: 'Kategórie', href: '/admin/categories', icon: TagIcon, current: false, }, { name: 'Používatelia', icon: UsersIcon, current: false, children: [ { name: 'Správa používateľov', href: '/admin/users' }, ], }, { name: 'API & Integrácie', icon: KeyIcon, current: false, children: [ { name: 'API kľúče', href: '/admin/api-keys' }, { name: 'Webhooks', href: '/admin/webhooks' }, ], }, { name: 'Monitoring', icon: ChartBarIcon, current: false, children: [ { name: 'Prehľad výkonnosti', href: '/admin/monitoring' }, { name: 'Real-time monitor', href: '/admin/monitoring/realtime' }, ], }, { name: 'Exporty', icon: DocumentDuplicateIcon, current: false, children: [ { name: 'Export dát', href: '/admin/export' }, ], }, { name: 'Nastavenia', icon: Cog6ToothIcon, current: false, children: [ { name: 'Všeobecné', href: '/admin/settings/general' }, ], }, { name: 'Systém', icon: ServerStackIcon, current: false, children: [ { name: 'Stav systému', href: '/admin/system/status' }, ], }, ] function classNames(...classes: string[]) { return classes.filter(Boolean).join(' ') } export default function AdminLayout({ children, title = 'Administrácia' }: AdminLayoutProps) { const router = useRouter() const [sidebarOpen, setSidebarOpen] = useState(false) const [expandedMenus, setExpandedMenus] = useState([]) const toggleMenu = (menuName: string) => { setExpandedMenus(prev => prev.includes(menuName) ? prev.filter(name => name !== menuName) : [...prev, menuName] ) } const isCurrentPath = (href: string) => { if (href === '/admin') { return router.pathname === '/admin' } return router.pathname.startsWith(href) } return (
{/* Static sidebar for desktop */}

Hliadka.sk Admin

{/* Main content */}
{/* Search bar */}
{/* Profile dropdown */}
{/* Page header */}

{title}

{/* Page content */}
{children}
) }