Files
Cyrene_v2/frontend/web/src/components/layout/Header.tsx
T
Aska 4a71965686 feat(frontend): add React SPA with chat, auth, and admin pages
- Vite 6 + React 19 + TypeScript + Tailwind 4 + Zustand 5
- Login page with JWT auth
- Chat interface: MessageList, ChatInput, ChatContainer
- WebSocket hook with auto-reconnect and exponential backoff
- Sidebar with new chat button + session navigation
- Admin dashboard placeholder
- 57 modules, 242KB JS, TypeScript zero errors
2026-08-12 11:47:22 +08:00

15 lines
663 B
TypeScript

import { Link, useLocation } from 'react-router-dom'
export default function Header({ username, onLogout }: { username: string; onLogout: () => void }) {
return (
<header className="h-12 bg-gray-900 border-b border-gray-800 flex items-center px-4 justify-between shrink-0">
<Link to="/chat" className="font-bold text-purple-400 text-lg">Cyrene</Link>
<div className="flex items-center gap-3 text-sm text-gray-400">
<Link to="/admin/dashboard" className="hover:text-gray-200">管理</Link>
<span>{username}</span>
<button onClick={onLogout} className="hover:text-red-400">退出</button>
</div>
</header>
)
}