mui-spfx-controls
Version:
SPFx component library built with MUI
20 lines • 795 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.generateImageUrl = void 0;
/**
* 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.
*/
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 '';
}
};
exports.generateImageUrl = generateImageUrl;
//# sourceMappingURL=generateImageUrl.js.map