From 93b33066eae0a67619932500f31a50498bb38ddc Mon Sep 17 00:00:00 2001 From: Kenan KARAER Date: Thu, 18 Dec 2025 22:56:12 +0300 Subject: [PATCH] Update UserNav to display user initials --- src/app/dashboard/layout.tsx | 2 +- src/components/user-nav.tsx | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/app/dashboard/layout.tsx b/src/app/dashboard/layout.tsx index 6f91e10..8a91a0a 100644 --- a/src/app/dashboard/layout.tsx +++ b/src/app/dashboard/layout.tsx @@ -41,7 +41,7 @@ export default async function DashboardLayout({
- +
diff --git a/src/components/user-nav.tsx b/src/components/user-nav.tsx index af0cc0a..3e84a1a 100644 --- a/src/components/user-nav.tsx +++ b/src/components/user-nav.tsx @@ -14,18 +14,28 @@ import { import { signOut } from "@/app/(auth)/actions" import { useRouter } from "next/navigation" -export function UserNav() { +interface UserNavProps { + user?: { + name: string | null + email: string | null + } +} + +export function UserNav({ user }: UserNavProps) { const router = useRouter() const handleSignOut = async () => { await signOut() } + const displayName = user?.name || user?.email?.split('@')[0] || 'K' + const initial = displayName.charAt(0).toUpperCase() + return ( -