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
This commit is contained in:
Aska committed 2026-08-12 11:47:22 +08:00
1 parent 192144563b
commit 4a71965686
35 files changed
+3146

No files matched your search

@@ -0,0 +1,14 @@
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>
)
}