From b275a3668b140d9ce4663de646519d2dbd4297e7 Mon Sep 17 00:00:00 2001 From: 苏向夜 Date: Tue, 24 Feb 2026 22:41:36 +0800 Subject: refactor: rewrite login and settings pages --- packages/ui-new/src/components/user-avatar.tsx | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 packages/ui-new/src/components/user-avatar.tsx (limited to 'packages/ui-new/src/components/user-avatar.tsx') diff --git a/packages/ui-new/src/components/user-avatar.tsx b/packages/ui-new/src/components/user-avatar.tsx new file mode 100644 index 0000000..bbdb84c --- /dev/null +++ b/packages/ui-new/src/components/user-avatar.tsx @@ -0,0 +1,23 @@ +import { useAuthStore } from "@/models/auth"; +import { Avatar, AvatarBadge, AvatarFallback, AvatarImage } from "./ui/avatar"; + +export function UserAvatar({ + className, + ...props +}: React.ComponentProps) { + const authStore = useAuthStore(); + + if (!authStore.account) { + return null; + } + + return ( + + + {authStore.account.username.slice(0, 2)} + + + ); +} -- cgit v1.2.3-70-g09d2