import{z as g,r as w,af as l,ag as u,j as r,aA as y}from"./entry.client-CV0PzNS2.js";const a={base:"overflow-hidden flex flex-row items-center justify-center tracking-wide",rounded:{...y},color:{primary:"text-overAccent bg-accent-500",secondary:"text-overSecondaryAccent bg-secondaryAccent-500",tertiary:"text-strong bg-gray-100",white:"bg-white text-strong text-black"},size:{none:"",xs:"w-6 h-6 text-sm",sm:"w-8 h-8 text-md",md:"w-12 h-12 text-2xl",lg:"w-24 h-24 text-4xl",xl:"w-28 h-28 text-5xl",xxl:"w-32 h-32 text-6xl"}},v=x=>{const{user:e,size:d="md",className:m="",color:t="primary",fontSize:o,customSize:s,borderRadius:f="full",imgClassName:h}=x,n=g(a.base,a.color[t],a.rounded[f],a.size[d],h),c=w.useMemo(()=>({width:`${s}`,height:`${s}`,fontSize:`${o}`,backgroundColor:l(t)?t:"",color:l(t)?u.contrast(t,"white")>2?"#ffffff":"#000000":""}),[t,s,o]),i=[e&&e.firstname&&e.firstname[0].toUpperCase()||"",e&&e.lastname&&e.lastname[0].toUpperCase()||""];return r.jsx("div",{className:`overflow-hidden ${m}`,children:e!=null&&e.avatar?r.jsx("img",{alt:i.join(""),style:c,className:n,src:e.avatar}):r.jsx("div",{className:n,style:c,children:i})})};export{v as Avatar};