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