import type { AvatarProps, MantineSize } from "@mantine/core"; import { Avatar } from "@mantine/core"; import { auth } from "@homarr/auth/next"; interface UserAvatarProps { size: MantineSize; } export const UserAvatar = async ({ size }: UserAvatarProps) => { const currentSession = await auth(); const commonProps = { size, color: "primaryColor", } satisfies Partial; if (!currentSession?.user) return ; if (currentSession.user.image) // eslint-disable-next-line @typescript-eslint/no-non-null-assertion return ; return {currentSession.user.name?.substring(0, 2).toUpperCase()}; };