import { useState } from "react"; import { Link, useLocation, Outlet } from "react-router-dom"; import { motion, AnimatePresence } from "framer-motion"; import { Home, Music, ListMusic, Users, Settings, Menu, X, ChevronRight, Wifi, WifiOff, LogOut, User, Sun, Moon, Shield, } from "lucide-react"; import { useAuth } from "@context/AuthContext"; import { useTheme } from "@context/ThemeContext"; const navLinks = [ { path: "/", label: "Home", icon: Home }, { path: "/database", label: "Songs", icon: Music }, { path: "/worship-lists", label: "Lists", icon: ListMusic }, { path: "/profiles", label: "Profiles", icon: Users }, { path: "/admin", label: "Admin", icon: Shield }, { path: "/settings", label: "Settings", icon: Settings }, ]; export default function MainLayout() { const location = useLocation(); const { user, logout } = useAuth(); const { theme, toggleTheme, isDark } = useTheme(); const [mobileMenuOpen, setMobileMenuOpen] = useState(false); const [isOnline] = useState(navigator.onLine); const isActive = (path) => { if (path === "/") return location.pathname === "/"; return location.pathname.startsWith(path); }; // Theme-aware classes const textPrimary = isDark ? "text-white" : "text-gray-900"; const textSecondary = isDark ? "text-white/60" : "text-gray-600"; const textMuted = isDark ? "text-white/50" : "text-gray-500"; return (