import{jsx as e,jsxs as l}from"react/jsx-runtime";import{useMemo as r}from"react";import t from"classnames";import{TableCell as n}from"../../../components/Table/TableCell/TableCell.js";import{TableRow as i}from"@material-ui/core";import{Checkbox as a}from"../../Checkbox/Checkbox.js";import{COLUMNS as d}from"./helpers/columns.js";import s from"./PadTableRow.scss.js";var c=function(c){var o=c.data,m=c.handleSelectPad,u=c.handleSelectWellId,f=c.isExpanded,h=c.isMainPad,p=c.selectedOffsetWellIds,x=c.searchText,C=r((function(){var e=o.wells.every((function(e){return p.includes(e.id)}));return{indeterminate:o.wells.some((function(e){return p.includes(e.id)}))&&!e,checked:e}}),[o.wells,p]),b=C.indeterminate,v=C.checked;return e(i,{children:d.map((function(r,i){var d=r.title,c=r.render,C=r.width;return e(n,{className:t(s.cell,h?s.blueCell:s.greyCell),style:{width:C},children:l("div",{className:s.cellContent,children:[!i&&!h&&e(a,{size:"medium",onChange:function(e){return m(o.id,e)},checked:v,indeterminate:b}),e("div",{children:c({data:o,isSelected:v||b,selectedOffsetWellIds:p,handleSelectWellId:u,isExpanded:f,isMainPad:h,searchText:x})})]})},d)}))})};export{c as default};
//# sourceMappingURL=PadTableRow.js.map
