import t from"prop-types";import e from"moment";import{makeStyles as a,Grid as i,Typography as n}from"@material-ui/core";import r from"@material-ui/core/colors/blue";import{convertValue as o,getUnitDisplay as c}from"../../../utils/convert.js";import{jsxs as s,jsx as m}from"react/jsx-runtime";var d=a((function(t){return{columnWithMargin:{marginRight:40},highlightedText:{color:r[300],textTransform:"capitalize"},valueWrapper:{display:"flex",alignItems:"baseline"},unit:{color:t.palette.grey[400],marginLeft:5},text:{color:t.palette.grey[400],marginRight:5}}})),p=function(t){var a=t.feedItem.context.completion_npt_event.data,r=a.comment,p=void 0===r?"":r,l=a.depth,u=a.end_time,h=a.start_time,v=a.type,y=void 0===v?"":v,g=d(),f=h?e.unix(h):e(),b=u?e.unix(u):void 0,x=b&&e.duration(b-f).asHours(),N=o(l,"length","ft");return s(i,{spacing:8,justify:"flex-start",container:!0,children:[s(i,{item:!0,className:g.columnWithMargin,children:[s(n,{variant:"body2",className:g.valueWrapper,children:["Type: ",m(n,{variant:"body2","data-testid":"".concat("nptActivity","_type"),component:"span",className:g.highlightedText,children:y})]}),m(n,{variant:"body2",children:"Duration:"}),s(n,{variant:"body2",className:g.valueWrapper,children:[m(n,{"data-testid":"".concat("nptActivity","_duration"),component:"span",variant:"h6",className:g.highlightedText,children:Number.isFinite(x)&&x.toFixed(2)||"-"}),x&&m(n,{"data-testid":"".concat("nptActivity","_durationUnits"),component:"span",variant:"caption",className:g.unit,children:"(hrs)"})]})]}),s(i,{item:!0,children:[s(n,{variant:"body2","data-testid":"".concat("nptActivity","_startTime"),className:g.valueWrapper,children:[m(n,{variant:"body2",component:"span",className:g.text,children:"Start Time:"}),f.format("MM/DD/YYYY HH:mm")]}),s(n,{variant:"body2","data-testid":"".concat("nptActivity","_depth"),className:g.valueWrapper,children:[m(n,{variant:"body2",component:"span",className:g.text,children:"Depth:"}),Number.isFinite(N)?N.formatNumeral("0,0.00"):"N/A",s(n,{component:"span",variant:"caption",className:g.unit,children:["(",c("length"),")"]})]}),p&&s(n,{variant:"body2","data-testid":"".concat("nptActivity","_comment"),className:g.valueWrapper,children:[m(n,{variant:"body2",component:"span",className:g.text,children:"Comment:"}),p]})]})]})};p.propTypes={feedItem:t.shape({context:t.shape({completion_npt_event:t.shape({data:t.shape({comment:t.string.isRequired,depth:t.number.isRequired,end_time:t.number.isRequired,start_time:t.number.isRequired,type:t.string.isRequired}).isRequired}).isRequired}).isRequired}).isRequired};export{p as default};
//# sourceMappingURL=CompletionNptFeedItem.js.map
