import e from"@babel/runtime/helpers/defineProperty";import t from"prop-types";import r from"moment";import{makeStyles as i,Box as m}from"@material-ui/core";import{getUnitDisplay as n,convertValue as a}from"../../../utils/index.js";import{isNativeDetected as o}from"../../../utils/mobileDetect.js";import{Regular14 as s}from"../../Typography.js";import p from"../../Attachment/index.js";import{formatMentionText as c}from"../../UserMention/utils/index.js";import l 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=i((function(e){return{message:{lineHeight:"20px"},container:{marginBottom:4,lineHeight:"20px"},label:{color:e.palette.primary.text6}}})),g=function(e){var t=e.feedItem,i=b(),g=t.context,x=g[d.DEPTH_COMMENTS],y=x.body,T=x.commentDepth,j=x.recordTimestamp,N=g.attachment,D=t.mentioned_users,R=n("length"),q=a(+T,"length","ft");return u(m,{whiteSpace:"pre-wrap",children:[y&&f(l,{children:f(s,{className:i.message,"data-testid":"".concat("DepthCommentFeedItem","_message"),variant:"body1",children:c(y,D,o)})}),u(m,{mt:1,mb:1,children:[u(s,{className:i.container,children:[f("span",{className:i.label,children:"Depth: "}),"".concat(Math.round(q).toLocaleString()," ").concat(R)]}),j&&u(s,{className:i.container,children:[f("span",{className:i.label,children:"Record Time: "}),r.unix(j).format(h)]})]}),N&&N.url&&f(p,{attachmentUrl:N.url,fileName:N.name,attachmentSize:N.size,size:"medium"})]})};g.propTypes={feedItem:t.shape({context:t.shape(e({},d.DEPTH_COMMENTS,t.shape({body:t.string.isRequired,attachment:t.shape({url:t.string,size:t.number}),commentDepth:t.oneOfType([t.string,t.number]).isRequired,recordTimestamp:t.number,timestamp:t.string.isRequired}).isRequired)).isRequired,mentioned_users:t.arrayOf(t.shape({}))}).isRequired};export{g as default};
