// src/pages/agent-office/components/TopBar.jsx
export default function TopBar({ connected, reconnectAttempt = 0 }) {
  let statusText;
  if (connected) {
    statusText = 'Connected';
  } else if (reconnectAttempt === 0) {
    statusText = 'Connecting…';
  } else {
    statusText = `Disconnected · 재연결 시도 #${reconnectAttempt}`;
  }
  return (
    <div className="ao-topbar">
      <div className="ao-topbar-left">
        <span className="ao-topbar-title">Agent Office</span>
        <span className={`ao-topbar-status ${connected ? 'connected' : 'disconnected'}`}>
          ● {statusText}
        </span>
      </div>
    </div>
  );
}
