phanpy/src/components/avatar.jsx
Lim Chee Aun fa1769c3c2 New feature: Grouped notifications
- Grouped based on notification.type and notification.status.id
- Crossing fingers here
2022-12-14 22:46:50 +08:00

27 lines
437 B
JavaScript

import './avatar.css';
const SIZES = {
s: 16,
m: 20,
l: 24,
xl: 32,
xxl: 50,
};
export default ({ url, size, alt = '' }) => {
size = SIZES[size] || size || SIZES.m;
return (
<span
class="avatar"
style={{
width: size,
height: size,
}}
title={alt}
>
{!!url && (
<img src={url} width={size} height={size} alt={alt} loading="lazy" />
)}
</span>
);
};