'use strict';

var React = require('react');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var React__default = /*#__PURE__*/_interopDefaultLegacy(React);

const UserProfilePicture = ({ customContainerClass, customImageClass, user, alt, children }) => {
  var _a, _b, _c, _d;
  const baseColor = "bg-indigo-500";
  const src = (user == null ? void 0 : user.image) || (user == null ? void 0 : user.profileImage);
  const letterToDisplay = ((_a = user == null ? void 0 : user.displayName) == null ? void 0 : _a.substring(0, 1)) || ((_b = user == null ? void 0 : user.profileId) == null ? void 0 : _b.substring(0, 1)) || ((_c = user == null ? void 0 : user.name) == null ? void 0 : _c.substring(0, 1)) || ((_d = user == null ? void 0 : user.email) == null ? void 0 : _d.substring(0, 1)) || "#";
  if (!src) {
    return /* @__PURE__ */ React__default["default"].createElement(
      "div",
      {
        className: `rounded-full flex items-center justify-center font-bold uppercase select-none text-white text-2xl ${customContainerClass} ${baseColor}`
      },
      letterToDisplay,
      children
    );
  }
  return /* @__PURE__ */ React__default["default"].createElement("div", { className: `relative select-none ${customContainerClass}` }, /* @__PURE__ */ React__default["default"].createElement(
    "img",
    {
      className: `rounded-full ${customImageClass}`,
      alt: alt || "user",
      src,
      referrerPolicy: "no-referrer"
    }
  ), children);
};

exports.UserProfilePicture = UserProfilePicture;
//# sourceMappingURL=UserProfilePicture-d69fe4f0.js.map
