// Sign-in + robot picker (same pattern as the radio app). import { state, render } from "../lib/state.js"; import { escapeHtml } from "../lib/util.js"; export function createGate({ robot, onPickedRobot }) { function GateView() { const wrap = document.createElement("div"); wrap.className = "gate"; const card = document.createElement("div"); card.className = "gate-card"; if (state.authChecking) { card.innerHTML = `
Checking sign-in…
`; } else if (!robot.isAuthenticated) { card.innerHTML = `Sign in with Hugging Face to connect to your Reachy Mini.
`; card.querySelector("#login").onclick = () => robot.login(); } else if (!robot.robots.length) { card.innerHTML = `Signed in as ${escapeHtml(robot.username || "—")}.
`; } else { card.innerHTML = `Signed in as ${escapeHtml(robot.username || "—")}.
`; const list = card.querySelector("#rlist"); for (const r of robot.robots) { const row = document.createElement("button"); row.className = "row"; row.innerHTML = `