import e from"@babel/runtime/helpers/defineProperty";import t from"prop-types";import{makeStyles as r,Box as o,Typography as n}from"@material-ui/core";import{isNativeDetected as i}from"../../../utils/mobileDetect.js";import l from"../../Attachment/index.js";import{formatMentionText as c}from"../../UserMention/utils/index.js";import a from"../../CollapsibleContent.js";import{jsxs as m,Fragment as d,jsx as s}from"react/jsx-runtime";function p(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function u(t){for(var r=1;r<arguments.length;r++){var o=null!=arguments[r]?arguments[r]:{};r%2?p(Object(o),!0).forEach((function(r){e(t,r,o[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):p(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}var h=r({wrapper:{whiteSpace:"pre-wrap"}}),f=function(e){var t=e.feedItem,r=t.context.geosteering_comments,p=r.body,f=r.attachment,b=void 0===f?{}:f,y=r.data,g=y.targetStructure,O=y.recommendedWindow,j=y.isRecommendation,v=y.axis,x=t.mentioned_users,w=h(),D={attachmentSize:null==b?void 0:b.size,size:"medium"};return null!=b&&b.file_name?D.fileName=null==b?void 0:b.file_name:D.attachmentUrl=null==b?void 0:b.url,m("div",{className:w.wrapper,children:[j&&m(d,{children:[m(o,{marginBottom:1,children:[s(n,{color:"textSecondary",children:"Target Structure"}),s(n,{children:g||"N/A"})]}),m(o,{marginBottom:1,children:[s(n,{color:"textSecondary",children:"Recommended Window"}),s(n,{children:O||"N/A"})]})]}),m(o,{marginBottom:2,children:[s(n,{color:"textSecondary",children:"Comment"}),p&&s(a,{children:s(n,{"data-testid":"".concat("GeosteeringFeedItem","_message"),variant:"body1",gutterBottom:!0,children:c(p,x,i)})}),((null==b?void 0:b.file_name)||(null==b?void 0:b.url))&&s(l,u({},D))]}),m(o,{display:"flex",children:[s(n,{color:"textSecondary",children:"Hole Depth: "}),s(n,{children:null!=v&&v.holeDepth?"".concat(Math.floor(null==v?void 0:v.holeDepth),'"'):"N/A"})]}),m(o,{display:"flex",children:[s(n,{color:"textSecondary",children:"Comment MD: "}),s(n,{children:null!=v&&v.MD?"".concat(Math.floor(null==v?void 0:v.MD),'"'):"N/A"})]})]})};f.propTypes={feedItem:t.shape({context:t.shape({geosteering_comments:t.shape({body:t.string.isRequired,attachment:t.shape({url:t.string,size:t.number}),data:t.shape({targetStructure:t.string,recommendedWindow:t.string,isRecommendation:t.bool,axis:t.shape({holeDepth:t.number,MD:t.number})})}).isRequired}).isRequired,mentioned_users:t.arrayOf(t.shape({}))}).isRequired};export{f as default};
//# sourceMappingURL=GeosteeringFeedItem.js.map
