mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
feat: add avatar to user in frontend (#1108)
This commit is contained in:
17
web/src/components/UserAvatar.tsx
Normal file
17
web/src/components/UserAvatar.tsx
Normal file
@ -0,0 +1,17 @@
|
||||
import { MEMOS_LOGO_URL } from "../helpers/consts";
|
||||
|
||||
interface Props {
|
||||
avatarUrl?: string;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
const UserAvatar = (props: Props) => {
|
||||
const { avatarUrl, className } = props;
|
||||
return (
|
||||
<div className={`${className ?? ""} w-8 h-8 rounded-full bg-gray-100 dark:bg-zinc-800`}>
|
||||
<img className="w-full h-full" src={avatarUrl || MEMOS_LOGO_URL} alt="" />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default UserAvatar;
|
Reference in New Issue
Block a user