import { Link, useLocation } from "wouter"; import { LayoutDashboard, Wrench, PlusCircle, BarChart3, LogIn, LogOut, User, ShieldCheck } from "lucide-react"; import { useAuth } from "@/hooks/use-auth"; import { Button } from "@/components/ui/button"; import { Skeleton } from "@/components/ui/skeleton"; export function Layout({ children }: { children: React.ReactNode }) { const [location] = useLocation(); const { user, isLoading, isAuthenticated, isAdmin, isLocalMode, login, logout } = useAuth(); const links = [ { href: "/", label: "Dashboard", icon: LayoutDashboard }, { href: "/tools", label: "Browse Tools", icon: Wrench }, { href: "/tools/new", label: "Add Tool", icon: PlusCircle }, { href: "/analytics", label: "Analytics", icon: BarChart3 }, ...(isAdmin ? [{ href: "/admin", label: "Admin", icon: ShieldCheck }] : []), ]; return (
ToolRate
{!isLoading && ( isAuthenticated ? ( ) : ( ) )}
{children}
); }