import{shape as i,bool as r,func as l}from"prop-types";import{makeStyles as e,Dialog as t,DialogContent as a}from"@material-ui/core";import o from"../../../../Drillstring/BhaIndicator/BhaIndicator.js";import n from"../../../../Drillstring/BHASchematic.js";import s from"../../../../Drillstring/DrillstringDetail/DrillstringDetail.js";import{getUnitDisplay as d}from"../../../../../utils/convert.js";import{getBHAInformation as D,calculateBHALengthMax as m,getBHASchematic as p}from"../../../../../utils/bha.js";import{jsxs as g,Fragment as h,jsx as c}from"react/jsx-runtime";var u=e({wrapper:{width:200,cursor:"pointer",marginTop:-52,marginBottom:-52},bhaDetail:{maxWidth:1500,maxHeight:"80%"}}),f=function(i){var r,l,e,f,v,S=i.feedItem,w=i.drillStringData,j=i.handleShowDrillstringDetailDialog,x=i.isShowDrillstringDetailDialog,b=i.handleHideDrillstringDetailDialog,q=u(),I=null===(r=S.well)||void 0===r?void 0:r.id,R=null===(l=S.context)||void 0===l||null===(e=l.bha)||void 0===e||null===(f=e.data)||void 0===f?void 0:f.id,B=D(I,R,w),H=m(w),y=null===(v=B.data)||void 0===v?void 0:v.components,C=y&&p(y);return g(h,{children:[c("div",{className:q.wrapper,onClick:j,children:C&&c(n,{schematic:C,bhaLengthMax:H},I)}),c(o,{align:"left"}),c(t,{classes:{paperScrollPaper:q.bhaDetail},open:x,onClose:b,scroll:"paper",children:c(a,{children:c(s,{drillStringInfo:B,unit:d("length"),onDone:b})})})]})};f.propTypes={feedItem:i().isRequired,drillStringData:i().isRequired,isShowDrillstringDetailDialog:r.isRequired,handleShowDrillstringDetailDialog:l.isRequired,handleHideDrillstringDetailDialog:l.isRequired};export{f as default};
