import { Button, Icon } from "@yaakapp-internal/ui"; import { useAtomValue } from "jotai"; import { useRpcMutation } from "../hooks/useRpcMutation"; import { proxyStateAtom } from "../lib/store"; /** * A quiet strip while another process, the CLI daemon, owns the engine: flows still list, read * from the database, and Take over stops that process's proxy and starts this app's. Never done * without the person asking. */ export function TakeOverBanner() { const other = useAtomValue(proxyStateAtom)?.otherOwner; const takeOver = useRpcMutation("take_over"); if (other == null) return null; const since = new Date(other.startedAt).toLocaleTimeString([], { hour: "numeric", minute: "2-digit", }); const cli = other.owner === "cli"; const who = cli ? "Running from the CLI" : "Running in another Yaak Proxy"; return (