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