feat: add MMGame backend and frontend source code

This commit is contained in:
gmh01
2026-08-01 21:30:23 +08:00
parent 26ce0dd600
commit c176c04aab
42 changed files with 3606 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
import { Link, useNavigate } from 'react-router-dom'
import { useStore } from '../store'
export function Navbar() {
const { user, logout } = useStore()
const navigate = useNavigate()
const handleLogout = () => {
logout()
navigate('/')
}
return (
<nav>
<Link to="/" className="logo">AI </Link>
<div className="nav-links">
<Link to="/scripts"></Link>
{user ? (
<>
<Link to="/history"></Link>
<span style={{ color: '#aaa', fontSize: 14 }}>{user.nickname}</span>
<button className="btn-ghost" onClick={handleLogout}>退</button>
</>
) : (
<Link to="/login"></Link>
)}
</div>
</nav>
)
}