File size: 692 Bytes
808332c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
export default function Topbar({ serverStatus, onRefresh }) {
  const statusText =
    serverStatus === 'online'   ? 'Server online'  :
    serverStatus === 'checking' ? 'Checking…'       :
    serverStatus === 'error'    ? 'Server error'    : 'Server offline';

  return (
    <header className="topbar">
      <div className="topbar-logo">
        ⚡ Adaptive<em>Auth</em>
      </div>
      <div className="topbar-status">
        <span className={`status-dot ${serverStatus}`}></span>
        <span>{statusText}</span>
        <button className="btn btn-ghost btn-sm" onClick={onRefresh} style={{ marginLeft: 4 }}>
          Refresh
        </button>
      </div>
    </header>
  );
}