/* eslint-disable @next/next/no-img-element */ type ProfileHeaderProps = { displayName: string; username: string; bio: string | null; avatarUrl: string | null; }; export function ProfileHeader({ displayName, username, bio, avatarUrl }: ProfileHeaderProps) { const words = displayName.trim().split(/\s+/).filter(Boolean); const initials = words.length >= 2 ? `${words[0]?.[0] ?? ""}${words[1]?.[0] ?? ""}`.toUpperCase() : (words[0]?.slice(0, 2) ?? username.slice(0, 2)).toUpperCase(); return (
{avatarUrl ? ( {`${displayName} ) : (
{initials}
)}

{displayName}

@{username}

{bio ?

{bio}

: null}
); }