Add a real, visible patient-profile button
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { useRouter } from "next/navigation";
|
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 type { AuthUser } from "@duoc-thu/shared-types";
|
||||||
import { logout, me } from "@duoc-thu/api-client";
|
import { logout, me } from "@duoc-thu/api-client";
|
||||||
|
|
||||||
@@ -37,11 +37,10 @@ export function AccountMenu() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
<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">
|
<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" />
|
<UserRound className="h-3.5 w-3.5" />
|
||||||
<Link href="/profile" className="hover:underline" title="Hồ sơ bệnh nhân">
|
<span>{user.username}</span>
|
||||||
{user.username}
|
|
||||||
</Link>
|
|
||||||
<button
|
<button
|
||||||
aria-label="Đăng xuất"
|
aria-label="Đăng xuất"
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
@@ -54,5 +53,17 @@ export function AccountMenu() {
|
|||||||
<LogOut className="h-3.5 w-3.5" />
|
<LogOut className="h-3.5 w-3.5" />
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</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"
|
||||||
|
>
|
||||||
|
<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