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