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