import type { AvatarProps } from "@mantine/core"; import { Avatar } from "@mantine/core"; export interface UserProps { name: string | null; image: string | null; } interface UserAvatarProps { user: UserProps | null; size: AvatarProps["size"]; } export const UserAvatar = ({ user, size }: UserAvatarProps) => { const commonProps = { size, color: "primaryColor", } satisfies Partial; if (!user?.name) return ; if (user.image) { return ; } return {user.name.substring(0, 2).toUpperCase()}; };