UNPKG

mui-spfx-controls

Version:
16 lines 645 B
/** * Generates a user profile image URL from SharePoint based on the provided email. * * @param {WebPartContext} context - The SharePoint WebPart context. * @param {string | undefined} email - The email address of the user. * @returns {string} - The URL of the user's profile image. */ export var generateImageUrl = function (context, email) { if (email !== undefined && email !== '') { return "".concat(context.pageContext.web.absoluteUrl, "/_layouts/15/userphoto.aspx?accountname=").concat(encodeURIComponent(email || ''), "&size=M"); } else { return ''; } }; //# sourceMappingURL=generateImageUrl.js.map