UNPKG

@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.02 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const jsx_runtime_1 = require("react/jsx-runtime"); const reset_styles_1 = require("../constants/reset-styles"); const helpers_1 = require("../helpers"); 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 ?? (0, helpers_1.getUserAvatar)(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