import{useMemo as e}from"react";import{shape as i,number as t,string as r,arrayOf as n}from"prop-types";import a from"classnames";import{makeStyles as o,Grid as c,Typography as s}from"@material-ui/core";import d from"@material-ui/core/colors/blue";import{getUnitDisplay as l,convertValue as m}from"../../../utils/convert.js";import{ctop as u}from"../../../utils/FluidCheckUtils.js";import{jsxs as p,jsx as f}from"react/jsx-runtime";var y="fluidReportActivity",h=o((function(e){return{density:{color:d[300]},unit:{color:e.palette.grey[400],marginLeft:5},oneLineText:{display:"flex",alignItems:"center"},title:{color:e.palette.grey[400]},columnWithMargin:{marginRight:40}}})),v=function(i){var t=i.feedItem.context.fluid_report.data,r=t.depth,n=t.mud_type,o=t.mud_density,d=t.viscosity,v=d.pv,R=void 0===v?"":v,g=d.yp,q=void 0===g?"":g,N=d.rpm_readings,_=h(),x=u(r,"length","ft"),b=x?x.formatNumeral("0,0"):"-",F=l("length"),L=m(+o,"density","ppg").formatNumeral("0,0.00"),T=l("density"),j=l("yp"),P=Number.isFinite(R)?R.fixFloat(3):R,I=Number.isFinite(q)?q.fixFloat(3):q,M=e((function(){var e=N.length-1;return N.reduce((function(i,t,r){var n=r===e?"":", ",a="".concat(t.rpm,"/").concat(t.dial_reading);return"".concat(i).concat(a).concat(n)}),"")}),[N]);return p(c,{container:!0,justify:"flex-start",children:[p(c,{item:!0,className:_.columnWithMargin,children:[f(s,{variant:"body2",children:"Density"}),p(s,{variant:"h6","data-testid":"".concat(y,"_density"),className:a(_.density,_.oneLineText),children:[L,p(s,{component:"span",variant:"caption",className:_.unit,children:["(",T,")"]})]}),p(s,{className:_.oneLineText,children:[b,p(s,{component:"span",variant:"caption",className:_.unit,children:["(",F,")"]})," / ",n]})]}),p(c,{item:!0,children:[p(s,{variant:"body2","data-testid":"".concat(y,"_viscosity"),className:_.oneLineText,children:[f(s,{variant:"span",className:_.title,children:"PV: "}),"".concat(P," ").concat("cP"," / YP: ").concat(I),f(s,{component:"span",variant:"caption",className:_.unit,children:j})]}),f(s,{variant:"body2",className:_.title,children:"Rheometer Readings (RPM/Dial Reading):"}),f(s,{variant:"body2","data-testid":"".concat(y,"_rheometerReadings"),children:M})]})]})};v.propTypes={feedItem:i({context:i({fluid_report:i({data:i({depth:t.isRequired,mud_type:r.isRequired,mud_density:t.isRequired,viscosity:i({pv:t.isRequired,yp:t.isRequired,rpm_readings:n(i({id:r.isRequired,dial_reading:t.isRequired,rpm:t.isRequired})).isRequired}).isRequired}).isRequired}).isRequired}).isRequired}).isRequired};export{v as default};
//# sourceMappingURL=FluidReportFeedItem.js.map
