"use strict";var e=require("prop-types"),t=require("@material-ui/core/styles"),r=require("@material-ui/core"),s=require("@material-ui/core/colors/grey"),a=require("./styles.css.js"),o=require("../../utils/mobileDetect.js"),i=require("../Avatar/index.js"),n=require("../UserCardPopover.js"),c=require("react/jsx-runtime");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=l(e),d=function(e){return e?"".concat(e.first_name," ").concat(e.last_name):""},p=function(e){var t=e.users,r=e.noReactionsText,s=t.length;if(!s)return r;var a="";s>19&&(a="\nand ".concat(s-19," more..."));var o=t.slice(0,19).join("\n");return"".concat(o).concat(a)},m=function(e){var t=e.likesCount,s=e.usersWhoLike,o=e.commentsCount,l=e.usersWhoCommented,u=e.onCommentsClick,m=e.currentUser,f=e.activeUsersList,h=e.classes,y=e.isNative,v=e.small;return c.jsxs(c.Fragment,{children:[!!t&&c.jsx(r.Tooltip,{title:c.jsx(p,{users:s,noReactionsText:"Nobody likes this yet..."}),enterTouchDelay:0,classes:{popper:h.tooltip},placement:"top",children:c.jsxs(r.Typography,{"data-testid":"".concat("FeedPo","_likesCounter_").concat(t),className:h.reactionTypographyRoot,variant:"caption",children:["Likes ",t]})}),!!o&&c.jsx("span",{onClick:u,children:c.jsx(r.Tooltip,{title:c.jsx(p,{users:l,noReactionsText:"Nobody commented this yet..."}),enterTouchDelay:0,classes:{popper:h.tooltip},placement:"top",children:c.jsxs(r.Typography,{"data-testid":"".concat("FeedPo","_commentsCounter_").concat(o),className:h.reactionTypographyRoot,variant:"caption",children:["Comments ",o]})})}),c.jsx("div",{"data-testid":"".concat("FeedPo","_activeUsersCounter_").concat(f&&f.length),className:a.cCommentsInfoActiveUsersList,children:f.map((function(e){return y?c.jsx(i.AvatarComponent,{displayName:d(e),imgSrc:e.profile_photo,className:h.avatarInList,size:v?24:32},e.id):c.jsx(n,{user:e,currentUser:m,children:c.jsx(i.AvatarComponent,{displayName:d(e),imgSrc:e.profile_photo,size:v?24:32,className:h.avatarInList})},e.id)}))})]})},f={reactionTypographyRoot:{color:l(s).default[400],margin:"0 8px",cursor:"pointer","&:hover":{textDecoration:"underline",textUnderlineOffset:"4px",color:"#fff"}},avatarInList:{marginRight:3,borderWidth:1},tooltip:{whiteSpace:"pre-line"}};m.propTypes={likesCount:u.default.number,usersWhoLike:u.default.arrayOf(u.default.shape({})),commentsCount:u.default.number,usersWhoCommented:u.default.arrayOf(u.default.string).isRequired,onCommentsClick:u.default.func,activeUsersList:u.default.arrayOf(u.default.shape({})).isRequired,classes:u.default.shape({}).isRequired,isNative:u.default.bool,small:u.default.bool,currentUser:u.default.shape({})},m.defaultProps={likesCount:0,usersWhoLike:[],commentsCount:0,onCommentsClick:function(){},small:!1,isNative:o.isNativeDetected,currentUser:{}};var h=t.withStyles(f)(m);module.exports=h;
//# sourceMappingURL=index.js.map
