feat(ADM-018): completed feature
This commit is contained in:
32
project/frontend/src/components/auth/UserMenu.tsx
Normal file
32
project/frontend/src/components/auth/UserMenu.tsx
Normal file
@@ -0,0 +1,32 @@
|
||||
'use client';
|
||||
import { useAuth } from '@/contexts/AuthContext';
|
||||
import Link from 'next/link';
|
||||
|
||||
export default function UserMenu() {
|
||||
const { user, logout } = useAuth();
|
||||
|
||||
if (user) {
|
||||
return (
|
||||
<div className="flex items-center gap-3">
|
||||
<span className="text-sm text-gray-600 hidden sm:block">
|
||||
{user.email}
|
||||
</span>
|
||||
<button
|
||||
onClick={logout}
|
||||
className="text-sm font-medium text-[#70ad47] hover:text-[#5a9040] transition-colors"
|
||||
>
|
||||
Cerrar sesión
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<Link
|
||||
href="/auth/login"
|
||||
className="text-sm font-medium text-[#70ad47] hover:text-[#5a9040] transition-colors"
|
||||
>
|
||||
Iniciar sesión
|
||||
</Link>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user