diff --git a/apps/dokploy/components/layouts/user-nav.tsx b/apps/dokploy/components/layouts/user-nav.tsx
index ff48b62d9..e476a5f50 100644
--- a/apps/dokploy/components/layouts/user-nav.tsx
+++ b/apps/dokploy/components/layouts/user-nav.tsx
@@ -19,6 +19,7 @@ import {
} from "@/components/ui/select";
import { authClient } from "@/lib/auth-client";
import { Languages } from "@/lib/languages";
+import { getFallbackAvatarInitials } from "@/lib/utils";
import { api } from "@/utils/api";
import useLocale from "@/utils/hooks/use-locale";
import { ModeToggle } from "../ui/modeToggle";
@@ -46,7 +47,9 @@ export const UserNav = () => {
src={data?.user?.image || ""}
alt={data?.user?.image || ""}
/>
- CN
+
+ {getFallbackAvatarInitials(data?.user?.name)}
+
Account
diff --git a/apps/dokploy/lib/utils.ts b/apps/dokploy/lib/utils.ts
index b763e9ee9..f01faa4ec 100644
--- a/apps/dokploy/lib/utils.ts
+++ b/apps/dokploy/lib/utils.ts
@@ -27,3 +27,14 @@ export function formatTimestamp(timestamp: string | number) {
return "Fecha inválida";
}
}
+
+export function getFallbackAvatarInitials(
+ fullName: string | undefined,
+): string {
+ if (typeof fullName === "undefined" || fullName === "") return "CN";
+ const [name = "", surname = ""] = fullName.split(" ");
+ if (surname === "") {
+ return name.substring(0, 2).toUpperCase();
+ }
+ return (name.charAt(0) + surname.charAt(0)).toUpperCase();
+}