memos/web/src/components/UserAvatar.tsx
Lincoln Nogueira 089e04bcfd
chore: use webp compression on logo (#2756)
- Logo size reduced from 310 KB to 36 KB.
- Point metadata image URL to local logo instead of remote
2024-01-14 22:21:03 +08:00

23 lines
552 B
TypeScript

import classNames from "classnames";
interface Props {
avatarUrl?: string;
className?: string;
}
const UserAvatar = (props: Props) => {
const { avatarUrl, className } = props;
return (
<div className={classNames(`w-8 h-8 overflow-clip rounded-full`, className)}>
<img
className="w-full h-auto rounded-full shadow min-w-full min-h-full object-cover dark:opacity-80"
src={avatarUrl || "/logo.webp"}
decoding="async"
loading="lazy"
alt=""
/>
</div>
);
};
export default UserAvatar;