Skip to content

armgit / ODS

Public Imported from GitHub
0

ODS V3 Pre-Release: Public testing and refinement ahead of the official V3 launch. Turn your PC, Mac, or Linux box into a private AI server.

569 B
Raw Blame
import {UserRound} from 'lucide-react'
import '../profile.css'

export default function UserAvatar({profile, className=''}) {
  const name = profile.name || 'You'
  const initials = profile.name.trim().split(/\s+/).filter(Boolean).slice(0,2).map(part => Array.from(part)[0]).join('').toUpperCase()
  return <span className={`user-avatar ${className}`} title={name}>
    {profile.photo ? <img src={profile.photo} alt={`${name} profile photo`}/> : <span role="img" aria-label={`${name} avatar`}>{initials || <UserRound size={16} aria-hidden="true"/>}</span>}
  </span>
}