"use strict";var e=require("@babel/runtime/helpers/defineProperty"),r=require("classnames"),t=require("@material-ui/core"),i=require("./AvatarIcon.js"),s=require("./LessonsLearnedLeafIcon.js"),n=require("../../../utils/mobileDetect.js"),o=require("../../../utils/feed.js"),a=require("../../../constants/feed.js"),c=require("../../../constants/alerts.js"),d=require("react/jsx-runtime");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=l(e),m=l(r),f=t.makeStyles({icon:{width:32,height:32,backgroundColor:"grey",borderRadius:23,position:"absolute",top:18,left:-16,padding:6},iconWrapper:{display:"inline-block",height:20,width:20,overflow:"hidden"},iconImg:{height:20,width:20},iconNative:{left:"auto"}}),E=function(e){var r,t=e.feedItem,i=e.feedItemType,s=e.icon,o=f(),l=a.FEED_ITEM_TYPES_BY_KEY[i]?a.FEED_ITEM_TYPES_BY_KEY[i].label:"Other";if(i===a.FEED_ITEM_TYPES_BY_KEY.alert.type){var E,p,_=null===(E=t.context)||void 0===E||null===(p=E.alert)||void 0===p?void 0:p.level;r={backgroundColor:c.ALERT_LEVEL_COLOR[_]}}return d.jsx("div",{className:m.default(o.icon,u.default({},o.iconNative,n.isNativeDetected)),style:r,children:d.jsx("div",{className:o.iconWrapper,children:d.jsx("img",{src:s,alt:"".concat(l," icon"),className:o.iconImg})})})};module.exports=function(e){var r=e.feedItem,t=e.displayName,n=e.isRecommended,c=e.currentUser,l=r.type,u=o.getIconForFeedItemType(l),m=l===a.FEED_ITEM_TYPES.LESSONS_LEARNED;return u===o.AVATAR_ICON||m?d.jsxs(d.Fragment,{children:[d.jsx(i,{displayName:t,feedItem:r,isRecommended:n,currentUser:c}),m&&d.jsx(s,{offsetX:-22,offsetY:32})]}):d.jsx(E,{icon:u,feedItem:r,feedItemType:l})};
//# sourceMappingURL=Icon.js.map
