import { useState } from "react" import { Check, Copy, Terminal, Info, Globe, FolderOpen } from "lucide-react" import { useConnect } from "@/lib/queries" import { cn } from "@/lib/utils" export function ConnectView() { const [host, setHost] = useState(localStorage.getItem("mc_host") || "192.168.178.151") const [mcpPath, setMcpPath] = useState(localStorage.getItem("mc_mcp_path") || "") const [active, setActive] = useState("cline") const [copied, setCopied] = useState(false) const params = new URLSearchParams({ host }) if (mcpPath) params.set("mcp_path", mcpPath) const { data, error: dataErr } = useConnect(params.toString()) const error = dataErr ? String(dataErr) : "" function saveHost(v: string) { setHost(v) if (v) localStorage.setItem("mc_host", v) } function saveMcpPath(v: string) { setMcpPath(v) localStorage.setItem("mc_mcp_path", v) } const tool = data?.tools[active] async function copy() { if (!tool) return await navigator.clipboard.writeText(tool.snippet) setCopied(true) setTimeout(() => setCopied(false), 1500) } return (
{/* Header */}

Verbindung & Integration

Kopiere vorgefertigte Konfigurationsdateien für deinen lokalen PC (IDEs, Cline, Roo Code, Cursor), um direkt auf das geteilte Gedächtnis und den Auto-Swap-Gateway der Box zuzugreifen.

{/* Connection Variables Panel */}
saveHost(e.target.value)} placeholder="z.B. 192.168.178.151" className="w-full h-9 rounded-lg border border-border/60 bg-background/40 px-3 font-mono text-xs outline-none focus:ring-1 focus:ring-primary/50 text-foreground" />
saveMcpPath(e.target.value)} placeholder="z.B. F:\Coding Stuff\mission-control-2\mcp\mcp_memory.py" className="w-full h-9 rounded-lg border border-border/60 bg-background/40 px-3 font-mono text-xs outline-none focus:ring-1 focus:ring-primary/50 text-foreground" />
{error && (
Fehler beim Generieren der Snippets: {error}
)} {data && (
{/* Tool Tab Bar */}
{Object.entries(data.tools).map(([key, t]) => ( ))}
{tool && (
{/* Note / Info */} {tool.note && (
{tool.note}
)} {/* Editor Mockup Window */}
{/* Editor Header Bar */}
{/* Left: Window Control Dots */}
{/* Center: File Title */}
{active === "cline" || active === "cursor" ? "config.json" : "settings.json"}
{/* Right: Copy Action */}
{/* Editor Code Area */}
                  {tool.snippet}
                
)}
)}
) }