"use client"
import{j as n}from"./chunk-IODNXUBC.mjs";import{useState as s}from"react";import{sha256 as d}from"js-sha256";function o(e,{useFallback:r}={}){if(!e)return"https://api.dicebear.com/7.x/micah/svg";if(e.image)return e.image;let a=`https://api.dicebear.com/7.x/micah/svg?seed=${encodeURIComponent(e.id||"")}`,t=`https://api.dicebear.com/7.x/micah/png/${encodeURIComponent(`seed=${encodeURIComponent(e.id||"")}`)}`;return e.email?`https://www.gravatar.com/avatar/${d(e.email)}?d=${encodeURIComponent(t)}`:a}import{jsx as i}from"react/jsx-runtime";function p({user:e={},className:r}){if(!e)return i("div",{className:n("h-10 w-10 animate-pulse rounded-full border border-gray-300 bg-gray-100",r)});let[a,t]=s(o(e));return i("img",{alt:`Avatar for ${e.name||e.email}`,referrerPolicy:"no-referrer",src:a,className:n("h-10 w-10 rounded-full border border-gray-300",r),draggable:!1,onError:l=>{console.log(l)}})}function b({id:e,className:r}){return i("img",{src:`https://api.dicebear.com/9.x/shapes/svg?seed=${e}`,alt:"avatar",className:n("h-10 w-10 rounded-full",r),draggable:!1})}export{o as a,p as b,b as c};
