// IceYoo Desaru — Agent chat panel // Slide-up overlay that talks to the customer-facing agent at /api/chat/sync. // Phase 1: sync (non-streaming). Phase 1+ upgrades to SSE streaming. const { useState, useRef, useEffect } = React; // ── config ──────────────────────────────────────────────────── const CHAT_API_URL = window.__CHAT_API_URL__ || "http://localhost:8002/api/chat/sync"; const RESTAURANT_NAME = "IceYoo Desaru"; // ── icons ───────────────────────────────────────────────────── const IconChat = ({ size = 22, color = "#fff" }) => ( ); const IconClose = ({ size = 22 }) => ( ); const IconSend = ({ size = 20 }) => ( ); const IconSpinner = ({ size = 18 }) => ( ); // ── chat bubble ─────────────────────────────────────────────── const ChatBubble = ({ role, text, tools, error }) => { const isUser = role === "user"; return (