Replaces the default shadcn grayscale/Geist look with a deliberate identity built around the product's own subject - a control panel for running scripts and watching their output live: - Type: Bricolage Grotesque for page/card titles (via the existing --font-heading token, used with restraint), IBM Plex Sans for UI body text, IBM Plex Mono for technical data (run IDs, commands, timestamps, status labels) - all self-hosted at build time via next/font/google, no runtime CDN dependency for a self-hosted tool. - Color: a cool graphite ink/paper base with a warm brass signal accent in both themes. The brass tone doubles as the "running" status color, so an active run literally lights the UI up with the brand color. New --status-* tokens give queued/running/succeeded/failed/cancelled/ warn a single source of truth instead of ad-hoc Tailwind color classes. - Structural language: small tracked-out uppercase mono labels mark technical fields (Command, Variables, Triggered by...) consistently; the live-output terminal gets an instrument-bezel frame (header bar + panel) instead of floating loose above the xterm canvas. Layout/IA is unchanged throughout - this is a token- and detail-level pass, not a restructuring. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
76 lines
2.5 KiB
TypeScript
76 lines
2.5 KiB
TypeScript
"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";
|
|
import { ThemeToggle } from "./theme-toggle";
|
|
|
|
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 (
|
|
<header className="border-b bg-background/95 sticky top-0 z-10 backdrop-blur">
|
|
<div className="mx-auto flex h-14 max-w-5xl items-center justify-between gap-2 px-4">
|
|
<div className="flex min-w-0 items-center gap-3 sm:gap-6">
|
|
<Link
|
|
href="/"
|
|
className="font-heading flex shrink-0 items-center gap-2 text-[1.05rem] font-semibold tracking-tight"
|
|
>
|
|
<Terminal className="text-primary size-5" />
|
|
TriggerShell
|
|
</Link>
|
|
<nav className="flex items-center gap-1">
|
|
{links.map(({ href, label, icon: Icon }) => (
|
|
<Link
|
|
key={href}
|
|
href={href}
|
|
className={cn(
|
|
"text-muted-foreground hover:text-foreground hover:bg-muted/60 flex items-center gap-1.5 rounded-md px-2 py-1.5 text-sm font-medium transition-colors sm:px-3",
|
|
pathname === href && "bg-primary/10 text-foreground",
|
|
)}
|
|
>
|
|
<Icon className="size-4" />
|
|
<span className="sr-only sm:not-sr-only">{label}</span>
|
|
</Link>
|
|
))}
|
|
</nav>
|
|
</div>
|
|
<div className="flex shrink-0 items-center gap-1 sm:gap-2">
|
|
<ThemeToggle />
|
|
{authEnabled && (
|
|
<>
|
|
<span className="text-muted-foreground hidden max-w-32 truncate text-sm sm:inline-block">
|
|
{username}
|
|
</span>
|
|
<Button variant="ghost" size="sm" onClick={handleLogout}>
|
|
<LogOut className="size-4" />
|
|
<span className="sr-only sm:not-sr-only">Log out</span>
|
|
</Button>
|
|
</>
|
|
)}
|
|
</div>
|
|
</div>
|
|
</header>
|
|
);
|
|
}
|