From 66668d85d603c5841d755a6023aa1925559fc6d4 Mon Sep 17 00:00:00 2001
From: 苏向夜 <fu050409@163.com>
Date: Wed, 25 Feb 2026 01:32:51 +0800
Subject: chore(workspace): replace legacy codes

---
 packages/ui/src/components/user-avatar.tsx | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
 create mode 100644 packages/ui/src/components/user-avatar.tsx

(limited to 'packages/ui/src/components/user-avatar.tsx')

diff --git a/packages/ui/src/components/user-avatar.tsx b/packages/ui/src/components/user-avatar.tsx
new file mode 100644
index 0000000..bbdb84c
--- /dev/null
+++ b/packages/ui/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<typeof Avatar>) {
+  const authStore = useAuthStore();
+
+  if (!authStore.account) {
+    return null;
+  }
+
+  return (
+    <Avatar {...props}>
+      <AvatarImage
+        src={`https://minotar.net/helm/${authStore.account.username}/100.png`}
+      />
+      <AvatarFallback>{authStore.account.username.slice(0, 2)}</AvatarFallback>
+      <AvatarBadge />
+    </Avatar>
+  );
+}
-- 
cgit v1.2.3-70-g09d2

