Add a real, visible patient-profile button
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import Link from "next/link";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { LogIn, LogOut, UserRound } from "lucide-react";
|
||||
import { ClipboardList, LogIn, LogOut, UserRound } from "lucide-react";
|
||||
import type { AuthUser } from "@duoc-thu/shared-types";
|
||||
import { logout, me } from "@duoc-thu/api-client";
|
||||
|
||||
@@ -37,22 +37,33 @@ export function AccountMenu() {
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="flex items-center gap-1.5 rounded-full border border-border-subtle bg-surface px-3 py-1.5 text-xs font-semibold text-txt-secondary">
|
||||
<UserRound className="h-3.5 w-3.5" />
|
||||
<Link href="/profile" className="hover:underline" title="Hồ sơ bệnh nhân">
|
||||
{user.username}
|
||||
</Link>
|
||||
<button
|
||||
aria-label="Đăng xuất"
|
||||
onClick={async () => {
|
||||
await logout();
|
||||
setUser(null);
|
||||
router.refresh();
|
||||
}}
|
||||
className="ml-1 text-txt-muted hover:text-txt-primary"
|
||||
<div className="flex items-center gap-1.5">
|
||||
<div className="flex items-center gap-1.5 rounded-full border border-border-subtle bg-surface px-3 py-1.5 text-xs font-semibold text-txt-secondary">
|
||||
<UserRound className="h-3.5 w-3.5" />
|
||||
<span>{user.username}</span>
|
||||
<button
|
||||
aria-label="Đăng xuất"
|
||||
onClick={async () => {
|
||||
await logout();
|
||||
setUser(null);
|
||||
router.refresh();
|
||||
}}
|
||||
className="ml-1 text-txt-muted hover:text-txt-primary"
|
||||
>
|
||||
<LogOut className="h-3.5 w-3.5" />
|
||||
</button>
|
||||
</div>
|
||||
{/* A real, labeled button — not a tooltip hidden on plain text (that
|
||||
* shipped invisible: an owner testing the feature live couldn't find
|
||||
* it at all). Same destination as before, `/profile`. */}
|
||||
<Link
|
||||
href="/profile"
|
||||
title="Hồ sơ bệnh nhân"
|
||||
className="flex items-center gap-1.5 rounded-full border border-border-subtle bg-surface px-3 py-1.5 text-xs font-semibold text-txt-secondary hover:bg-surface-hover"
|
||||
>
|
||||
<LogOut className="h-3.5 w-3.5" />
|
||||
</button>
|
||||
<ClipboardList className="h-3.5 w-3.5" />
|
||||
<span>Hồ sơ bệnh nhân</span>
|
||||
</Link>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user