import { Link, useLocation, useNavigate } from "react-router-dom"; import { Activity, Users, AlertTriangle, LogOut, Brain } from "lucide-react"; import { useAuth } from "@/contexts/AuthContext"; import { useProfile } from "@/hooks/useProfile"; import { XP_PER_LEVEL, xpInLevel, isNightMode } from "@/lib/engine"; import { Button } from "@/components/ui/button"; const tabs = [ { to: "/", label: "Dashboard", icon: Activity }, { to: "/social", label: "Social", icon: Users }, { to: "/emergency", label: "Emergency", icon: AlertTriangle }, ]; export default function AppHeader() { const location = useLocation(); const navigate = useNavigate(); const { user, signOut } = useAuth(); const { profile } = useProfile(); const xp = profile?.total_xp ?? 0; const level = profile?.level ?? 1; const inLevel = xpInLevel(xp); const pct = Math.min(100, (inLevel / XP_PER_LEVEL) * 100); return ( <> {isNightMode() && (
🌙 Blue Light Alert — past 10pm. Wind down to protect tomorrow's focus.
)}
DistractIQ
{user && profile && (
L{level} {profile.username}
{inLevel}/{XP_PER_LEVEL} XP
)} {user ? ( ) : ( )}
{/* Mobile nav */}
); }