'use client' import { Avatar, AvatarFallback, AvatarImage } from '@thedaviddias/design-system/avatar' import { Badge } from '@thedaviddias/design-system/badge' import { Button } from '@thedaviddias/design-system/button' import { Briefcase, Calendar, Edit, Eye, EyeOff, FileText, Github, Globe } from 'lucide-react' import Link from 'next/link' import { useState } from 'react' import { getMemberBadgeSync } from '@/lib/member-client-utils' import { escapeHtml } from '@/lib/security-utils-helpers' import { EditProfileModal } from './edit-profile-modal' interface ProfileHeaderProps { profileUser: { id?: string firstName?: string | null lastName?: string | null username?: string | null imageUrl?: string | null createdAt: string | number } displayName: string username?: string | null githubUsername?: string | null bio?: string | null work?: string | null website?: string | null joinDate: string isOwnProfile: boolean hasContributions?: boolean isProfilePrivate?: boolean isProfileIncomplete?: boolean } /** * Header component displaying user profile information * @param props - Component props */ export function ProfileHeader({ profileUser, displayName, username, githubUsername, bio, work, website, joinDate, isOwnProfile, hasContributions, isProfilePrivate, isProfileIncomplete }: ProfileHeaderProps) { const [showEditModal, setShowEditModal] = useState(false) const badge = getMemberBadgeSync(hasContributions) return ( <>
{profileUser.imageUrl ? ( ) : ( {displayName.charAt(0).toUpperCase()} )}

{displayName}

{username && ( <>

@{username}

{badge.label} {isOwnProfile && ( {isProfileIncomplete ? ( <> Hidden (Incomplete) ) : isProfilePrivate ? ( <> Private ) : ( <> Public )} )} {githubUsername && ( @{githubUsername} )} )} {!username && ( <> {badge.label} {isOwnProfile && ( {isProfileIncomplete ? ( <> Hidden (Incomplete) ) : isProfilePrivate ? ( <> Private ) : ( <> Public )} )} )}
{bio &&

{escapeHtml(bio)}

}
Joined {joinDate}
{work && (
{escapeHtml(work)}
)} {website && ( {website.replace(/^https?:\/\//, '').replace(/\/$/, '')} )}
{isOwnProfile && (
)}
{isOwnProfile && } ) }