"use client";
import Image from "../embed-shims/next-image";
import { getProxiedImageUrl } from "../utils/image-proxy-stub";
interface Props {
name: string;
email: string;
avatarUrl?: string | null;
/** Optional subtitle text (e.g., relative time) to replace email line */
subtitle?: string | null;
/** Authentication provider names (e.g. ["google", "microsoft"]) */
authProviders?: string[];
/** Show an outline Edit Profile button that routes to editHref */
showEditButton?: boolean;
/** Path to navigate when Edit button clicked (default "/profile/edit") */
editHref?: string;
/** Optional userId/profile passed through to EditProfileButton (for analytics) */
userId?: string;
profileData?: any;
/** Optional MSP preview info to render below email */
mspPreview?: {
name?: string | null;
seatCount?: number | null;
technicianCount?: number | null;
annualRevenue?: number | null;
logoUrl?: string | null;
} | null;
/** Compact mode (avatar + name row, used in comment headers) */
compact?: boolean;
/** Avatar size in px for compact mode (defaults 40) */
avatarSize?: number;
/** When true, replaces the static avatar with the ProfilePhotoUpload widget */
editablePhoto?: boolean;
/** Required when editablePhoto=true – receives new photo URL */
onPhotoChange?: (url: string | null) => void;
}
const getAuthProviderIcon = (provider: string) => {
const p = provider.toLowerCase();
switch (p) {
case "google":
return
{name} {mspPreview?.name && ( • {mspPreview.name} )}
0 ? subtitle : (email && email.trim().length > 0 ? email : '\u00A0')}> {subtitle && subtitle.trim().length > 0 ? subtitle : (email && email.trim().length > 0 ? email : '\u00A0')}
{name}
0) ? subtitle : (email && email.trim().length > 0 ? email : '\u00A0')}> {(subtitle && subtitle.trim().length > 0) ? subtitle : (email && email.trim().length > 0 ? email : '\u00A0')}
{mspPreview && (() => { const mspSegments = [ mspPreview.name ?? '—', typeof mspPreview.seatCount === 'number' ? `${formatNumber(mspPreview.seatCount)} Seats` : null, typeof mspPreview.technicianCount === 'number' ? `${formatNumber(mspPreview.technicianCount)} Technicians` : null, typeof mspPreview.annualRevenue === 'number' ? `$${formatNumber(mspPreview.annualRevenue)}` : null, ].filter(Boolean) as string[]; const mspTitle = mspSegments.join(' • '); return ({/* Build string with separators */} {mspSegments .flatMap((txt, idx) => (idx === 0 ? [txt] : [' • ', txt])) .map((seg, idx) => ( {seg} ))}
); })()}