first commit
This commit is contained in:
commit
cce9a8c9ba
73 changed files with 8665 additions and 0 deletions
23
frontend/src/components/SenderAvatar.jsx
Normal file
23
frontend/src/components/SenderAvatar.jsx
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
import { senderAvatar } from "../utils/senderAvatar";
|
||||
|
||||
export default function SenderAvatar({ email, className = "" }) {
|
||||
const { name, initials, color, imageUrl } = senderAvatar(email);
|
||||
|
||||
if (imageUrl) {
|
||||
return (
|
||||
<span className={`sender-avatar${className ? ` ${className}` : ""}`}>
|
||||
<img src={imageUrl} alt="" aria-hidden="true" />
|
||||
</span>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<span
|
||||
className={`sender-avatar${className ? ` ${className}` : ""}`}
|
||||
style={{ backgroundColor: color }}
|
||||
aria-hidden="true"
|
||||
>
|
||||
{initials}
|
||||
</span>
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue