import{jsx as e,jsxs as t}from"react/jsx-runtime";import{memo as l,useMemo as r,useCallback as o}from"react";import{Checkbox as i}from"../../Checkbox/Checkbox.js";import{TableCell as n}from"../../../components/Table/TableCell/TableCell.js";import{TableRow as s}from"@material-ui/core";import a from"./TableSortLabel.js";import{SortDirection as c}from"./helpers/sortPads.js";import{COLUMNS as d}from"./helpers/columns.js";import m from"./PadsTableHead.scss.js";var h=l((function(l){var h=l.handleSelectPads,u=l.allWellIds,f=l.selectedOffsetWellIds,p=l.setSortBy,C=l.setSortDirection,S=l.sortBy,b=l.sortDirection,v=r((function(){return{padsIntermediate:(null==u?void 0:u.length)!==(null==f?void 0:f.length)&&!(null==f||!f.length),isAllPadsSelected:f.length===(null==u?void 0:u.length)}}),[u,f]),j=v.padsIntermediate,g=v.isAllPadsSelected,y=o((function(e){p(e),C(e===S&&b===c.ASC?c.DESC:c.ASC)}),[p,C,S,b]);return e(s,{children:d.map((function(l,r){var o=l.title,s=l.sortBy;return e(n,{className:m.headCell,style:{width:d[r].width},children:t("div",{className:m.cellContent,children:[!r&&e(i,{size:"medium",onChange:function(e){return h(e)},checked:g,indeterminate:j}),e(a,{title:"Sort",active:S===s,sortBy:s,direction:S===s&&b===c.DESC?"desc":"asc",onClick:y,children:o})]})},o)}))})}));export{h as default};
//# sourceMappingURL=PadsTableHead.js.map
