import { useState } from 'react'; import { NavLink, Outlet, useNavigate } from 'react-router-dom'; import { Building2, Dumbbell, LogOut, Megaphone, Menu, ScrollText, ShieldCheck, Target, Users, Wrench, X, type LucideIcon, } from 'lucide-react'; import { useAuth } from '../store/auth'; import { Button, ThemeToggle } from './ui'; import { Topbar } from '../topbar'; import { Brandmark } from './Brandmark'; import { Avatar } from './Avatar'; import { cn } from '../lib/utils'; interface NavItem { to: string; label: string; icon: LucideIcon; end: boolean; } interface NavSection { label: string; items: NavItem[]; } const SECTIONS: NavSection[] = [ { label: 'Zarządzanie', items: [ { to: '/gyms', label: 'Siłownie', icon: Building2, end: false }, { to: '/verifications', label: 'Weryfikacje', icon: ShieldCheck, end: false }, { to: '/users', label: 'Użytkownicy', icon: Users, end: false }, { to: '/announcements', label: 'Ogłoszenia', icon: Megaphone, end: false }, ], }, { label: 'Słowniki', items: [ { to: '/focus-areas', label: 'Obszary treningowe', icon: Target, end: false }, { to: '/exercises', label: 'Rodzaje ćwiczeń', icon: Dumbbell, end: false }, { to: '/equipment', label: 'Urządzenia', icon: Wrench, end: false }, ], }, { label: 'System', items: [{ to: '/logs', label: 'Logi', icon: ScrollText, end: true }], }, ]; const SIDEBAR_KEY = 'fitos-admin-sidebar-collapsed'; function readCollapsed(): boolean { try { return localStorage.getItem(SIDEBAR_KEY) === '1'; } catch { return false; } } /* Wiersze nawigacji wg Ember: aktywny = tint akcentu + pionowy pasek przy krawędzi. */ function NavLinks({ items, collapsed, onNavigate, }: { items: NavItem[]; collapsed: boolean; onNavigate?: () => void; }) { return ( ); } function NavSections({ collapsed, onNavigate }: { collapsed: boolean; onNavigate?: () => void }) { return (