11 lines
392 B
TypeScript
11 lines
392 B
TypeScript
export function Avatar({ user, size = 34 }: { user: { firstName: string; color: string }; size?: number }) {
|
|
return (
|
|
<span
|
|
className="inline-grid shrink-0 place-items-center rounded-full font-bold text-white"
|
|
style={{ backgroundColor: user.color, width: size, height: size, fontSize: size * 0.38 }}
|
|
>
|
|
{user.firstName.slice(0, 1).toUpperCase()}
|
|
</span>
|
|
);
|
|
}
|