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