import{makeStyles as t,Typography as e}from"@material-ui/core";import i from"moment";import{convertValue as a,getUnitDisplay as n}from"../../../utils/index.js";import{isNativeDetected as o}from"../../../utils/mobileDetect.js";import{formatMentionText as r}from"../../UserMention/utils/index.js";import l from"../../Attachment/index.js";import{jsxs as m,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="DvDCommentFeedItem";var p=function(t){var p,h=t.feedItem,f=h.context.dvd_comment,u=f.body,v=f.attachment,D=void 0===v?{}:v,N=f.data,x=N.timestamp,g=N.bitDepth,F=N.holeDepth,_=N.cost,b=h.mentioned_users,j=d(),y=a(+g,"length","ft"),Y=a(+F,"length","ft"),B=n("length"),H=(null==D?void 0:D.signed_url)||(null==D?void 0:D.url),M=(null==D?void 0:D.file_name)||(null==D?void 0:D.name);return m("div",{className:j.wrapper,children:[u&&c(e,{"data-testid":"".concat(s,"_message"),variant:"body1",gutterBottom:!0,children:r(u,b,o)}),x&&m(e,{className:j.infoField,children:["Time:"," ",c("span",{"data-testid":"".concat(s,"_time"),children:i.unix(x).format("MM.DD.YYYY, HH:mm")})]}),Number.isFinite(Y)&&m(e,{className:j.infoField,children:["Hole Depth: ",c("span",{"data-testid":"".concat(s,"_holeDepth"),children:"".concat(Y," ").concat(B)})]}),Number.isFinite(y)&&m(e,{className:j.infoField,children:["Bit Depth: ",c("span",{"data-testid":"".concat(s,"_bitDepth"),children:"".concat(y," ").concat(B)})]}),_&&Number.isFinite(_)&&m(e,{className:j.infoField,children:["Cost: ",m("span",{"data-testid":"".concat(s,"_cost"),children:[(p=_,p.toString().replace(/\B(?=(\d{3})+(?!\d))/g," "))," $"]})]}),D&&H&&c("div",{className:j.attachment,children:c(l,{small:!0,attachmentUrl:H,fileName:M,displayName:M})})]})};export{p as default};
//# sourceMappingURL=DvDCommentFeedItem.js.map
