Files
ai-solver-test/app/components/Navigation.tsx
AI Agent ab88c56320
All checks were successful
Bun CI/CD / test (pull_request) Successful in 9s
Bun CI/CD / deploy-staging (pull_request) Has been skipped
Bun CI/CD / deploy-prod (pull_request) Has been skipped
fix: resolve #8 - сделай новую страницу
2026-01-03 19:14:33 +00:00

54 lines
1.7 KiB
TypeScript

'use client'
import Link from 'next/link'
import { usePathname } from 'next/navigation'
import { useAuth } from '../contexts/AuthContext'
export default function Navigation() {
const { isAuthenticated, logout } = useAuth()
const pathname = usePathname()
if (pathname === '/login' || pathname === '/dashboard') {
return null
}
return (
<nav className="bg-white shadow-sm dark:bg-black">
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div className="flex justify-between items-center h-16">
<div className="flex items-center">
<Link href="/" className="text-xl font-bold text-black dark:text-zinc-50">
Agent Manager
</Link>
</div>
<div className="flex items-center space-x-4">
{isAuthenticated ? (
<div className="flex items-center space-x-4">
<Link
href="/dashboard"
className="rounded-md bg-blue-500 px-4 py-2 text-white transition-colors hover:bg-blue-600"
>
Dashboard
</Link>
<button
onClick={logout}
className="rounded-md bg-red-500 px-4 py-2 text-white transition-colors hover:bg-red-600"
>
Logout
</button>
</div>
) : (
<Link
href="/login"
className="rounded-md bg-green-500 px-4 py-2 text-white transition-colors hover:bg-green-600"
>
Login
</Link>
)}
</div>
</div>
</div>
</nav>
)
}