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