"use client"; import Link from "next/link"; import { usePathname } from "next/navigation"; import clsx from "clsx"; import { Activity, Braces, Database, Eye, Layers, Network, PlayCircle, Radar } from "lucide-react"; import { Brand } from "./Brand"; import { useApi, useLive } from "@/lib/api"; const NAV = [ { href: "/", label: "Observatory", icon: Radar }, { href: "/sessions", label: "Sessions", icon: Eye }, { href: "/entities", label: "Entities", icon: Database }, { href: "/schemas", label: "Runtime APIs", icon: Braces }, { href: "/platforms", label: "Connectors", icon: Layers }, { href: "/jobs", label: "Missions", icon: PlayCircle }, ]; export function Shell({ children }: { children: React.ReactNode }) { const path = usePathname(); if (path.startsWith("/access")) return <>{children}; return (
{children}
); } function TopBar() { const { data } = useApi<{ jobs_running: number; ts: string }>("/health", { refreshMs: 10_000 }); const { connected, rate } = useLive({ max: 1 }); return (
{connected ? "live" : "offline"} {rate}/min {data?.jobs_running ?? 0} running {data?.ts ? new Date(data.ts).toLocaleTimeString("en-CA", { hour12: false }) : ""}
); }