import{makeStyles as t}from"@material-ui/core";import e from"moment";import i from"@material-ui/icons/Warning";import{isNativeDetected as o}from"../../../utils/mobileDetect.js";import{formatMentionText as n}from"../../UserMention/utils/index.js";import a from"../../Attachment/index.js";import{convertValue as r,getUnitDisplay as l}from"../../../utils/convert.js";import{Regular14 as m,Regular12 as c}from"../../Typography.js";import{jsxs as s,jsx as d}from"react/jsx-runtime";var p=t((function(t){return{text:{color:t.palette.primary.text6},value:{color:"#fff"},attachment:{paddingTop:10,width:300},warningContainer:{display:"flex",alignItems:"center",gap:8,marginTop:16},warningIcon:{fill:t.palette.warning.main},infoField:{color:t.palette.primary.text6,"& span":{color:"#fff"}}}})),f=function(t){var f=t.feedItem,h=f.point,u=(h=void 0===h?{}:h).showNoVisiblePointWarning,g=f.context.hookload_broomstick_comment,v=g.body,N=g.attachment,y=void 0===N?{}:N,x=g.data,b=x.timestamp,w=x.measuredDepth,F=x.activityLabel,j=x.hookload,k=f.mentioned_users,M=p(),_=r(+w,"length","ft"),B=r(+j,"force","klbf"),D=(null==y?void 0:y.signed_url)||(null==y?void 0:y.url),I=(null==y?void 0:y.file_name)||(null==y?void 0:y.name);return s("div",{className:M.wrapper,children:[v&&d(m,{"data-testid":"".concat("HookloadCommentFeedItem","_message"),variant:"body1",gutterBottom:!0,children:n(v,k,o)}),Number.isFinite(w)&&s(m,{className:M.infoField,gutterBottom:!0,children:["Measured Depth:"," ",d("span",{children:"".concat(Math.round(_).toLocaleString()," ").concat(l("length"))})]}),j&&s(m,{className:M.infoField,gutterBottom:!0,children:["Hookload:"," ",d("span",{children:"".concat(Math.round(B).toLocaleString()," ").concat(l("force"))})]}),F&&s(m,{className:M.infoField,gutterBottom:!0,children:["Activity: ",d("span",{children:F})]}),b&&s(m,{className:M.infoField,gutterBottom:!0,children:["Time: ",d("span",{children:e.unix(b).format("MM/DD/YY HH:mm")})]}),u&&s("div",{className:M.warningContainer,children:[d(i,{className:M.warningIcon}),d(c,{children:"This activity is disabled in the application settings or not in range"})]}),y&&(D||I)&&d("div",{className:M.attachment,children:d(a,{small:!0,attachmentUrl:D,fileName:I,displayName:I})})]})};export{f as default};
//# sourceMappingURL=HookloadCommentFeedItem.js.map
