Update index.tsx
Browse files
src/components/organisms/Sidebar/index.tsx
CHANGED
|
@@ -72,6 +72,14 @@ export function Sidebar() {
|
|
| 72 |
// State reset is handled by the redirect/refresh
|
| 73 |
};
|
| 74 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 75 |
return (
|
| 76 |
<aside
|
| 77 |
className={cn(
|
|
@@ -137,9 +145,7 @@ export function Sidebar() {
|
|
| 137 |
isCollapsed ? "justify-center" : "px-3"
|
| 138 |
)}>
|
| 139 |
<Avatar className="h-8 w-8 border">
|
| 140 |
-
<AvatarFallback className="bg-primary/5 text-primary">
|
| 141 |
-
<UserIcon size={14} />
|
| 142 |
-
</AvatarFallback>
|
| 143 |
</Avatar>
|
| 144 |
{!isCollapsed && (
|
| 145 |
<div className="flex flex-col min-w-0 flex-1">
|
|
|
|
| 72 |
// State reset is handled by the redirect/refresh
|
| 73 |
};
|
| 74 |
|
| 75 |
+
// Get user initials for avatar fallback
|
| 76 |
+
const getUserInitials = () => {
|
| 77 |
+
if (userData?.sub) {
|
| 78 |
+
return userData.sub.slice(0, 2).toUpperCase();
|
| 79 |
+
}
|
| 80 |
+
return "RA";
|
| 81 |
+
};
|
| 82 |
+
|
| 83 |
return (
|
| 84 |
<aside
|
| 85 |
className={cn(
|
|
|
|
| 145 |
isCollapsed ? "justify-center" : "px-3"
|
| 146 |
)}>
|
| 147 |
<Avatar className="h-8 w-8 border">
|
| 148 |
+
<AvatarFallback alt={getUserInitials()} className="bg-primary/5 text-primary text-xs font-semibold" />
|
|
|
|
|
|
|
| 149 |
</Avatar>
|
| 150 |
{!isCollapsed && (
|
| 151 |
<div className="flex flex-col min-w-0 flex-1">
|