import{makeStyles as t,Typography as e}from"@material-ui/core";import a from"moment";import{isNativeDetected as r}from"../../../utils/mobileDetect.js";import{formatMentionText as o}from"../../UserMention/utils/index.js";import i from"../../Attachment/index.js";import{convertValue as n,getUnitDisplay as m}from"../../../utils/convert.js";import{jsxs as l,jsx as c}from"react/jsx-runtime";var d=t((function(t){return{text:{color:t.palette.primary.text6},value:{color:"#fff"},attachment:{paddingTop:10,width:300},infoField:{color:t.palette.primary.text6,"& span":{color:"#fff"}}}})),s=function(t){var s=t.feedItem,p=s.type,f=s.context[p],h=f.body,u=f.attachment,x=void 0===u?{}:u,g=f.data,v=g.timestamp,y=g.holeDepth,N=s.mentioned_users,j=d(),D=n(+y,"length","ft");return l("div",{className:j.wrapper,children:[h&&c(e,{"data-testid":"".concat("PCCommentFeedItem","_message"),variant:"body1",gutterBottom:!0,children:o(h,N,r)}),v&&l(e,{className:j.infoField,children:["Time: ",c("span",{children:a.unix(v).format("MM.DD.YYYY, HH:mm")})]}),(y||0===y)&&l(e,{className:j.infoField,children:["Hole Depth:"," ",c("span",{children:"".concat(Math.round(D).toLocaleString()," ").concat(m("length"))})]}),x&&(x.signed_url||x.url||x.name)&&c("div",{className:j.attachment,children:c(i,{small:!0,attachmentUrl:x.signed_url||x.url,fileName:x.name,displayName:x.name})})]})};export{s as default};
