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