"use client"; import Link from "next/link"; import { usePathname, useRouter } from "next/navigation"; import { Terminal, History, LogOut } from "lucide-react"; import { Button } from "@/components/ui/button"; import { cn } from "@/lib/utils"; const links = [ { href: "/", label: "Scripts", icon: Terminal }, { href: "/runs", label: "History", icon: History }, ]; export function Nav({ authEnabled, username, }: { authEnabled: boolean; username: string | null; }) { const pathname = usePathname(); const router = useRouter(); async function handleLogout() { await fetch("/api/auth/logout", { method: "POST" }); router.push("/login"); router.refresh(); } return (
TriggerShell
{authEnabled && (
{username}
)}
); }