@replyke/ui-core-react-js
Version:
Replyke: Build interactive apps with social features like comments, votes, feeds, user lists, notifications, and more.
24 lines • 874 B
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
import { resetImg } from "../constants/reset-styles";
function UserAvatar({ user, size = 32, borderRadius, }) {
if (!user)
return null;
return (_jsx("div", { style: {
overflow: "hidden",
width: size,
height: size,
borderRadius: borderRadius || size,
borderWidth: 1,
borderColor: "#E6E6E6",
display: "inline-block",
flexShrink: 0,
}, children: _jsx("img", { src: user.avatar ??
`https://api.dicebear.com/9.x/thumbs/svg?seed=${user.id}`, alt: user.name || user.id, style: {
...resetImg,
width: "100%",
height: "100%",
objectFit: "cover",
} }) }));
}
export default UserAvatar;
//# sourceMappingURL=UserAvatar.js.map