feat(36-02): add conditional Admin link to UserMenu for admin users
This commit is contained in:
@@ -45,6 +45,20 @@ export function UserMenu() {
|
|||||||
</button>
|
</button>
|
||||||
{open && (
|
{open && (
|
||||||
<div className="absolute right-0 mt-1 w-40 bg-white rounded-lg shadow-lg border border-gray-200 py-1 z-50">
|
<div className="absolute right-0 mt-1 w-40 bg-white rounded-lg shadow-lg border border-gray-200 py-1 z-50">
|
||||||
|
{/* Admin link — only visible to admin users */}
|
||||||
|
{auth?.user?.isAdmin && (
|
||||||
|
<>
|
||||||
|
<Link
|
||||||
|
to="/admin"
|
||||||
|
onClick={() => setOpen(false)}
|
||||||
|
className="flex items-center gap-2 px-3 py-2 text-sm text-gray-700 hover:bg-gray-50 transition-colors"
|
||||||
|
>
|
||||||
|
<LucideIcon name="shield" size={16} className="text-gray-400" />
|
||||||
|
Admin
|
||||||
|
</Link>
|
||||||
|
<div className="border-t border-gray-100 my-1" />
|
||||||
|
</>
|
||||||
|
)}
|
||||||
<Link
|
<Link
|
||||||
to="/profile"
|
to="/profile"
|
||||||
onClick={() => setOpen(false)}
|
onClick={() => setOpen(false)}
|
||||||
|
|||||||
Reference in New Issue
Block a user