import { cn } from "@/lib/utils" export default function Avatar({ name, avatarUrl, className, }: { name: string avatarUrl?: string | null className?: string }) { // Generate initials from name if no avatarUrl is provided const initials = name ? name .split(" ") .slice(0, 2) .map((letter) => letter[0].toUpperCase()) .join("") : "?" return (
{avatarUrl ? ( {name ) : ( initials )}
) }