"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 d=s(e),o=s(t),p=s(i),l=a.makeStyles((function(e){return{columnWithMargin:{marginRight:40},highlightedText:{color:p.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}}})),c=function(e){var t=e.feedItem.context.npt_event.data,i=t.comment,s=void 0===i?"":i,d=t.depth,p=t.end_time,c=t.start_time,u=t.type,m=void 0===u?"":u,h=l(),y=c?o.default.unix(c):o.default(),v=p?o.default.unix(p):void 0,g=v&&o.default.duration(v-y).asHours(),x=r.convertValue(d,"length","ft");return n.jsxs(a.Grid,{spacing:8,justify:"flex-start",container:!0,children:[n.jsxs(a.Grid,{item:!0,className:h.columnWithMargin,children:[n.jsxs(a.Typography,{variant:"body2",className:h.valueWrapper,children:["Type: ",n.jsx(a.Typography,{variant:"body2","data-testid":"".concat("nptActivity","_type"),component:"span",className:h.highlightedText,children:m})]}),n.jsx(a.Typography,{variant:"body2",children:"Duration:"}),n.jsxs(a.Typography,{variant:"body2",className:h.valueWrapper,children:[n.jsx(a.Typography,{"data-testid":"".concat("nptActivity","_duration"),component:"span",variant:"h6",className:h.highlightedText,children:Number.isFinite(g)&&g.toFixed(2)||"-"}),g&&n.jsx(a.Typography,{"data-testid":"".concat("nptActivity","_durationUnits"),component:"span",variant:"caption",className:h.unit,children:"(hrs)"})]})]}),n.jsxs(a.Grid,{item:!0,children:[n.jsxs(a.Typography,{variant:"body2","data-testid":"".concat("nptActivity","_startTime"),className:h.valueWrapper,children:[n.jsx(a.Typography,{variant:"body2",component:"span",className:h.text,children:"Start Time:"}),y.format("MM/DD/YYYY HH:mm")]}),n.jsxs(a.Typography,{variant:"body2","data-testid":"".concat("nptActivity","_depth"),className:h.valueWrapper,children:[n.jsx(a.Typography,{variant:"body2",component:"span",className:h.text,children:"Depth:"}),null==x?void 0:x.formatNumeral("0,0.00"),n.jsxs(a.Typography,{component:"span",variant:"caption",className:h.unit,children:["(",r.getUnitDisplay("length"),")"]})]}),s&&n.jsxs(a.Typography,{variant:"body2","data-testid":"".concat("nptActivity","_comment"),className:h.valueWrapper,children:[n.jsx(a.Typography,{variant:"body2",component:"span",className:h.text,children:"Comment:"}),s]})]})]})},u=d.default.shape({comment:d.default.string.isRequired,depth:d.default.number.isRequired,end_time:d.default.number.isRequired,start_time:d.default.number.isRequired,type:d.default.string.isRequired}).isRequired;c.propTypes={feedItem:d.default.shape({context:d.default.shape({completion_npt_event:d.default.shape({data:u}).isRequired,npt_event:d.default.shape({data:u}).isRequired}).isRequired}).isRequired},module.exports=c;
