"use strict";var e=require("@babel/runtime/helpers/defineProperty"),i=require("prop-types"),l=require("classnames"),s=require("@material-ui/core"),t=require("../BHATileIcon.js"),a=require("./styles.css.js"),n=require("../../../utils/bha.js"),r=require("react/jsx-runtime");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=c(e),o=c(l),u=[{key:"tfa",label:"TFA"},{key:"cpl",label:"CPL at TD"},{key:"sp",label:"SP at TD"},{key:"ecd",label:"ECD at TD"}];function m(e){var i,l,c=e.isMobile,m=e.drillstring,h=e.isSelected,p=e.onSelect,b=e.height,f=e.isMetricsHidden,j=(null==m||null===(i=m.data)||void 0===i?void 0:i.components)||[],v=n.getBHASchematic(j);return r.jsxs("div",{className:o.default(a.tileContainer,d.default({},a.selected,h)),onClick:function(){return p(m)},children:[r.jsxs("div",{className:a.header,children:[r.jsxs("div",{className:a.bhaTile,children:[r.jsx(s.Chip,{label:null==m||null===(l=m.data)||void 0===l?void 0:l.id,classes:{root:o.default(a.rootChip,d.default({},a.selectedChip,h)),label:a.chipLabel}}),r.jsx("span",{className:a.bhaCaption,children:"BHA"})]}),r.jsxs("div",{className:a.componentsCount,children:["Components: ",j.length]})]}),j.length>0&&r.jsx("div",{className:o.default(a.schematic,d.default({},a.schematicMobile,c)),children:v.map((function(e,i){return r.jsx(t,{component:e,width:"calc(100% / ".concat(v.length," - 1px)"),height:b},"bha-tile-".concat(i))}))}),!f&&!c&&j.length>0&&r.jsx("div",{className:a.metricsContainer,children:u.map((function(e){return r.jsxs("div",{className:a.metricItem,children:[r.jsxs("div",{className:a.metricItemContent,children:[r.jsx("div",{className:a.metricItemLabel,children:e.label}),r.jsx("div",{className:a.metricItemValue,children:"0.0"})]}),"ecd"!==e.key&&r.jsx("div",{className:a.metricItemSplit})]},e.key)}))}),0===j.length&&r.jsx("div",{className:o.default(a.noComponents,d.default({},a.noComponentsMobile,c)),children:"No Components"})]})}m.propTypes={drillstring:i.shape({data:i.shape({components:i.arrayOf(i.shape({}))})}),isSelected:i.bool,onSelect:i.func.isRequired,height:i.number,isMetricsHidden:i.bool,isMobile:i.bool},m.defaultProps={drillstring:null,isSelected:!1,height:16,isMetricsHidden:!1,isMobile:!1},module.exports=m;
//# sourceMappingURL=BHATile.js.map
