"use client"; import { useEffect, useState } from "react"; import { usePathname } from "next/navigation"; import Link from "next/link"; import { Dock, DockIcon } from "@/components/ui/dock"; import { ThemeToggle } from "@/components/theme-toggle"; import { signOut } from "next-auth/react"; import { Home, LogIn, LogOut, Download, BookOpen, LayoutDashboard, Bookmark, } from "lucide-react"; function useIsTouch() { const [touch, setTouch] = useState(false); useEffect(() => { if (typeof window === "undefined") return; const mq = window.matchMedia("(hover: none) and (pointer: coarse)"); const update = () => setTouch(mq.matches); update(); mq.addEventListener?.("change", update); return () => mq.removeEventListener?.("change", update); }, []); return touch; } export function HomeDock({ isAuthenticated, isAdmin, onLoginClick, }: { isAuthenticated: boolean; isAdmin: boolean; onLoginClick?: () => void; }) { const isTouch = useIsTouch(); const pathname = usePathname() || "/"; const isActive = (path: string) => path === "/" ? pathname === "/" : pathname.startsWith(path); return (