"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"),n=require("../../../utils/index.js"),s=require("../../Typography.js"),l=require("../../Attachment/index.js"),u=require("../../UserMention/utils/index.js"),d=require("../../CollapsibleContent.js"),o=require("../../../constants/feed.js"),c=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",b=i.makeStyles((function(e){return{message:{lineHeight:"20px"},container:{marginBottom:4,lineHeight:"20px"},label:{color:e.palette.primary.text6}}})),g=function(e){var t=e.feedItem,a=t.context[o.FEED_ITEM_TYPES.TRACES_MEMO],m=a.body,p=a.attachment,f=void 0===p?{}:p,g=a.bitDepth,j=a.holeDepth,q=a.timestamp,T=t.mentioned_users,_=b(),y=n.getUnitDisplay("length"),E=n.convertValue(+g,"length","ft"),D=n.convertValue(+j,"length","ft"),R=(null==f?void 0:f.signed_url)||(null==f?void 0:f.url),v=(null==f?void 0:f.file_name)||(null==f?void 0:f.name);return c.jsxs(i.Box,{whiteSpace:"pre-wrap",children:[m&&c.jsx(d,{children:c.jsx(s.Regular14,{className:_.message,"data-testid":"".concat(x,"_message"),variant:"body1",children:u.formatMentionText(m,T,r.isNativeDetected)})}),c.jsxs(i.Box,{mt:1,mb:1,children:[c.jsxs(s.Regular14,{"data-testid":"".concat(x,"_Time"),className:_.container,children:[c.jsx("span",{className:_.label,children:"Time: "}),h.default.unix(q).format(o.FEED_ITEM_TIME_FORMAT)]}),Number.isFinite(j)&&c.jsxs(s.Regular14,{"data-testid":"".concat(x,"_HoleDepth"),className:_.container,children:[c.jsx("span",{className:_.label,children:"Hole Depth: "}),"".concat(D," ").concat(y)]}),Number.isFinite(g)&&c.jsxs(s.Regular14,{"data-testid":"".concat(x,"_BitDepth"),className:_.container,children:[c.jsx("span",{className:_.label,children:"Bit Depth: "}),"".concat(E," ").concat(y)]})]}),f&&R&&c.jsx(l,{attachmentUrl:R,fileName:v,attachmentSize:f.size,size:"medium"})]})};g.propTypes={feedItem:f.default.shape({context:f.default.shape(p.default({},o.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=g;
//# sourceMappingURL=TracesMemoFeedItem.js.map
