import e from"@babel/runtime/helpers/defineProperty";import t from"prop-types";import i from"moment";import{makeStyles as r,Box as a}from"@material-ui/core";import{isNativeDetected as n}from"../../../utils/mobileDetect.js";import{getUnitDisplay as s,convertValue as m}from"../../../utils/index.js";import{Regular14 as o}from"../../Typography.js";import l from"../../Attachment/index.js";import{formatMentionText as c}from"../../UserMention/utils/index.js";import p from"../../CollapsibleContent.js";import{FEED_ITEM_TYPES as d,FEED_ITEM_TIME_FORMAT as h}from"../../../constants/feed.js";import{jsxs as u,jsx as f}from"react/jsx-runtime";var b="TracesMemoFeedItem",g=r((function(e){return{message:{lineHeight:"20px"},container:{marginBottom:4,lineHeight:"20px"},label:{color:e.palette.primary.text6}}})),y=function(e){var t=e.feedItem,r=t.context[d.TRACES_MEMO],y=r.body,x=r.attachment,_=void 0===x?{}:x,N=r.bitDepth,T=r.holeDepth,D=r.timestamp,R=t.mentioned_users,j=g(),q=s("length"),M=m(+N,"length","ft"),O=m(+T,"length","ft");return u(a,{whiteSpace:"pre-wrap",children:[y&&f(p,{children:f(o,{className:j.message,"data-testid":"".concat(b,"_message"),variant:"body1",children:c(y,R,n)})}),u(a,{mt:1,mb:1,children:[u(o,{"data-testid":"".concat(b,"_Time"),className:j.container,children:[f("span",{className:j.label,children:"Time: "}),i.unix(D).format(h)]}),Number.isFinite(T)&&u(o,{"data-testid":"".concat(b,"_HoleDepth"),className:j.container,children:[f("span",{className:j.label,children:"Hole Depth: "}),"".concat(O," ").concat(q)]}),Number.isFinite(N)&&u(o,{"data-testid":"".concat(b,"_BitDepth"),className:j.container,children:[f("span",{className:j.label,children:"Bit Depth: "}),"".concat(M," ").concat(q)]})]}),_&&(_.signed_url||_.url)&&f(l,{attachmentUrl:_.signed_url||_.url,fileName:_.file_name,attachmentSize:_.size,size:"medium"})]})};y.propTypes={feedItem:t.shape({context:t.shape(e({},d.TRACES_MEMO,t.shape({body:t.string.isRequired,attachment:t.shape({url:t.string,size:t.number}),bitDepth:t.oneOfType([t.string,t.number]).isRequired,holeDepth:t.oneOfType([t.string,t.number]).isRequired,timestamp:t.oneOfType([t.string,t.number]).isRequired}).isRequired)).isRequired,mentioned_users:t.arrayOf(t.shape({}))}).isRequired};export{y as default};
