"use client"; import { useEffect, useState } from "react"; import { useRouter } from "next/navigation"; import { CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, } from "@/components/ui/command"; import { ActivityIcon, CoinsIcon, FolderIcon, LayoutDashboardIcon, LightbulbIcon, LogOutIcon, PenLineIcon, ScrollTextIcon, Settings2Icon, SlidersHorizontalIcon, SparklesIcon, TerminalIcon, } from "lucide-react"; import { signOut } from "@/lib/auth-client"; type ProjectLite = { key: string; name: string; status: string }; export function CommandPalette({ projects }: { projects: ProjectLite[] }) { const router = useRouter(); const [open, setOpen] = useState(false); useEffect(() => { const onKey = (e: KeyboardEvent) => { if ((e.metaKey || e.ctrlKey) && e.key === "k") { e.preventDefault(); setOpen((v) => !v); } }; window.addEventListener("keydown", onKey); return () => window.removeEventListener("keydown", onKey); }, []); const go = (path: string) => { setOpen(false); router.push(path); }; return ( No match. go("/")}> Overview go("/projects")}> Projects go("/operations")}> Operations go("/events")}> Events go("/audit")}> Audit go("/settings")}> Settings go("/insights")}> Insight inbox go("/insights/brief")}> Daily brief go("/insights/settings/eval-sets")}> Eval sets go("/insights/costs")}> Cost dashboard go("/insights/pipeline")}> Pipeline (sessions) go("/insights/patterns")}> Patterns (clusters) go("/insights/settings/budgets")}> Budget settings go("/insights/settings/prompts")}> Prompt registry go("/content")}> İçerik kuyruğu go("/content/costs")}> İçerik maliyeti {projects.map((p) => ( go(`/projects/${p.key}`)} > {p.name} {p.status} ))} { setOpen(false); await signOut(); router.replace("/login"); }} > Sign out ); }